Showing posts with label CCIE. Show all posts
Showing posts with label CCIE. Show all posts

24 February, 2017

Types and Codes


Type 3
Codes :

- Network Unreachable  (Router does not have route and can not send)
- Host Unreachable     (Router knows about network but cant send packet to the host for any reason. ej: L2 problem with host)
- Protocol Unreachable (Packet are delivered but some L4 Problem, does not know Protocol)
- Port Unreachable     (Port Problem, no open service on that port)
- Fragmentation        (MTU Problems / Fragmentation needed but DF Set)
- Source Routing       (IP Source Routing problem / no ip source-route)
- Obsolete Code        (Obsolete Code)
- Obsolete Code        (Obsolete Code)
- Obsolete Code        (Obsolete Code)
- Admin Prohibited     (Access-List or Wirewall Host Was prohibited)
10
- Admin Prohibited     (Access-List or Wirewall Network Was Prohibited)
11
- QoS, ToS and IP Precedence Problems
12
- QoS, ToS and IP Precedence Problems
13
- Admin Prohibited     (Access-List or Wirewall General Prohibited msg)
14
- QoS, ToS and IP Precedence Problems
15
- QoS, ToS and IP Precedence Problems

--------------------------------------------------------------------------------

Code 4: Fragmentation

- Route-map Configuration
route-map clear-df permit 36
match ip address 136
set ip df 0
 
- Access list 2.2.2.2 is the offending website and 3.3.3.0 is the remote site subnet.
access-list 136 permit tcp host 2.2.2.2 3.3.3.0 0.0.0.255
 
- Appply on interface:
ip policy route-map clear-df

Note:
Configure bit to “0” (zero) to allow fragmentation.
DF=1= Don’t allow fragmentation


-------------------------------------------------------------------------------------------------------------------------

ICMP Redirect (Type 5)

Type 5, Codes 0 - 3 :
 
- 0 Network 
- Host
- Service / Network 
- Service / Host


Questions router asks before sending a redirect :
- Is route outthe same interface ?
 
- Are ip redirectsenabled on that interface ?  
- Is source IP from same network as the better next hop ?

