Friday, May 10, 2019

Cisco Router Embedded Packet Capture

I had to use the built-in embedded packet capture on a Cisco router in order to troubleshoot and prove a routing issue with our ISP. This is a very handy packet capturing tool to perform deep-packet analysis and troubleshooting.

R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.137.2   YES manual up                    up     
FastEthernet1/0            unassigned      YES unset  administratively down down   
FastEthernet1/1            200.1.1.1       YES manual up                    up     
NVI0                       192.168.137.2   YES unset  up                    up     

R1#ping 192.168.137.1      // PING MY NUC WIFI SHARED ADAPTER IP
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.137.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/14/32 ms

R1#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/12 ms

R1#monitor ?                 
  call         Monitor call
  capture      Packet Capture
  elog         Event-logging control commands
  event-trace  Control event tracing
  processes    Monitor processes

R1#monitor capture ?
  buffer  Control Capture Buffers
  point   Control Capture Points

R1#monitor capture buffer ?
  WORD  Name of the Capture Buffer

R1#monitor capture buffer BUF ?
  circular  Circular Buffer
  clear     Clear contents of capture buffer
  export    Export in Pcap format
  filter    Configure filters
  limit     Limit the packets dumped to the buffer
  linear    Linear Buffer(Default)
  max-size  Maximum size of element in the buffer (in bytes)
  size      Packet Dump buffer size (in Kbytes)
  <cr>

R1#monitor capture buffer BUF size ?
  <256-102400>  Buffer size in Kbytes : 102400K or less (default is 1024K)

R1#monitor capture buffer BUF size 2048 ?
  circular  Circular Buffer
  linear    Linear Buffer(Default)
  max-size  Maximum size of element in the buffer (in bytes)
  <cr>

R1#monitor capture buffer BUF size 2048 max-size ?
  <68-9500>  Element size in bytes : 9500 bytes or less (default is 68 bytes)

R1#monitor capture buffer BUF size 2048 max-size 1518 ?
  circular  Circular Buffer
  linear    Linear Buffer(Default)
  <cr>

R1#monitor capture buffer BUF size 2048 max-size 1518 linear    // DEFINE A CAPTURE BUFFER
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip access-list extended BUF-ACL      // LIMIT THE CAPTURE USING ACL
R1(config-ext-nacl)#permit icmp any host 8.8.8.8
R1(config-ext-nacl)#permit icmp host 8.8.8.8 any
R1(config-ext-nacl)#end
R1#
*Mar 31 06:20:41.237: %SYS-5-CONFIG_I: Configured from console by console
R1#monitor capture ?
  buffer  Control Capture Buffers
  point   Control Capture Points

R1#monitor capture point ?
  associate     Associate capture point with capture buffer
  disassociate  Dis-associate capture point from capture buffer
  ip            IPv4
  ipv6          IPv6
  start         Enable Capture Point
  stop          Disable Capture Point

R1#monitor capture point associate ?
  WORD  Name of the Capture Point

R1#monitor capture point associate POINT ?
  WORD  Name of the Capture Buffer

R1#monitor capture buffer BUF ?
  circular  Circular Buffer
  clear     Clear contents of capture buffer
  export    Export in Pcap format
  filter    Configure filters
  limit     Limit the packets dumped to the buffer
  linear    Linear Buffer(Default)
  max-size  Maximum size of element in the buffer (in bytes)
  size      Packet Dump buffer size (in Kbytes)
  <cr>

R1#monitor capture buffer BUF filter ?
  access-list  Set access list

R1#monitor capture buffer BUF filter access-list ?     
  <1-199>      IP access list
  <1300-2699>  IP expanded access list
  WORD         Access-list name

R1#monitor capture buffer BUF filter access-list BUF-ACL
Filter Association succeeded

R1#monitor capture point ?
  associate     Associate capture point with capture buffer
  disassociate  Dis-associate capture point from capture buffer
  ip            IPv4
  ipv6          IPv6
  start         Enable Capture Point
  stop          Disable Capture Point

R1#monitor capture point ip ?
  cef               IPv4 CEF
  process-switched  Process switched packets

R1#monitor capture point ip cef ?
  WORD  Name of the Capture Point

R1#monitor capture point ip cef POINT ?
  Async              Async interface
  Auto-Template      Auto-Template interface
  BVI                Bridge-Group Virtual Interface
  CDMA-Ix            CDMA Ix interface
  CTunnel            CTunnel interface
  Dialer             Dialer interface
  FastEthernet       FastEthernet IEEE 802.3
  GMPLS              MPLS interface
  Group-Async        Async Group interface
  LISP               Locator/ID Separation Protocol Virtual Interface
  LongReachEthernet  Long-Reach Ethernet interface
  Loopback           Loopback interface
  MFR                Multilink Frame Relay bundle interface
  Multilink          Multilink-group interface
  Null               Null interface
  Port-channel       Ethernet Channel of interfaces
  Tunnel             Tunnel interface
  Vif                PGM Multicast Host interface
  Virtual-PPP        Virtual PPP interface
  Virtual-Template   Virtual Template interface
  Virtual-TokenRing  Virtual TokenRing
  all                All interfaces
  drop               Drop on any interface
  punt               Punt on any interface
  vmi                Virtual Multipoint Interface

R1#monitor capture point ip cef POINT fastethernet 0/0 ?
  both  capture ingress and egress
  in    capture on ingress
  out   capture on egress

R1#monitor capture point ip cef POINT fastethernet 0/0 both    // DEFINE CAPTURE POINT
R1#
*Mar 31 06:23:04.985: %BUFCAP-6-CREATE: Capture Point POINT created.
R1#monitor capture point ?
  associate     Associate capture point with capture buffer
  disassociate  Dis-associate capture point from capture buffer
  ip            IPv4
  ipv6          IPv6
  start         Enable Capture Point
  stop          Disable Capture Point

R1#monitor capture point associate ?
  WORD  Name of the Capture Point

R1#monitor capture point associate POINT ?
  WORD  Name of the Capture Buffer

R1#monitor capture point associate POINT BUF    // ATTACHED BUFFER CREATED EARLIER
R1#monitor capture point start POINT      // START CAPTURING PACKETS
R1#
*Mar 31 06:23:38.593: %BUFCAP-6-ENABLE: Capture Point POINT enabled.

R1#ping 8.8.8.8       // GENERATE ICMP PACKETS
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/34/68 ms

R1#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/19/32 ms

R1#show monitor capture buffer BUF dump      // DISPLAY PACKET CAPTURE
06:23:50.765 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 00644009  ....LOOP..E..d@.
6981B2D0: 00003501 EBD50808 0808C0A8 89020000  ..5.kU....@(....
6981B2E0: EC110014 00000000 00003D30 5CF4ABCD  l.........=0\t+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.765 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 00644009  ....LOOP..E..d@.
6981B2D0: 00003501 EBD50808 0808C0A8 89020000  ..5.kU....@(....
6981B2E0: EC110014 00000000 00003D30 5CF4ABCD  l.........=0\t+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.797 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None
         
6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 00644011  ....LOOP..E..d@.
6981B2D0: 00003501 EBCD0808 0808C0A8 89020000  ..5.kM....@(....
6981B2E0: EBCC0014 00010000 00003D30 5D38ABCD  kL........=0]8+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.797 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 00644011  ....LOOP..E..d@.
6981B2D0: 00003501 EBCD0808 0808C0A8 89020000  ..5.kM....@(....
6981B2E0: EBCC0014 00010000 00003D30 5D38ABCD  kL........=0]8+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.825 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064401A  ....LOOP..E..d@.
6981B2D0: 00003501 EBC40808 0808C0A8 89020000  ..5.kD....@(....
6981B2E0: EBAB0014 00020000 00003D30 5D58ABCD  k+........=0]X+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.825 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064401A  ....LOOP..E..d@.
6981B2D0: 00003501 EBC40808 0808C0A8 89020000  ..5.kD....@(....
6981B2E0: EBAB0014 00020000 00003D30 5D58ABCD  k+........=0]X+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.853 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064402B  ....LOOP..E..d@+
6981B2D0: 00003501 EBB30808 0808C0A8 89020000  ..5.k3....@(....
6981B2E0: EB8E0014 00030000 00003D30 5D74ABCD  k.........=0]t+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.853 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064402B  ....LOOP..E..d@+
6981B2D0: 00003501 EBB30808 0808C0A8 89020000  ..5.k3....@(....
6981B2E0: EB8E0014 00030000 00003D30 5D74ABCD  k.........=0]t+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.869 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064403A  ....LOOP..E..d@:
6981B2D0: 00003501 EBA40808 0808C0A8 89020000  ..5.k$....@(....
6981B2E0: EB710014 00040000 00003D30 5D90ABCD  kq........=0].+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:50.869 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064403A  ....LOOP..E..d@:
6981B2D0: 00003501 EBA40808 0808C0A8 89020000  ..5.k$....@(....
6981B2E0: EB710014 00040000 00003D30 5D90ABCD  kq........=0].+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.657 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 006446DD  ....LOOP..E..dF]
6981B2D0: 00003501 E5010808 0808C0A8 89020000  ..5.e.....@(....
6981B2E0: DCA80015 00000000 00003D30 6C5CABCD  \(........=0l\+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.657 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 006446DD  ....LOOP..E..dF]
6981B2D0: 00003501 E5010808 0808C0A8 89020000  ..5.e.....@(....
6981B2E0: DCA80015 00000000 00003D30 6C5CABCD  \(........=0l\+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.669 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 006446E8  ....LOOP..E..dFh
6981B2D0: 00003501 E4F60808 0808C0A8 89020000  ..5.dv....@(....
6981B2E0: DC970015 00010000 00003D30 6C6CABCD  \.........=0ll+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.669 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 006446E8  ....LOOP..E..dFh
6981B2D0: 00003501 E4F60808 0808C0A8 89020000  ..5.dv....@(....
6981B2E0: DC970015 00010000 00003D30 6C6CABCD  \.........=0ll+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.689 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 006446F7  ....LOOP..E..dFw
6981B2D0: 00003501 E4E70808 0808C0A8 89020000  ..5.dg....@(....
6981B2E0: DC8A0015 00020000 00003D30 6C78ABCD  \.........=0lx+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.689 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 006446F7  ....LOOP..E..dFw
6981B2D0: 00003501 E4E70808 0808C0A8 89020000  ..5.dg....@(....
6981B2E0: DC8A0015 00020000 00003D30 6C78ABCD  \.........=0lx+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.721 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064470E  ....LOOP..E..dG.
6981B2D0: 00003501 E4D00808 0808C0A8 89020000  ..5.dP....@(....
6981B2E0: DC750015 00030000 00003D30 6C8CABCD  \u........=0l.+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.721 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 0064470E  ....LOOP..E..dG.
6981B2D0: 00003501 E4D00808 0808C0A8 89020000  ..5.dP....@(....
6981B2E0: DC750015 00030000 00003D30 6C8CABCD  \u........=0l.+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.741 UTC Mar 31 2018 : IPv4 CEF Turbo  : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 00644714  ....LOOP..E..dG.
6981B2D0: 00003501 E4CA0808 0808C0A8 89020000  ..5.dJ....@(....
6981B2E0: DC500015 00040000 00003D30 6CB0ABCD  \P........=0l0+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.

06:23:54.741 UTC Mar 31 2018 : IPv4 LES CEF    : Fa0/0 None

6981B2B0:                            CA011AAC              J..,
6981B2C0: 00000200 4C4F4F50 08004500 00644714  ....LOOP..E..dG.
6981B2D0: 00003501 E4CA0808 0808C0A8 89020000  ..5.dJ....@(....
6981B2E0: DC500015 00040000 00003D30 6CB0ABCD  \P........=0l0+M
6981B2F0: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B300: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B310: ABCDABCD ABCDABCD ABCDABCD ABCDABCD  +M+M+M+M+M+M+M+M
6981B320: ABCDABCD ABCDABCD ABCDABCD ABCD00    +M+M+M+M+M+M+M.


R1#monitor capture point stop POINT      // STOP PACKET CAPTURE AND CLEAN UP CONFIG
R1#
*Mar 31 06:24:30.309: %BUFCAP-6-DISABLE: Capture Point POINT disabled.
R1#no monitor capture point ip cef POINT fastethernet 0/0 both
R1#
*Mar 31 06:24:57.709: %BUFCAP-6-DELETE: Capture Point POINT deleted.
R1#no monitor capture buffer BUF
Capture Buffer deleted

R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#no ip access-list extended BUF-ACL


The packet capture output on a router doesn't make sense, you'll need to export this to an external TFTP server in .pcap file format. For this scenario, I just want to quickly view packet capture. I copied and pasted the buffer output, removed the timestamp and split the data into columns using MS Excel.

To split the data into columns, select the data > click Text to Columns > choose Fixed Width > click Next > double-click to put column lines > click Next.





You can use a free online HEX to pcap converter tool to view the packet capture. Copy the middle column HEX data, paste the data in the tool (box on the left hand side) and click Decode this packet.



This was a packet capture I performed on a Cisco ASR1K router to troubleshoot a TCP handshake issue. I exported and analyzed the output using Wireshark.

ASR#monitor ?
  call         Monitor call
  capture      Packet Capture
  elog         Event-logging control commands
  event-trace  Control event tracing
  platform     Monitor platform information
  processes    Monitor processes

ASR#monitor capture ?
  WORD  Name of the Capture

ASR#monitor capture CAP ?
  access-list    access-list to be attached
  buffer         Buffer options
  class-map      class name to attached
  clear          Clear Buffer
  control-plane  Control Plane
  export         Export Buffer
  interface      Interface
  limit          Limit Packets Captured
  match          Describe filters inline
  start          Enable Capture
  stop           Disable Capture

ASR#monitor capture CAP interface ?
  GigabitEthernet     GigabitEthernet IEEE 802.3z
  Multilink           Multilink-group interface
  Port-channel        Ethernet Channel of interfaces
  TenGigabitEthernet  Ten Gigabit Ethernet
  Tunnel              Tunnel interface
  range               interface range command

ASR#monitor capture CAP interface GigabitEthernet0/0/1 ?
  both  Inbound and outbound packets
  in    Inbound packets
  out   Outbound packets

ASR#monitor capture CAP interface GigabitEthernet0/0/1 both

ASR#monitor capture CAP match ?                           
  any   all packets
  ipv4  IPv4 packets only
  ipv6  IPv6 packets only
  mac   MAC filter configuration

ASR#monitor capture CAP match ipv4 ?
  A.B.C.D/nn  IPv4 source Prefix <network>/<length>, e.g., 192.168.0.0/16
  any         Any source prefix
  host        A single source host
  protocol    Protocols

ASR#monitor capture CAP match ipv4 protocol ?
  tcp  Filter by TCP protocol
  udp  Filter by UDP protocol

ASR#monitor capture CAP match ipv4 protocol tcp ?
  A.B.C.D/nn  IPv4 source Prefix <network>/<length>, e.g., 192.168.0.0/16
  any         Any source prefix
  host        A single source host

ASR#monitor capture CAP match ipv4 protocol tcp any ? 
  A.B.C.D/nn  IPv4 destination Prefix <network>/<length>, e.g., 192.168.0.0/16
  any         Any destination prefix
  eq          Match only packets on a given port number
  gt          Match only packets with a greater port number
  host        A single destination host
  lt          Match only packets with a lower port number
  neq         Match only packets not on a given port number
  range       Match only packets in the range of port numbers

ASR#monitor capture CAP match ipv4 protocol tcp any any

ASR#monitor capture CAP start

ASR#show monitor capture CAP buffer brief
 -------------------------------------------------------------
 #   size   timestamp     source         destination   protocol
 -------------------------------------------------------------
   0 1514    0.000000   10.6.0.2      ->  10.6.101.9    TCP
   1  118    0.000000   10.6.0.2      ->  10.6.101.9    TCP
   2   54    0.000000   10.6.101.9    ->  10.6.0.2      TCP
   3 1514    0.001007   10.6.0.2      ->  10.6.101.9    TCP

<OUTPUT TRUNCATED>


ASR#show monitor capture CAP buffer brief detailed
 -------------------------------------------------------------
 #   size   timestamp     source         destination   protocol
 -------------------------------------------------------------
   0 1514    0.000000   10.6.0.2      ->  10.6.101.9    TCP
  0000:  A08CFDA2 FD3100BE 7539A703 08004500   .....1..u9....E.
  0010:  05DCD97B 40003E06 E3670A74 000C0A74   ...{@.>..g.t...t
  0020:  65450B2D C9F50AC7 56D64CEB 2DC35010   eE.-....V.L.-.P.
  0030:  003F3DA8 00000000 05F00000 C3C05AC4   .?=...........Z.

<OUTPUT TRUNCATED>


For some reason the TFTP export failed so I tried FTP instead.

ASR#monitor capture CAP export tftp://172.27.5.6/CAP.pcap
.....Failed to Export: Failed to create export file

ASR#ping 172.27.5.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.27.5.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/6 ms

ASR#monitor capture CAP export tftp://172.27.5.6/CAP.pcap
Writing CAP.pcap
Exported Successfully


Disable and remove the packet capture feature once it's finished.

ASR#monitor capture CAP stop
ASR#no monitor capture CAP
 

Friday, April 12, 2019

Configuring Dynamic Routing and Route Redistribution Between CE and PE Routers

VPNv4 Route Propagation in the MPLS VPN Network

The VRF separates the customer routes on the PE routers, but how are the prefixes transported across the service provider network? Because, potentially, numerous routes-perhaps hundred of thousands -could be transported, BGP is the ideal candidate because it is a proven and stable routing protocol for carrying that many routes. Just realize that BGP is the standard routing protocol for carrying the complete Internet routing table. Because the customer VPN routes are made unique by adding the RD to each IPv4 route-turning them into vpnv4 routes-all customer routes can safely be transported across the MPLS VPN network.

The PE router receives IPv4 routes from the CE router through an Interior Gateway Protocol (IGP) or external BGP (eBGP). These IPv4 routes from the VPN site are put into the VRF routing table. Which VRF is used depends on the VRF that is configured on the interface on the PE router toward the CE router. These routes are appended with the RD that is assigned to that VRF. Thus, they become vpnv4 routes, which are then put into MP-BGP. BGP takes care of distributing these vpnv4 routes to all PE routers in the MPLS VPN network. On the PE routers, the vpnv4 routes are stripped of the RDs and put into the VRF routing table as IPv4 routes. Whether the vpnv4 route, after stripping off the RD, is put into the VRF depends on whether the RTs allow the import into the VRF. These IPv4 routes are then advertised to the CE router through an IGP or eBGP that is running between the PE and CE router.

Because the service provider that is running the MPLS VPN network runs BGP in one autonomous system, iBGP is running between the PE routers. The propagation from eBGP-running between the PE and CE router-to MP-iBGP in the MPLS VPN network and vice versa is automatic and needs no extra configuration. However, the redistribution of MP-iBGP into the IGP that is running between the PE and CE router is not automatic. You need to configure mutual redistribution between MP-iBGP and the IGP.


1. Configure OSPF and EIGRP dynamic routing protocols on R1-PE1.
R1-PE1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1-PE1(config)#router ospf 2 ?
  vrf  VPN Routing/Forwarding Instance
  <cr>

R1-PE1(config)#router ospf 2 vrf CUSTA
R1-PE1(config-router)#?
Router configuration commands:
  area                   OSPF area parameters
  auto-cost              Calculate OSPF interface cost according to bandwidth
  bfd                    BFD configuration commands
  capability             Enable specific OSPF feature
  compatible             OSPF compatibility list
  default                Set a command to its defaults
  default-information    Control distribution of default information
  default-metric         Set metric of redistributed routes
  discard-route          Enable or disable discard-route installation
  distance               Define an administrative distance
  distribute-list        Filter networks in routing updates
  domain-id              OSPF domain-id
  domain-tag             OSPF domain-tag
  event-log              OSPF Event Logging
  exit                   Exit from routing protocol configuration mode
  help                   Description of the interactive help system
  ignore                 Do not complain about specific event
  interface-id           Source of the interface ID
  ispf                   Enable incremental SPF computation
  limit                  Limit a specific OSPF feature
  local-rib-criteria     Enable or disable usage of local RIB as route criteria
  log-adjacency-changes  Log changes in adjacency state
  max-lsa                maximum number of LSAs OSPF process will receive
  max-metric             Set maximum metric
  maximum-paths          Forward packets over multiple paths
  mpls                   Configure MPLS routing protocol parameters
  neighbor               Specify a neighbor router
  network                Enable routing on an IP network
  no                     Negate a command or set its defaults
  nsf                    Non-stop forwarding
  passive-interface      Suppress routing updates on an interface
  prefix-suppression     OSPF prefix suppression
  priority               OSPF topology priority
  queue-depth            OSPF Hello/Router process queue depth
  redistribute           Redistribute information from another routing protocol
  router-id              router-id for this OSPF process
  shutdown               Shutdown the OSPF protocol under the current instance
  snmp                   Modify snmp parameters
  summary-address        Configure IP address summaries
  timers                 Adjust routing timers
  traffic-share          How to compute traffic share over alternate paths
  ttl-security           TTL security check

R1-PE1(config-router)#network 172.16.1.0 0.0.0.3 area 0
R1-PE1(config-router)#exit
R1-PE1(config)#router eigrp 100
R1-PE1(config-router)#?
Router configuration commands:
  address-family       Enter Address Family command mode
  auto-summary         Enable automatic network number summarization
  bfd                  BFD configuration commands
  default              Set a command to its defaults
  default-information  Control distribution of default information
  default-metric       Set metric of redistributed routes
  distance             Define an administrative distance
  distribute-list      Filter entries in eigrp updates
  eigrp                EIGRP specific commands
  exit                 Exit from routing protocol configuration mode
  maximum-paths        Forward packets over multiple paths
  metric               Modify metrics and parameters for advertisement
  neighbor             Specify a neighbor router
  network              Enable routing on an IP network
  no                   Negate a command or set its defaults
  offset-list          Add or subtract offset from EIGRP metrics
  passive-interface    Suppress routing updates on an interface
  redistribute         Redistribute IPv4 routes from another routing protocol
  shutdown             Shutdown this instance of EIGRP
  summary-metric       Specify summary to apply metric/filtering
  timers               Adjust routing timers
  traffic-share        How to compute traffic share over alternate paths
  variance             Control load balancing variance

R1-PE1(config-router)#address-family ?
  ipv4  Address Family IPv4

R1-PE1(config-router)#address-family ipv4 ?
  unicast  Address Family Unicast
  vrf      Specify a specific virtual routing/forwarding instance

R1-PE1(config-router)#address-family ipv4 vrf CUSTB ?
  autonomous-system  Specify Address-Family Autonomous System Number
  <cr>

R1-PE1(config-router)#address-family ipv4 vrf CUSTB autonomous-system ?
  <1-65535>  Autonomous System

R1-PE1(config-router)#address-family ipv4 vrf CUSTB autonomous-system 100
R1-PE1(config-router-af)#?
Address Family configuration commands:
  auto-summary         Enable automatic network number summarization
  bfd                  BFD configuration commands
  default              Set a command to its defaults
  default-information  Control distribution of default information
  default-metric       Set metric of redistributed routes
  distance             Define an administrative distance
  distribute-list      Filter entries in eigrp updates
  eigrp                EIGRP specific commands
  exit-address-family  Exit Address Family configuration mode
  help                 Description of the interactive help system
  maximum-paths        Forward packets over multiple paths
  maximum-prefix       Maximum number of prefixes acceptable in aggregate
  metric               Modify metrics and parameters for advertisement
  neighbor             Specify a neighbor router
  network              Enable routing on an IP network
  no                   Negate a command or set its defaults
  offset-list          Add or subtract offset from EIGRP metrics
  passive-interface    Suppress routing updates on an interface
  redistribute         Redistribute IPv4 routes from another routing protocol
  shutdown             Shutdown address family
  summary-metric       Specify summary to apply metric/filtering
  timers               Adjust routing timers
  traffic-share        How to compute traffic share over alternate paths
  variance             Control load balancing variance

R1-PE1(config-router-af)#network 172.16.1.0 0.0.0.255
R1-PE1(config-router-af)#end
R1-PE1#


2. Configure RIPv2 and BGP dynamic routing protocols on R5-PE2.
R5-PE2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R5-PE2(config)#router rip
R5-PE2(config-router)#?
Router configuration commands:
  address-family          Enter Address Family command mode
  auto-summary            Enable automatic network number summarization
  default                 Set a command to its defaults
  default-information     Control distribution of default information
  default-metric          Set metric of redistributed routes
  distance                Define an administrative distance
  distribute-list         Filter networks in routing updates
  exit                    Exit from routing protocol configuration mode
  flash-update-threshold  Specify flash update threshold in second
  help                    Description of the interactive help system
  input-queue             Specify input queue depth
  maximum-paths           Forward packets over multiple paths
  neighbor                Specify a neighbor router
  network                 Enable routing on an IP network
  no                      Negate a command or set its defaults
  offset-list             Add or subtract offset from RIP metrics
  output-delay            Interpacket delay for RIP updates
  passive-interface       Suppress routing updates on an interface
  redistribute            Redistribute information from another routing
                          protocol
  timers                  Adjust routing timers
  traffic-share           How to compute traffic share over alternate paths
  validate-update-source  Perform sanity checks against source address of
                          routing updates
  version                 Set routing protocol version

R5-PE2(config-router)#version ?
  <1-2>  rip version 1 or 2

R5-PE2(config-router)#version 2
R5-PE2(config-router)#address-family ?
  ipv4  Address family

R5-PE2(config-router)#address-family ipv4 ?
  unicast  Address Family Modifier
  vrf      Specify parameters for a VPN Routing/Forwarding instance
  <cr>

R5-PE2(config-router)#address-family ipv4 vrf ?
  WORD  VPN Routing/Forwarding instance name

R5-PE2(config-router)#address-family ipv4 vrf CUSTA
R5-PE2(config-router-af)#?
Router Address Family configuration commands:
  auto-summary            Enable automatic network number summarization
  default                 Set a command to its defaults
  default-information     Control distribution of default information
  default-metric          Set metric of redistributed routes
  distance                Define an administrative distance
  distribute-list         Filter networks in routing updates
  exit-address-family     Exit from Address Family configuration mode
  help                    Description of the interactive help system
  maximum-paths           Forward packets over multiple paths
  neighbor                Specify a neighbor router
  network                 Enable routing on an IP network
  no                      Negate a command or set its defaults
  offset-list             Add or subtract offset from RIP metrics
  redistribute            Redistribute information from another routing
                          protocol
  timers                  Adjust routing timers
  traffic-share           How to compute traffic share over alternate paths
  validate-update-source  Perform sanity checks against source address of
                          routing updates
  version                 Set routing protocol version

R5-PE2(config-router-af)#network 192.168.1.0
R5-PE2(config-router-af)#no auto-summary
R5-PE2(config-router-af)#exit
R5-PE2(config-router)#exit
R5-PE2(config)#router bgp 65000
R5-PE2(config-router)#?
Router configuration commands:
  address-family        Enter Address Family command mode
  aggregate-address     Configure BGP aggregate entries
  auto-summary          Enable automatic network number summarization
  bgp                   BGP specific commands
  default               Set a command to its defaults
  default-information   Control distribution of default information
  default-metric        Set metric of redistributed routes
  distance              Define an administrative distance
  distribute-list       Filter networks in routing updates
  exit                  Exit from routing protocol configuration mode
  help                  Description of the interactive help system
  maximum-paths         Forward packets over multiple paths
  neighbor              Specify a neighbor router
  network               Specify a network to announce via BGP
  no                    Negate a command or set its defaults
  redistribute          Redistribute information from another routing protocol
  route-server-context  Enter route server context command mode
  scope                 Enter scope command mode
  snmp                  Modify snmp parameters
  synchronization       Perform IGP synchronization
  table-map             Map external entry attributes into routing table
  template              Enter template command mode
  timers                Adjust routing timers

R5-PE2(config-router)#address-family ?
  ipv4      Address family
  ipv6      Address family
  l2vpn     Address family
  nsap      Address family
  rtfilter  Address family
  vpnv4     Address family
  vpnv6     Address family

R5-PE2(config-router)#address-family ipv4 ?
  mdt        Address Family modifier
  multicast  Address Family modifier
  mvpn       Address Family modifier
  unicast    Address Family modifier
  vrf        Specify parameters for a VPN Routing/Forwarding instance
  <cr>

R5-PE2(config-router)#address-family ipv4 vrf CUSTB
R5-PE2(config-router-af)#?
Router Address Family configuration commands:
  aggregate-address    Configure BGP aggregate entries
  bgp                  BGP specific commands
  default              Set a command to its defaults
  default-information  Control distribution of default information
  default-metric       Set metric of redistributed routes
  distance             Define an administrative distance
  distribute-list      Filter networks in routing updates
  exit-address-family  Exit from Address Family configuration mode
  help                 Description of the interactive help system
  import               Configure path import
  maximum-paths        Forward packets over multiple paths
  neighbor             Specify a neighbor router
  network              Specify a network to announce via BGP
  no                   Negate a command or set its defaults
  redistribute         Redistribute information from another routing protocol
  snmp                 Modify snmp parameters
  synchronization      Perform IGP synchronization
  table-map            Map external entry attributes into routing table

R5-PE2(config-router-af)#neighbor 192.168.1.2 remote-as 65001       // EBGP PEERING WITH CUSTB-SITE2
R5-PE2(config-router-af)#exit
R5-PE2(config-router)#address-family vpnv4        // IBGP PEERING WITH R1-PE1
R5-PE2(config-router-af)#neighbor 10.1.1.1 ?
  activate                Enable the Address Family for this Neighbor
  advertise               Advertise to this neighbor
  advertisement-interval  Minimum interval between sending BGP routing updates
  allowas-in              Accept as-path with my AS present in it
  capability              Advertise capability to the peer
  distribute-list         Filter updates to/from this neighbor
  dmzlink-bw              Propagate the DMZ link bandwidth
  filter-list             Establish BGP filters
  inherit                 Inherit a template
  inter-as-hybrid         Inter AS Hybrid mode
  maximum-prefix          Maximum number of prefixes accepted from this peer
  next-hop-self           Disable the next hop calculation for this neighbor
  next-hop-unchanged      Propagate next hop unchanged for iBGP paths to this
                          neighbor
  prefix-list             Filter updates to/from this neighbor
  remove-private-as       Remove private AS number from outbound updates
  route-map               Apply route map to neighbor
  route-reflector-client  Configure a neighbor as Route Reflector client
  send-community          Send Community attribute to this neighbor
  slow-peer               Configure slow-peer
  soft-reconfiguration    Per neighbor soft reconfiguration
  soo                     Site-of-Origin extended community
  unsuppress-map          Route-map to selectively unsuppress suppressed routes
  weight                  Set default weight for routes from this neighbor

R5-PE2(config-router-af)#neighbor 10.1.1.1 next-hop-self
R5-PE2(config-router-af)#end
R5-PE2#
*Nov 26 14:49:14.133: %SYS-5-CONFIG_I: Configured from console by console
R5-PE2#clear ip bgp 10.1.1.1      // CLEAR BGP PEER TO REFLECT CHANGES
R5-PE2#
*Nov 26 14:49:32.405: %BGP-5-ADJCHANGE: neighbor 10.1.1.1 Down User reset
*Nov 26 14:49:32.405: %BGP_SESSION-5-ADJCHANGE: neighbor 10.1.1.1 VPNv4 Unicast topology base removed from session  User reset
*Nov 26 14:49:32.409: %BGP_SESSION-5-ADJCHANGE: neighbor 10.1.1.1 IPv4 Unicast topology base removed from session  User reset
*Nov 26 14:49:32.869: %BGP-5-ADJCHANGE: neighbor 10.1.1.1 Up


3. Configure interface IP address and dynamic routing protocol on CE Router (no VRF).
R6#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R6(config)#hostname CUSTA-SITE1
CUSTA-SITE1(config)#interface f1/0
CUSTA-SITE1(config-if)#ip address 172.16.1.2 255.255.255.252      // IP ADDRESS IN GLOBAL ROUTING TABLE; NO NEED TO CONFIGURE VRF
CUSTA-SITE1(config-if)#no shutdown
CUSTA-SITE1(config-if)#
*Nov 26 00:35:48.304: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Nov 26 00:35:49.304: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
CUSTA-SITE1(config-if)#do ping 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 8/19/28 ms
CUSTA-SITE1(config-if)#
CUSTA-SITE1(config-if)#interface loopback1
CUSTA-SITE1(config-if)#
*Nov 26 00:36:04.696: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
CUSTA-SITE1(config-if)#ip address 172.16.1.99 255.255.255.255
CUSTA-SITE1(config-if)#exit
CUSTA-SITE1(config)#router ospf 2      // NO NEED TO CONFIGURE UNDER VRF
CUSTA-SITE1(config-router)#network 172.16.1.0 0.0.0.255 area 0
CUSTA-SITE1(config-router)#
*Nov 26 00:37:17.100: %OSPF-5-ADJCHG: Process 2, Nbr 172.16.1.1 on FastEthernet1/0 from LOADING to FULL, Loading Done
CUSTA-SITE1(config-router)#end
CUSTA-SITE1#
*Nov 26 00:37:33.388: %SYS-5-CONFIG_I: Configured from console by console
CUSTA-SITE1#
CUSTA-SITE1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.1.1        1   FULL/DR         00:00:36    172.16.1.1      FastEthernet1/0


R1-PE1#
*Nov 26 14:56:27.681: %OSPF-5-ADJCHG: Process 2, Nbr 172.16.1.99 on FastEthernet1/0 from LOADING to FULL, Loading Done
R1-PE1#show ip route vrf CUSTA

Routing Table: CUSTA
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C        172.16.1.0/30 is directly connected, FastEthernet1/0
L        172.16.1.1/32 is directly connected, FastEthernet1/0
O        172.16.1.99/32 [110/2] via 172.16.1.2, 00:03:00, FastEthernet1/0


R7#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R7(config)#hostname CUSTB-SITE-1
CUSTB-SITE-1(config)#host CUSTB-SITE1
CUSTB-SITE1(config)#interface f1/1
CUSTB-SITE1(config-if)#ip address 172.16.1.2 255.255.255.252
CUSTB-SITE1(config-if)#no shutdown
CUSTB-SITE1(config-if)#
*Nov 26 00:41:56.068: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Nov 26 00:41:57.068: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
CUSTB-SITE1(config-if)#do ping 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 12/34/72 ms
CUSTB-SITE1(config-if)#
CUSTB-SITE1(config-if)#exit
CUSTB-SITE1(config)#interface loopback1
CUSTB-SITE1(config-if)#
*Nov 26 00:42:32.268: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
CUSTB-SITE1(config-if)#ip address 172.16.1.100 255.255.255.255
CUSTB-SITE1(config-if)#exit
CUSTB-SITE1(config)#router eigrp 100
CUSTB-SITE1(config-router)#no auto-summary
CUSTB-SITE1(config-router)#network 172.16.1.0 0.0.0.255
*Nov 26 00:43:21.440: %DUAL-5-NBRCHANGE: EIGRP-IPv4 100: Neighbor 172.16.1.1 (FastEthernet1/1) is up: new adjacency
CUSTB-SITE1(config-router)#end
CUSTB-SITE1#
*Nov 26 00:43:31.856: %SYS-5-CONFIG_I: Configured from console by console
CUSTB-SITE1#
CUSTB-SITE1#show ip eigrp neighbor
EIGRP-IPv4 Neighbors for AS(100)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
0   172.16.1.1              Fa1/1                    12 00:00:16   25   150  0  3


R1-PE1#
*Nov 26 15:02:42.348: %DUAL-5-NBRCHANGE: EIGRP-IPv4 100: Neighbor 172.16.1.2 (FastEthernet1/1) is up: new adjacency
R1-PE1#
R1-PE1#show ip route vrf CUSTB

Routing Table: CUSTB
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C        172.16.1.0/30 is directly connected, FastEthernet1/1
L        172.16.1.1/32 is directly connected, FastEthernet1/1
D        172.16.1.100/32 [90/156160] via 172.16.1.2, 00:02:47, FastEthernet1/1


R8#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R8(config)#hostname CUSTA-SITE2
CUSTA-SITE2(config)#interface f1/0
CUSTA-SITE2(config-if)#ip address 192.168.1.2 255.255.255.252
CUSTA-SITE2(config-if)#no shutdown
CUSTA-SITE2(config-if)#
*Nov 26 00:48:21.616: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Nov 26 00:48:22.616: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
CUSTA-SITE2(config-if)#do ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 8/16/28 ms
CUSTA-SITE2(config-if)#interface loopback1
CUSTA-SITE2(config-if)#
*Nov 26 00:48:38.236: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
CUSTA-SITE2(config-if)#ip address 192.168.1.99 255.255.255.255
CUSTA-SITE2(config-if)#exit
CUSTA-SITE2(config)#router rip
CUSTA-SITE2(config-router)#version 2
CUSTA-SITE2(config-router)#network 192.168.1.0
CUSTA-SITE2(config-router)#end
CUSTA-SITE2#
*Nov 26 00:49:20.204: %SYS-5-CONFIG_I: Configured from console by console
CUSTA-SITE2#


R5-PE2#show ip route vrf CUSTA

Routing Table: CUSTA
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
C        192.168.1.0/30 is directly connected, FastEthernet1/0
L        192.168.1.1/32 is directly connected, FastEthernet1/0
R        192.168.1.99/32 [120/1] via 192.168.1.2, 00:00:03, FastEthernet1/0


R9#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R9(config)#hostname CUSTB-SITE2
CUSTB-SITE2(config)#interface f1/1
CUSTB-SITE2(config-if)#ip address 192.168.1.2 255.255.255.252
CUSTB-SITE2(config-if)#no shutdown
CUSTB-SITE2(config-if)#
*Nov 26 00:53:58.712: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
CUSTB-SITE2(config-if)#
*Nov 26 00:53:59.712: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
CUSTB-SITE2(config-if)#do ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/15/24 ms
CUSTB-SITE2(config-if)#
CUSTB-SITE2(config-if)#interface loopback1
*Nov 26 00:54:13.668: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
CUSTB-SITE2(config-if)#ip address 192.168.1.100 255.255.255.255
CUSTB-SITE2(config-if)#exit
CUSTB-SITE2(config)#router bgp 65001
CUSTB-SITE2(config-router)#neighbor 192.168.1.1 remote-as 65000
CUSTB-SITE2(config-router)#
*Nov 26 00:54:51.588: %BGP-5-ADJCHANGE: neighbor 192.168.1.1 Up
CUSTB-SITE2(config-router)#redistribute connected
CUSTB-SITE2(config-router)#end
CUSTB-SITE2#


R5-PE2#
*Nov 26 15:14:51.480: %BGP-5-ADJCHANGE: neighbor 192.168.1.2 vpn vrf CUSTB Up
R5-PE2#
R5-PE2#show ip route vrf CUSTB

Routing Table: CUSTB
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
C        192.168.1.0/30 is directly connected, FastEthernet1/1
L        192.168.1.1/32 is directly connected, FastEthernet1/1
B        192.168.1.100/32 [20/0] via 192.168.1.2, 00:01:22


4. Configure Mutual Route Redistribution between PE Routers Dynamic Routing Protocol (OSPF, EIGRP, RIPv2) and BGP (vpnv4).

R1-PE1#show run | sec router bgp
router bgp 65000
 bgp log-neighbor-changes
 neighbor 10.5.5.5 remote-as 65000
 neighbor 10.5.5.5 update-source Loopback0
 !
 address-family vpnv4
  neighbor 10.5.5.5 activate
  neighbor 10.5.5.5 send-community extended
 exit-address-family


R1-PE1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1-PE1(config)#router bgp 65000
R1-PE1(config-router)#address-family ipv4 vrf CUSTA
R1-PE1(config-router-af)#?
Router Address Family configuration commands:
  aggregate-address    Configure BGP aggregate entries
  bgp                  BGP specific commands
  default              Set a command to its defaults
  default-information  Control distribution of default information
  default-metric       Set metric of redistributed routes
  distance             Define an administrative distance
  distribute-list      Filter networks in routing updates
  exit-address-family  Exit from Address Family configuration mode
  help                 Description of the interactive help system
  import               Configure path import
  maximum-paths        Forward packets over multiple paths
  neighbor             Specify a neighbor router
  network              Specify a network to announce via BGP
  no                   Negate a command or set its defaults
  redistribute         Redistribute information from another routing protocol
  snmp                 Modify snmp parameters
  synchronization      Perform IGP synchronization
  table-map            Map external entry attributes into routing table

R1-PE1(config-router-af)#redistribute ?
  bgp        Border Gateway Protocol (BGP)
  connected  Connected
  eigrp      Enhanced Interior Gateway Routing Protocol (EIGRP)
  isis       ISO IS-IS
  lisp       Locator ID Separation Protocol (LISP)
  mobile     Mobile routes
  odr        On Demand stub Routes
  ospf       Open Shortest Path First (OSPF)
  ospfv3     OSPFv3
  rip        Routing Information Protocol (RIP)
  static     Static routes

R1-PE1(config-router-af)#redistribute ospf ? 
  <1-65535>  Process ID

R1-PE1(config-router-af)#redistribute ospf 2 ?
  match      Redistribution of OSPF routes
  metric     Metric for redistributed routes
  route-map  Route map reference
  vrf        VPN Routing/Forwarding Instance
  <cr>

R1-PE1(config-router-af)#redistribute ospf 2 vrf ?
  WORD  VPN Routing/Forwarding Instance (VRF) name

R1-PE1(config-router-af)#redistribute ospf 2 vrf CUSTA      // EXPORT ROUTES FROM OSPF/VRF INTO BGP
R1-PE1(config-router-af)#end
R1-PE1#

R1-PE1#show ip bgp ?
  A.B.C.D            Network in the BGP routing table to display
  A.B.C.D/nn         IP prefix <network>/<length>, e.g., 35.0.0.0/8
  all                All address families
  cidr-only          Display only routes with non-natural netmasks
  community          Display routes matching the communities
  community-list     Display routes matching the community-list
  dampening          Display detailed information about dampening
  extcommunity-list  Display routes matching the extcommunity-list
  filter-list        Display routes conforming to the filter-list
  import             Display route topology import / export activity
  inconsistency      Display all inconsistent paths
  inconsistent-as    Display only routes with inconsistent origin ASs
  injected-paths     Display all injected paths
  ipv4               Address family
  ipv6               Address family
  l2vpn              Address family
  labels             Display Labels for IPv4 NLRI specific information
  neighbors          Detailed information on TCP and BGP neighbor connections
  nexthops           Nexthop address table
  nsap               Address family
  oer-paths          Display all oer controlled paths
  paths              Path information
  peer-group         Display information on peer-groups
  pending-prefixes   Display prefixes pending deletion
  prefix-list        Display routes matching the prefix-list
  quote-regexp       Display routes matching the AS path "regular expression"
  regexp             Display routes matching the AS path regular expression
  replication        Display replication status of update-group(s)
  rib-failure        Display bgp routes that failed to install in the routing
                     table (RIB)
  route-map          Display routes matching the route-map
  route-server       Route server information
  rpki               Display RPKI Neighbor Cache
  rtfilter           Address family
  summary            Summary of BGP neighbor status
  template           Display peer-policy/peer-session templates
  topology           Routing topology instance
  update-group       Display information on update-groups
  update-sources     Update source interface table
  va                 Display virtual aggregation prefixes
  version            Display prefixes with matching version numbers
  vpnv4              Address family
  vpnv6              Address family
  |                  Output modifiers
  <cr>
         
R1-PE1#show ip bgp vpnv4 ?
  all  Display information about all VPN NLRIs
  rd   Display information for a route distinguisher
  vrf  Display information for a VPN Routing/Forwarding instance

R1-PE1#show ip bgp vpnv4 rd ?
  ASN:nn or IP-address:nn  VPN Route Distinguisher

R1-PE1#show ip bgp vpnv4 rd 65000:1 ?
  A.B.C.D            Network in the BGP routing table to display
  A.B.C.D/nn         IP prefix <network>/<length>, e.g., 35.0.0.0/8
  cidr-only          Display only routes with non-natural netmasks
  community          Display routes matching the communities
  community-list     Display routes matching the community-list
  dampening          Display detailed information about dampening
  extcommunity-list  Display routes matching the extcommunity-list
  filter-list        Display routes conforming to the filter-list
  inconsistency      Display all inconsistent paths
  inconsistent-as    Display only routes with inconsistent origin ASs
  labels             Display BGP labels for prefixes
  neighbors          Detailed information on TCP and BGP neighbor connections
  nexthops           Nexthop address table
  oer-paths          Display all oer controlled paths
  paths              Path information
  peer-group         Display information on peer-groups
  pending-prefixes   Display prefixes pending deletion
  prefix-list        Display routes matching the prefix-list
  quote-regexp       Display routes matching the AS path "regular expression"
  regexp             Display routes matching the AS path regular expression
  replication        Display replication status of update-group(s)
  rib-failure        Display bgp routes that failed to install in the routing
                     table (RIB)
  route-map          Display routes matching the route-map
  summary            Summary of BGP neighbor status
  update-group       Display information on update-groups
  version            Display prefixes with matching version numbers
  |                  Output modifiers
  <cr>

R1-PE1#show ip bgp vpnv4 rd 65000:1 labels       // LEGACY SHOW COMMAND
   Network          Next Hop      In label/Out label
Route Distinguisher: 65000:1 (CUSTA)
   172.16.1.0/30    0.0.0.0         107/nolabel(CUSTA)
   172.16.1.99/32   172.16.1.2      108/nolabel


R1-PE1#show bgp ?   
  *         All scopes
  all       All address families
  ipv4      Address family
  ipv6      Address family
  l2vpn     Address family
  nsap      Address family
  rtfilter  Address family
  vpnv4     Address family
  vpnv6     Address family
  vrf       VRF scope

R1-PE1#show bgp vpnv4 ?
  multicast  Address Family Modifier
  unicast    Address Family Modifier

R1-PE1#show bgp vpnv4 unicast ?
  all  Display information about all VPN NLRIs
  rd   Display information for a route distinguisher
  vrf  Display information for a VPN Routing/Forwarding instance

R1-PE1#show bgp vpnv4 unicast rd ?
  ASN:nn or IP-address:nn  VPN Route Distinguisher
         
R1-PE1#show bgp vpnv4 unicast rd 65000:1 ?
  A.B.C.D            Network in the BGP routing table to display
  A.B.C.D/nn         IP prefix <network>/<length>, e.g., 35.0.0.0/8
  cidr-only          Display only routes with non-natural netmasks
  community          Display routes matching the communities
  community-list     Display routes matching the community-list
  dampening          Display detailed information about dampening
  extcommunity-list  Display routes matching the extcommunity-list
  filter-list        Display routes conforming to the filter-list
  inconsistency      Display all inconsistent paths
  inconsistent-as    Display only routes with inconsistent origin ASs
  labels             Display BGP labels for prefixes
  neighbors          Detailed information on TCP and BGP neighbor connections
  nexthops           Nexthop address table
  oer-paths          Display all oer controlled paths
  paths              Path information
  peer-group         Display information on peer-groups
  pending-prefixes   Display prefixes pending deletion
  prefix-list        Display routes matching the prefix-list
  quote-regexp       Display routes matching the AS path "regular expression"
  regexp             Display routes matching the AS path regular expression
  replication        Display replication status of update-group(s)
  rib-failure        Display bgp routes that failed to install in the routing
                     table (RIB)
  route-map          Display routes matching the route-map
  summary            Summary of BGP neighbor status
  update-group       Display information on update-groups
  version            Display prefixes with matching version numbers
  |                  Output modifiers
  <cr>

R1-PE1#show bgp vpnv4 unicast rd 65000:1 labels      // "NEWER" SHOW COMMAND
   Network          Next Hop      In label/Out label
Route Distinguisher: 65000:1 (CUSTA)
   172.16.1.0/30    0.0.0.0         107/nolabel(CUSTA)
   172.16.1.99/32   172.16.1.2      108/nolabel

R1-PE1#show bgp vpnv4 unicast vrf CUSTA labels
   Network          Next Hop      In label/Out label
Route Distinguisher: 65000:1 (CUSTA)
   172.16.1.0/30    0.0.0.0         107/nolabel(CUSTA)
   172.16.1.99/32   172.16.1.2      108/nolabel

R1-PE1#show mpls forwarding-table ?
  A.B.C.D             Destination prefix
  X:X:X:X::X/<0-128>  Destination IPv6 prefix
  detail              Detailed information
  interface           Match outgoing interface
  labels              Match label values
  next-hop            Match next hop neighbor
  slot                Specify the slot
  vrf                 Show entries for a VPN Routing/Forwarding instance
  |                   Output modifiers
  <cr>

R1-PE1#show mpls forwarding-table vrf CUSTA
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
107        No Label   172.16.1.0/30[V] 0             aggregate/CUSTA         // VPNv4 ROUTE
108        No Label   172.16.1.99/32[V]   \
                                       0             Fa1/0      172.16.1.2

R1-PE1#show ip cef vrf CUSTA 172.16.1.2/32
172.16.1.2/32
  attached to FastEthernet1/0

R1-PE1#show bgp vpnv4 unicast vrf CUSTA      
BGP table version is 7, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 65000:1 (default for vrf CUSTA)
 *>  172.16.1.0/30    0.0.0.0                  0         32768 ?        // NEXT-HOP OF 0.0.0.0 MEANS DIRECTLY CONNECTED ROUTE
 *>  172.16.1.99/32   172.16.1.2               2         32768 ?

R1-PE1#show bgp vpnv4 unicast vrf CUSTA 172.16.1.99/32
BGP routing table entry for 65000:1:172.16.1.99/32, version 7        // RD
Paths: (1 available, best #1, table CUSTA)
  Advertised to update-groups:
     2        
  Refresh Epoch 1
  Local
    172.16.1.2 from 0.0.0.0 (10.1.1.1)
      Origin incomplete, metric 2, localpref 100, weight 32768, valid, sourced, best
      Extended Community: RT:1:1 OSPF DOMAIN ID:0x0005:0x000000020200       // RT
        OSPF RT:0.0.0.0:2:0 OSPF ROUTER ID:172.16.1.1:0
      mpls labels in/out 108/nolabel

R1-PE1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1-PE1(config)#router ospf 2 vrf CUSTA
R1-PE1(config-router)#?
Router configuration commands:
  area                   OSPF area parameters
  auto-cost              Calculate OSPF interface cost according to bandwidth
  bfd                    BFD configuration commands
  capability             Enable specific OSPF feature
  compatible             OSPF compatibility list
  default                Set a command to its defaults
  default-information    Control distribution of default information
  default-metric         Set metric of redistributed routes
  discard-route          Enable or disable discard-route installation
  distance               Define an administrative distance
  distribute-list        Filter networks in routing updates
  domain-id              OSPF domain-id
  domain-tag             OSPF domain-tag
  event-log              OSPF Event Logging
  exit                   Exit from routing protocol configuration mode
  help                   Description of the interactive help system
  ignore                 Do not complain about specific event
  interface-id           Source of the interface ID
  ispf                   Enable incremental SPF computation
  limit                  Limit a specific OSPF feature
  local-rib-criteria     Enable or disable usage of local RIB as route criteria
  log-adjacency-changes  Log changes in adjacency state
  max-lsa                maximum number of LSAs OSPF process will receive
  max-metric             Set maximum metric
  maximum-paths          Forward packets over multiple paths
  mpls                   Configure MPLS routing protocol parameters
  neighbor               Specify a neighbor router
  network                Enable routing on an IP network
  no                     Negate a command or set its defaults
  nsf                    Non-stop forwarding
  passive-interface      Suppress routing updates on an interface
  prefix-suppression     OSPF prefix suppression
  priority               OSPF topology priority
  queue-depth            OSPF Hello/Router process queue depth
  redistribute           Redistribute information from another routing protocol
  router-id              router-id for this OSPF process
  shutdown               Shutdown the OSPF protocol under the current instance
  snmp                   Modify snmp parameters
  summary-address        Configure IP address summaries
  timers                 Adjust routing timers
  traffic-share          How to compute traffic share over alternate paths
  ttl-security           TTL security check

R1-PE1(config-router)#redistribute ?
  bgp             Border Gateway Protocol (BGP)
  connected       Connected
  eigrp           Enhanced Interior Gateway Routing Protocol (EIGRP)
  isis            ISO IS-IS
  lisp            Locator ID Separation Protocol (LISP)
  maximum-prefix  Maximum number of prefixes redistributed to protocol
  mobile          Mobile routes
  odr             On Demand stub Routes
  ospf            Open Shortest Path First (OSPF)
  ospfv3          OSPFv3
  rip             Routing Information Protocol (RIP)
  static          Static routes

R1-PE1(config-router)#redistribute bgp ?
  <1-4294967295>  Autonomous system number
  <1.0-XX.YY>     Autonomous system number

R1-PE1(config-router)#redistribute bgp 65000 ?
  metric       Metric for redistributed routes
  metric-type  OSPF/IS-IS exterior metric type for redistributed routes
  nssa-only    Limit redistributed routes to NSSA areas
  route-map    Route map reference
  subnets      Consider subnets for redistribution into OSPF
  tag          Set tag for routes redistributed into OSPF
  <cr>

R1-PE1(config-router)#redistribute bgp 65000 subnets     // IMPORT ROUTES FROM BGP INTO OSPF/VRF
R1-PE1(config-router)#end
R1-PE1#

R1-PE1#show run | sec router bgp
router bgp 65000
 bgp log-neighbor-changes
 neighbor 10.5.5.5 remote-as 65000
 neighbor 10.5.5.5 update-source Loopback0
 !
 address-family vpnv4
  neighbor 10.5.5.5 activate
  neighbor 10.5.5.5 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf CUSTA
  redistribute ospf 2
 exit-address-family


5. Configure Route Redistribution for CUSTB

R1-PE1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1-PE1(config)#router bgp 65000
R1-PE1(config-router)#address-family ipv4 vrf CUSTB
R1-PE1(config-router-af)#redistribute eigrp 100
R1-PE1(config-router-af)#end
R1-PE1#
*Nov 26 20:31:50.831: %SYS-5-CONFIG_I: Configured from console by console
R1-PE1#
R1-PE1#show run | sec router bgp
router bgp 65000
 bgp log-neighbor-changes
 neighbor 10.5.5.5 remote-as 65000
 neighbor 10.5.5.5 update-source Loopback0
 !
 address-family vpnv4
  neighbor 10.5.5.5 activate
  neighbor 10.5.5.5 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf CUSTA
  redistribute ospf 2
 exit-address-family
 !
 address-family ipv4 vrf CUSTB
  redistribute eigrp 100
 exit-address-family
R1-PE1#
R1-PE1#show bgp vpnv4 unicast vrf CUSTB
BGP table version is 9, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 65000:2 (default for vrf CUSTB)
 *>  172.16.1.0/30    0.0.0.0                  0         32768 ?
 *>  172.16.1.100/32  172.16.1.2          156160         32768 ?
 *>i 192.168.1.0/30   10.5.5.5                 0    100      0 65001 ?      // CUSTB-SITE2 ROUTES APPEARED SINCE EBGP WAS ALREADY CONFIGURED
 *>i 192.168.1.100/32 10.5.5.5                 0    100      0 65001 ?


R1-PE1#show bgp vpnv4 unicast vrf CUSTB labels
   Network          Next Hop      In label/Out label
Route Distinguisher: 65000:2 (CUSTB)
   172.16.1.0/30    0.0.0.0         109/nolabel(CUSTB)
   172.16.1.100/32  172.16.1.2      110/nolabel
   192.168.1.0/30   10.5.5.5        nolabel/507
   192.168.1.100/32 10.5.5.5        nolabel/508


R1-PE1#show mpls forwarding-table vrf CUSTB
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
109        No Label   172.16.1.0/30[V] 0             aggregate/CUSTB
110        No Label   172.16.1.100/32[V]   \
                                       0             Fa1/1      172.16.1.2

R1-PE1#show ip cef vrf CUSTB 172.16.1.100
172.16.1.100/32
  nexthop 172.16.1.2 FastEthernet1/1


CUSTB-SITE1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C        172.16.1.0/30 is directly connected, FastEthernet1/1
L        172.16.1.2/32 is directly connected, FastEthernet1/1
C        172.16.1.100/32 is directly connected, Loopback1

R1-PE1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1-PE1(config)#router eigrp 100
R1-PE1(config-router)#address-family ipv4 vrf CUSTB autonomous-system 100
R1-PE1(config-router-af)#redistribute ?
  bgp             Border Gateway Protocol (BGP)
  connected       Connected
  eigrp           Enhanced Interior Gateway Routing Protocol (EIGRP)
  isis            ISO IS-IS
  maximum-prefix  Maximum number of prefixes redistributed to protocol
  mobile          Mobile routes
  odr             On Demand stub Routes
  ospf            Open Shortest Path First (OSPF)
  ospfv3          OSPFv3
  rip             Routing Information Protocol (RIP)
  static          Static routes

R1-PE1(config-router-af)#redistribute bgp ?
  <1-4294967295>  Autonomous system number
  <1.0-XX.YY>     Autonomous system number

R1-PE1(config-router-af)#redistribute bgp 65000 ?
  metric     Metric for redistributed routes
  route-map  Route map reference
  <cr>

R1-PE1(config-router-af)#redistribute bgp 65000 metric ?
  <1-4294967295>  Bandwidth metric in Kbits per second

R1-PE1(config-router-af)#redistribute bgp 65000 metric 1 ?
  <0-4294967295>  EIGRP delay metric, in 10 microsecond units

R1-PE1(config-router-af)#redistribute bgp 65000 metric 1 1 ?
  <0-255>  EIGRP reliability metric where 255 is 100% reliable

R1-PE1(config-router-af)#redistribute bgp 65000 metric 1 1 1 ?
  <1-255>  EIGRP Effective bandwidth metric (Loading) where 255 is 100% loaded

R1-PE1(config-router-af)#redistribute bgp 65000 metric 1 1 1 1 ?
  <1-65535>  EIGRP MTU of the path

R1-PE1(config-router-af)#redistribute bgp 65000 metric 1 1 1 1 1       // IMPORT ROUTE
R1-PE1(config-router-af)#end
R1-PE1#


CUSTB-SITE1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C        172.16.1.0/30 is directly connected, FastEthernet1/1
L        172.16.1.2/32 is directly connected, FastEthernet1/1
C        172.16.1.100/32 is directly connected, Loopback1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
D EX     192.168.1.0/30
           [170/2560002816] via 172.16.1.1, 00:00:06, FastEthernet1/1
D EX     192.168.1.100/32
           [170/2560002816] via 172.16.1.1, 00:00:06, FastEthernet1/1


CUSTB-SITE1#traceroute 192.168.1.100
Type escape sequence to abort.
Tracing the route to 192.168.1.100
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.1.1 24 msec 16 msec 8 msec
  2 10.12.0.2 [MPLS: Labels 205/508 Exp 0] 76 msec 40 msec 60 msec
  3 10.23.0.3 [MPLS: Labels 309/508 Exp 0] 76 msec 84 msec 72 msec
  4 10.34.0.4 [MPLS: Labels 405/508 Exp 0] 76 msec 72 msec 68 msec
  5 192.168.1.1 [MPLS: Label 508 Exp 0] 84 msec 52 msec 60 msec
  6 192.168.1.2 92 msec 72 msec 44 msec


R5-PE2#show run | sec router bgp
router bgp 65000
 bgp log-neighbor-changes
 neighbor 10.1.1.1 remote-as 65000
 neighbor 10.1.1.1 update-source Loopback0
 !
 address-family vpnv4
  neighbor 10.1.1.1 activate
  neighbor 10.1.1.1 send-community extended
  neighbor 10.1.1.1 next-hop-self
 exit-address-family
 !
 address-family ipv4 vrf CUSTB
  neighbor 192.168.1.2 remote-as 65001
  neighbor 192.168.1.2 activate
 exit-address-family
R5-PE2#
R5-PE2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R5-PE2(config)#router bgp 65000
R5-PE2(config-router)#address-family ipv4 vrf CUSTA
R5-PE2(config-router-af)#?
Router Address Family configuration commands:
  aggregate-address    Configure BGP aggregate entries
  bgp                  BGP specific commands
  default              Set a command to its defaults
  default-information  Control distribution of default information
  default-metric       Set metric of redistributed routes
  distance             Define an administrative distance
  distribute-list      Filter networks in routing updates
  exit-address-family  Exit from Address Family configuration mode
  help                 Description of the interactive help system
  import               Configure path import
  maximum-paths        Forward packets over multiple paths
  neighbor             Specify a neighbor router
  network              Specify a network to announce via BGP
  no                   Negate a command or set its defaults
  redistribute         Redistribute information from another routing protocol
  snmp                 Modify snmp parameters
  synchronization      Perform IGP synchronization
  table-map            Map external entry attributes into routing table

R5-PE2(config-router-af)#redistribute ?
  bgp        Border Gateway Protocol (BGP)
  connected  Connected
  eigrp      Enhanced Interior Gateway Routing Protocol (EIGRP)
  isis       ISO IS-IS
  lisp       Locator ID Separation Protocol (LISP)
  mobile     Mobile routes
  odr        On Demand stub Routes
  ospf       Open Shortest Path First (OSPF)
  ospfv3     OSPFv3
  rip        Routing Information Protocol (RIP)
  static     Static routes

R5-PE2(config-router-af)#redistribute rip ?
  metric     Metric for redistributed routes
  route-map  Route map reference
  <cr>

R5-PE2(config-router-af)#redistribute rip       // EXPORT ROUTES
R5-PE2(config-router-af)#end
R5-PE2#

R5-PE2#show bgp vpnv4 unicast vrf CUSTA labels
   Network          Next Hop      In label/Out label
Route Distinguisher: 65000:1 (CUSTA)
   172.16.1.0/30    10.1.1.1        nolabel/107
   172.16.1.99/32   10.1.1.1        nolabel/108
   192.168.1.0/30   0.0.0.0         509/nolabel(CUSTA)
   192.168.1.99/32  192.168.1.2     510/nolabel


CUSTA-SITE1#show ip route   
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C        172.16.1.0/30 is directly connected, FastEthernet1/0
L        172.16.1.2/32 is directly connected, FastEthernet1/0
C        172.16.1.99/32 is directly connected, Loopback1


R5-PE2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R5-PE2(config)#router rip
R5-PE2(config-router)#address-family ipv4 vrf CUSTA
R5-PE2(config-router-af)#redistribute bgp 65000 ?
  metric     Metric for redistributed routes
  route-map  Route map reference
  <cr>

R5-PE2(config-router-af)#redistribute bgp 65000 metric ?
  <0-16>       Default metric
  transparent  Transparently redistribute metric

R5-PE2(config-router-af)#redistribute bgp 65000 metric 5     // IMPORT ROUTES
R5-PE2(config-router-af)#end
R5-PE2#


CUSTA-SITE2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
FastEthernet1/0            192.168.1.2     YES manual up                    up     
FastEthernet1/1            unassigned      YES unset  administratively down down   
Loopback1                  192.168.1.99    YES manual up                    up    

CUSTA-SITE2#show ip route    
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
R        172.16.1.0/30 [120/5] via 192.168.1.1, 00:00:15, FastEthernet1/0
R        172.16.1.99/32 [120/5] via 192.168.1.1, 00:00:15, FastEthernet1/0
      192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
C        192.168.1.0/30 is directly connected, FastEthernet1/0
L        192.168.1.2/32 is directly connected, FastEthernet1/0
C        192.168.1.99/32 is directly connected, Loopback1


CUSTA-SITE1#show ip route    
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C        172.16.1.0/30 is directly connected, FastEthernet1/0
L        172.16.1.2/32 is directly connected, FastEthernet1/0
C        172.16.1.99/32 is directly connected, Loopback1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
O E2     192.168.1.0/30 [110/1] via 172.16.1.1, 00:06:35, FastEthernet1/0
O E2     192.168.1.99/32 [110/1] via 172.16.1.1, 00:06:35, FastEthernet1/0

CUSTA-SITE1#ping 192.168.1.99
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.99, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/97/112 ms

CUSTA-SITE1#traceroute 192.168.1.99
Type escape sequence to abort.
Tracing the route to 192.168.1.99
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.1.1 8 msec 12 msec 12 msec
  2 10.12.0.2 [MPLS: Labels 205/510 Exp 0] 72 msec 96 msec 84 msec
  3 10.23.0.3 [MPLS: Labels 309/510 Exp 0] 44 msec 92 msec 76 msec
  4 10.34.0.4 [MPLS: Labels 405/510 Exp 0] 72 msec 52 msec 100 msec
  5 192.168.1.1 [MPLS: Label 510 Exp 0] 80 msec 56 msec 96 msec
  6 192.168.1.2 112 msec 88 msec 92 msec