Won`t send redirect for a source-routed packet. 





Wireshark Online Capture here :

We can see in debug:

R2#debug ip icmp
ICMP packet debugging is on
*Feb 28 08:50:53.750: ICMP: redirect sent to 10.123.0.1 for dest 4.4.4.4, use gw 10.123.0.3

Note: Use no ip redirects command on Interface to turn off ICMP Redirects. 


-------------------------------------------------------------------------------------------------------------------------

ICMP TYPE NUMBERS

The Internet Control Message Protocol (ICMP) has many messages that
are identified by a "type" field.

Type Name     Reference
---- -------------------------  ---------
  0 Echo Reply     [RFC792]
  1 Unassigned        [JBP]
  2 Unassigned        [JBP]
  3 Destination Unreachable    [RFC792]
  4 Source Quench      [RFC792]
  5 Redirect     [RFC792]
  6 Alternate Host Address       [JBP]
  7 Unassigned        [JBP]
  8 Echo      [RFC792]
  9 Router Advertisement   [RFC1256]
 10 Router Selection   [RFC1256]
 11 Time Exceeded     [RFC792]
 12 Parameter Problem    [RFC792]
 13 Timestamp     [RFC792]
 14 Timestamp Reply     [RFC792]
 15 Information Request    [RFC792]
 16 Information Reply    [RFC792]
 17 Address Mask Request                     [RFC950]
 18 Address Mask Reply    [RFC950]
 19 Reserved (for Security)      [Solo]
 20-29 Reserved (for Robustness Experiment)     [ZSu]
 30 Traceroute    [RFC1393]
 31 Datagram Conversion Error  [RFC1475]
 32     Mobile Host Redirect              [David Johnson]
 33     IPv6 Where-Are-You                 [Bill Simpson]
 34     IPv6 I-Am-Here                     [Bill Simpson]
 35     Mobile Registration Request        [Bill Simpson]
 36     Mobile Registration Reply          [Bill Simpson]
 37     Domain Name Request                     [Simpson]
 38     Domain Name Reply                       [Simpson]
 39     SKIP                                    [Markson]
 40     Photuris                                [Simpson]
 41-255 Reserved        [JBP]

Many of these ICMP types have a "code" field.  Here we list the types
again with their assigned code fields.

Type    Name                                    Reference
----    -------------------------               ---------
  0     Echo Reply                               [RFC792]

        Codes
            0  No Code

  1     Unassigned                                  [JBP]

  2     Unassigned                                  [JBP]

  3     Destination Unreachable                  [RFC792]

 Codes
     0  Net Unreachable
     1  Host Unreachable
            2  Protocol Unreachable
            3  Port Unreachable
            4  Fragmentation Needed and Don't Fragment was Set
            5  Source Route Failed
            6  Destination Network Unknown
            7  Destination Host Unknown
            8  Source Host Isolated
            9  Communication with Destination Network is
               Administratively Prohibited
           10  Communication with Destination Host is
               Administratively Prohibited
           11  Destination Network Unreachable for Type of Service
           12  Destination Host Unreachable for Type of Service
           13  Communication Administratively Prohibited      [RFC1812]
           14  Host Precedence Violation                      [RFC1812]
           15  Precedence cutoff in effect                    [RFC1812]


  4     Source Quench                            [RFC792]
        Codes
            0  No Code

  5     Redirect                                 [RFC792]

        Codes
            0  Redirect Datagram for the Network (or subnet)
            1  Redirect Datagram for the Host
            2  Redirect Datagram for the Type of Service and Network
            3  Redirect Datagram for the Type of Service and Host

  6     Alternate Host Address                      [JBP]

        Codes
            0  Alternate Address for Host

  7     Unassigned                                  [JBP]

  8     Echo                                     [RFC792]

        Codes
            0  No Code

  9     Router Advertisement                    [RFC1256]

        Codes
            0  No Code

 10     Router Selection                        [RFC1256]

        Codes
            0  No Code

 11     Time Exceeded                            [RFC792]

        Codes
            0  Time to Live exceeded in Transit
            1  Fragment Reassembly Time Exceeded

 12     Parameter Problem                        [RFC792]

        Codes
            0  Pointer indicates the error
            1  Missing a Required Option        [RFC1108]
            2  Bad Length


 13     Timestamp                                [RFC792]

        Codes
            0  No Code

 14     Timestamp Reply                          [RFC792]

        Codes
            0  No Code

 15     Information Request                      [RFC792]

        Codes
            0  No Code

 16     Information Reply                        [RFC792]

        Codes
            0  No Code

 17     Address Mask Request                     [RFC950]

        Codes
            0  No Code

 18     Address Mask Reply                       [RFC950]

        Codes
            0  No Code

 19     Reserved (for Security)                    [Solo]

 20-29  Reserved (for Robustness Experiment)        [ZSu]

 30     Traceroute                              [RFC1393]

 31     Datagram Conversion Error               [RFC1475]

 32     Mobile Host Redirect              [David Johnson]

 33     IPv6 Where-Are-You                 [Bill Simpson]

 34     IPv6 I-Am-Here                     [Bill Simpson]

 35     Mobile Registration Request        [Bill Simpson]

 36     Mobile Registration Reply          [Bill Simpson]

 39     SKIP                                    [Markson]

 40     Photuris                                [Simpson]

Code

0 Reserved
1 unknown security parameters index
2 valid security parameters, but authentication failed
3  valid security parameters, but decryption failed

===================================================================

23 February, 2017

General Network Challenges

Unicast Flooding :

Reasons:
 
- Asymetric Routing 
- STP TCNs  
- Full MAC Table (Attack)

Solutions:
 
- STP Portfast Feature 
- Port Security Feature 
- Unknown Unicast and Multicast Flood Control Feature (UUFB,UUFRL,UMFB)

Impact Of Microbursts:


Short Spike - Overwhelms Capacity

Merging 4 Lanes into 3

Impact: 

- Delayed/Dropped Packets/Frames
- Congestion on Downstream Systems 
- SLA 
- Application Failure

Solution: 

 - QoS

Out Of Orden Packets:

Reasons:
- Multiple Paths (L2/L3)

- Qos Treatment 
- Route / Path Problems

Solutions:
 
- Session Based Path Selection (On Etherchannel, CEF and etc...)
- TCP Reassembly 
- Permit on Intermediate Devices (FW)

CEF

Packets that CEF cannot handle: 
- IP Header Options
- Expiring TTL 
- Tunnel int
- Exceed MTU 
- IGMP Redirect

Load Balancing Options
 
- Per-Packets
- Per-Dessession (Session)



IOU1(config)#ip cef load-sharing algorithm universal

CLIENT#traceroute 8.8.8.8 probe 10
Type escape sequence to abort.
Tracing the route to 8.8.8.8
VRF info: (vrf in name/id, vrf out name/id)
  1 1.1.1.1 5 msec 4 msec 1 msec 5 msec 4 msec 9 msec 5 msec 0 msec 2 msec 1 msec
  2 10.12.0.2 9 msec 10 msec 9 msec 9 msec 9 msec 9 msec 9 msec 30 msec 9 msec 9 msec
  3 10.24.0.4 18 msec 17 msec 23 msec 14 msec 17 msec 18 msec 18 msec 17 msec 17 msec 13 msec
  4 10.48.0.8 27 msec 27 msec 26 msec 26 msec 25 msec 26 msec 25 msec 28 msec 26 msec 25 msec
  

IOU1(config)#do show ip cef 8.8.8.8 255.255.255.255 internal
8.8.8.8/32, epoch 0, RIB[I], refcount 5, per-destination sharing
  sources: RIB
  feature space:
   IPRM: 0x00028000
  ifnums:
   Serial2/0(11)
   Serial2/1(12)
  path B1F3A7D8, path list B309782C, share 1/1, type attached nexthop, for IPv4
  nexthop 10.12.0.2 Serial2/0, adjacency IP adj out of Serial2/0 B4F0C268
  path B1F3A848, path list B309782C, share 0/1, type attached nexthop, for IPv4
  nexthop 10.13.0.3 Serial2/1, adjacency IP adj out of Serial2/1 B4F0C138
  output chain:
    loadinfo B22C790C, per-session, 2 choices, flags 0083, 5 locks
    flags: Per-session, for-rx-IPv4, 2buckets
    2 hash buckets
      < 0 > IP adj out of Serial2/0 B4F0C268
      < 1 > IP adj out of Serial2/1 B4F0C138
    Subblocks:
     None


IOU1(config)#ip cef load-sharing algorithm include-ports destination

CLIENT#traceroute 8.8.8.8 probe 10
Type escape sequence to abort.
Tracing the route to 8.8.8.8
VRF info: (vrf in name/id, vrf out name/id)
  1 1.1.1.1 5 msec 5 msec 4 msec 5 msec 5 msec 5 msec 4 msec 4 msec 4 msec 6 msec
  2 10.13.0.3 6 msec
    10.12.0.2 9 msec 8 msec 9 msec 8 msec 8 msec
    10.13.0.3 9 msec
    10.12.0.2 8 msec 8 msec 11 msec
  3 10.36.0.6 17 msec
    10.24.0.4 17 msec 18 msec 17 msec 17 msec
    10.36.0.6 17 msec 14 msec
    10.24.0.4 18 msec 18 msec 17 msec
  4 10.48.0.8 27 msec 26 msec
    10.68.0.8 27 msec
    10.48.0.8 25 msec 26 msec 27 msec
    10.68.0.8 26 msec
    10.48.0.8 25 msec 26 msec 26 msec
 

IOU1#show rib client
Client name          Handle     WalkQ  WalkQ by Owner
IP Static Route        1          0      0
IP Static Default Ne   2          0      0
App Route              3          0      0

26 October, 2014

Implement and Troubleshoot Layer 2 Protocols : UDLD

- UDLD (Unidirectional Link Detection)

- Unidirectional Link Detection (UDLD) is one of two major features (UDLD and loop guard) in Cisco Switches to prevent Layer 2 loops.
- Spanning-Tree Protocol (STP) resolves redundant physical topology into a loop-free, tree-like forwarding topology via blocking one or more ports.
However, Unidirectional Link failure can cause " traffic blackholing" and loop in the Switch topology.
- In order to detect the unidirectional links before the forwarding loop is created, UDLD works by exchanging protocol packets between the neighboring devices.
- In order for UDLD to work, both switch devices on the link must support UDLD and have it enabled on respective ports.
- Recomendation configure both side with same config
- Those frames are only understood by Cisco switches
Online Capture file: Here

! Configure UDLD Global
SW8(config)#udld ?
  aggressive  Enable UDLD protocol in aggressive mode on fiber ports except where locally configured
  enable      Enable UDLD protocol on fiber ports except where locally configured
  message     Set UDLD message parameters

! Configure UDLD per interface
SW8(config)#in fastEthernet 1/0/23
SW8(config-if)#udld port aggressive

! Check UDLD Status per interface
SW8#show udld fastEthernet 1/0/23
Interface Fa1/0/23
---
Port enable administrative configuration setting: Enabled / in aggressive mode
Port enable operational state: Enabled / in aggressive mode
Current bidirectional state: Bidirectional
Current operational state: Advertisement - Single neighbor detected
Message interval: 15
Time out interval: 5

    Entry 1
    ---
    Expiration time: 40
    Device ID: 1
    Current neighbor state: Bidirectional
    Device name: FDO1123Z5D3
    Port ID: Fa0/23
    Neighbor echo 1 device: CAT0815Y0VD
    Neighbor echo 1 port: Fa1/0/23

    Message interval: 15
    Time out interval: 5
    CDP Device name: SW7

SW8#show udld neighbors
Port     Device Name   Device ID     Port ID    Neighbor State
----     -----------   ---------     -------    --------------
Fa1/0/23 FDO1123Z5D3     1            Fa0/23     Bidirectional

! Resets all LAN ports that have been shut down by UDLD.
SW7#udld reset

! Enables fast UDLD error reporting
R1(config)#udld fast-hello error-reporting

! Configure UDLD Recovery
SW8(config)#errdisable recovery cause udld 

Cisco Site

 #UDLD (Unidirectional Link Detection)
UDLD has two modes of operation

* Normal Mode - When a undirectional link condition is detected, the port is allowed to continue its operation.
 UDLD merely marks the port as having an undetermined state and generates a syslog message.

* Aggressive Mode - When a undirectional link condition is detected, the switch takes action to reestablish the link. 
 UDLD messages are sent out onec a second for 8 seconds. If none of those messages is echoed back, the port is placed 
 in the errdisable state so that it cannot be used.

#To Enable UDLD Globally Use The Following Command
S3(config)#udld [ enable | aggressive | message time SECONDS ] !(Ranging from 7 to 90 sec)

#To Enable UDLD on Specific Switch Port Use The Following Command
S3(config-if)#udld [ enable | aggressive | disable

#Reenable ports that UDLD aggressive mode has errdisabled
S3#udld reset

Implement and Troubleshoot Layer 2 Protocols : LLDP 802.1AB

L2 Neighbor Discovery
- LLDP (Link Layer Discovery Protocol 802.1AB)

Default LLDP Configuration
-------------------------
Feature                                Default Setting
----------------------------------------------------------
LLDP global state                       Disabled
LLDP timer (packet update frequency)    30  Seconds
LLDP holdtimer (before discarding)      120 Seconds
LLDP reinitialization delay             2 Seconds
LLDP Multicast destination address      01:80:C2:00:00:0E
----------------------------------------------------------

Link captured file: Here

Switch(config)#lldp ?
  holdtime    Specify the holdtime (in sec) to be sent in packets
  reinit      Delay (in sec) for LLDP initialization on any interface
  run         Enable LLDP
  timer       Specify the rate at which LLDP packets are sent (in sec)
  tlv-select  Selection of LLDP TLVs to send

! Enable LLDP Global.
Switch(config)#lldp run 

! Check LLDP per interfaces
SW8#show lldp interface fastEthernet 1/0/22
FastEthernet1/0/22:
    Tx: enabled
    Rx: enabled
    Tx state: INIT
    Rx state: WAIT PORT OPER

SW8#show lldp interface fastEthernet 1/0/23
FastEthernet1/0/23:
    Tx: enabled
    Rx: enabled
    Tx state: IDLE
    Rx state: WAIT FOR FRAME

! Enable/Disable LLDP per Interface
SW7(config)#interface fastEthernet 0/1
SW7(config-if)#no lldp ?
  med-tlv-select  Selection of LLDP MED TLVs to send
  receive         Enable LLDP reception on interface
  tlv-select      Selection of LLDP TLVs to send
  transmit        Enable LLDP transmission on interface

SW7(config-if)#no lldp transmit
SW7(config-if)#no lldp receive

SW7#show lldp interface fastEthernet 0/1
FastEthernet0/1:
    Tx: disabled
    Rx: disabled
    Tx state: INIT
    Rx state: WAIT PORT OPER

SW8#show lldp
Global LLDP Information:
    Status: ACTIVE
    LLDP advertisements are sent every 30 seconds
    LLDP hold time advertised is 120 seconds
    LLDP interface reinitialisation delay is 2 seconds

SW8#show lldp neighbors
Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID           Local Intf     Hold-time  Capability      Port ID
SW7                 Fa1/0/23       120        B               Fa0/23
Total entries displayed: 1

SW7#show lldp neighbors detail
------------------------------------------------
Chassis id: 000f.f72c.c600
Port id: Fa1/0/23
Port Description: FastEthernet1/0/23
System Name: SW8

System Description:
Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(55)SE5, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thu 09-Feb-12 18:59 by prod_rel_team

Time remaining: 112 seconds
System Capabilities: B,R
Enabled Capabilities: B
Management Addresses - not advertised
Auto Negotiation - supported, enabled
Physical media capabilities:
    100base-TX(FD)
    100base-TX(HD)
    10base-T(FD)
    10base-T(HD)
Media Attachment Unit type: 16
Vlan ID: 1
Total entries displayed: 1

SW8#show lldp traffic
LLDP traffic statistics:
    Total frames out: 24
    Total entries aged: 0
    Total frames in: 1
    Total frames received in error: 0
    Total frames discarded: 0
    Total TLVs discarded: 0
    Total TLVs unrecognized: 0

SW8#show lldp errors
LLDP errors/overflows:
    Total memory allocation failures: 0
    Total encapsulation failures: 0
    Total input queue overflows: 0
    Total table overflows: 0

! Change LLDP Timers
SW7(config)#lldp timer 10
SW7(config)#lldp holdtime 30
SW7(config)#lldp reinit 5

! Check only SW8 entry
SW7#show lldp entry SW8

Implement and Troubleshoot Layer 2 Protocols : CDP

L2 Neighbor Discovery
- CDP (Cisco Discovery Protocol)

Default CDP Configuration
-------------------------
Feature                                Default Setting
-------------------------------------------------------
CDP global state                        Enabled
CDP interface state                     Enabled
CDP timer (packet update frequency)     60  Seconds
CDP holdtimer (before discarding)       180 Seconds
CDP Version-2 advertisements            Enabled
CDP Multicast destination address       01-00-0C-CC-CC-CC
-------------------------------------------------------
*Note: This MAC address also used for VTP,DTP,PAgP and UDLD

Link captured file Here 

CDP Configuration 
! Enable CDP Global
SW1(config)#cdp run

! Enable CDP per Interface
SW1(config)#in fas0/5
SW1(if-config)#cdp enable

! Check CDP Timers
SW1#show cdp
Global CDP information:
    Sending CDP packets every 60 seconds
    Sending a holdtime value of 180 seconds
    Sending CDPv2 advertisements is enabled

! Configure CDP Timers
SW1(config)#cdp timer 30 (Sec) Packet sent interval

! Configure Holdtime
SW1(config)#cdp holdtime 90 (Sec) 

! Check CDP per Interface
SW1#show cdp interface fas 0/5
FastEthernet0/5 is up, line protocol is up
  Encapsulation ARPA
  Sending CDP packets every 30 seconds
  Holdtime is 90 seconds

! Check CDP Traffic
SW1#show cdp traffic
CDP counters :
        Total packets output: 16, Input: 6
        Hdr syntax: 0, Chksum error: 0, Encaps failed: 0
        No memory: 0, Invalid packet: 0, Fragmented: 0
        CDP version 1 advertisements output: 0, Input: 0
        CDP version 2 advertisements output: 16, Input: 6

! Check CDP Neighbors
SW1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
DSW1              Fas 0/24           133          S I      WS-C3550-2Fas 0/24

SW1#show cdp neighbors detail
-------------------------
Device ID: DSW1
Entry address(es):
  IP address: 10.99.0.20
Platform: Cisco WS-C3550-24,  Capabilities: Switch IGMP
Interface: FastEthernet0/24,  Port ID (outgoing port): FastEthernet0/24
Holdtime : 157 sec
Version :
Cisco IOS Software, C3550 Software (C3550-IPSERVICESK9-M), Version 12.2(44)SE6, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2009 by Cisco Systems, Inc.
Compiled Mon 09-Mar-09 20:28 by gereddy
advertisement version: 2
Protocol Hello:  OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=00000000FFFFFFFF010221FF0000000000000013C4260B00FF0000
VTP Management Domain: 'CISCO'
Native VLAN: 99
Duplex: full
Management address(es):
  IP address: 10.99.0.20

SW8#show cdp neighbors detail | include Device|address
Device ID: DSW1
Entry address(es):
IP address: 10.99.0.20

! Check only DSW1 entry
SW1#show cdp entry DSW1