Friday, January 18, 2019

Configuring Basic MPLS

Cisco started putting labels on top of IP packets since IOS release 11.1(17)CT in 1998 and it was then called tag switching. A tag was the name for what is now known as a label. The MPLS labels are advertised between routers so that they can build a label-to-label mappings.

These labels are attached to the IP packets, enabling the routers to forward the traffic by looking
at the label and not the destination IP address. The packets are forwarded by label switching instead of by IP switching. One MPLS label is a field of 32 bits with a certain structure:


MPLS-capable routers might need more than one label on top of the packet to route that packet through the MPLS network. This is done by packing the labels into a stack. The first label in the
stack is called the top label, and the last label is called the bottom label. In between, you can have
any number of labels. You can view MPLS as OSI Layer 2.5


I've been configuring and troubleshooting MPLS networks back in my old ISP days and I still use those skills in my current enterprise network. I needed to review basic MPLS for an IT project, so I used the Cisco Press book MPLS Fundamentals by Luc de Ghein and the MPLS Fundamentals training videos by Keith Barker. I also setup a lab using the network topology below:


Step 1: Configure basic IP addressing and OSPF routing protocol on the MPLS network (R1 to R5). 

You can directly configure the OSPF process and area ID under the interface in OSPFv2 versus configuring networks that will participate in OSPF (version 1) process under the network command. There's also OSPFv3 that supports IPv4 and IPv6 Address Family (AF).

R1#
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#hostname R1-PE1
R1-PE1(config)#
R1-PE1(config)#ip cef       // NEED CEF FOR MPLS (ENABLED BY DEFAULT)
R1-PE1(config)#
R1-PE1(config)#no ip domain lookup
R1-PE1(config)#
R1-PE1(config)#interface loopback0
R1(config-if)#
*Nov 11 11:36:09.879: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1-PE1(config-if)#ip address 10.1.1.1 255.255.255.255
R1-PE1(config-if)#ip ospf 1 area 0      // CONFIGURE OSPF ON THE INTERFACE IN OSPFv2
R1-PE1(config-if)#
R1-PE1(config-if)#interface f0/0
R1-PE1(config-if)#ip address 10.12.0.1 255.255.255.0
R1-PE1(config-if)#no shutdown
R1-PE1(config-if)#
*Nov 11 11:37:12.787: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Nov 11 11:37:13.787: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1-PE1(config-if)#end
R1-PE1#
*Nov 11 11:39:52.267: %OSPF-5-ADJCHG: Process 1, Nbr 10.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done


R2#
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#hostname R2-P1
R2-P1(config)#
R2-P1(config)#ip cef
R2(config)#
R2-P1(config)#no ip domain lookup
R2-P1(config)#
R2-P1(config)#interface loopback0
R2-P1(config-if)#
*Nov 11 11:38:48.251: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R2-P1(config-if)#ip address 10.2.2.2 255.255.255.255
R2-P1(config-if)#ip ospf 1 area 0                  
R2-P1(config-if)#
R2-P1(config-if)#interface f0/0
R2-P1(config-if)#ip address 10.12.0.2 255.255.255.0
R2-P1(config-if)#no shut
R2-P1(config-if)#
*Nov 11 11:39:38.087: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Nov 11 11:39:39.087: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2-P1(config-if)#do ping 10.12.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.12.0.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 16/27/56 ms
R2-P1(config-if)#
R2-P1(config-if)#ip ospf 1 area 0
R2-P1(config-if)#
*Nov 11 11:39:52.199: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.1.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
R2-P1(config)#interface f1/1
R2-P1(config-if)#ip address 10.23.0.2 255.255.255.0
R2-P1(config-if)#ip ospf 1 area 0
R2-P1(config-if)#no shutdown
R2-P1(config-if)#
*Nov 11 11:44:23.403: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Nov 11 11:44:24.403: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
R2-P1(config-if)#end
R2-P1#
*Nov 11 11:46:09.959: %OSPF-5-ADJCHG: Process 1, Nbr 10.3.3.3 on FastEthernet1/1 from LOADING to FULL, Loading Done


R3#
R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#hostname R3-P2
R3-P2(config)#
R3-P2(config)#ip cef
R3-P2(config)#
R3-P2(config)#no ip domain lookup
R3-P2(config)#
R3-P2(config)#interface loopback0
R3-P2(config-if)#
*Nov 11 11:45:14.831: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R3-P2(config-if)#ip address 10.3.3.3 255.255.255.255
R3-P2(config-if)#ip ospf 1 area 0 
R3-P2(config-if)#
R3-P2(config-if)#interface f1/1
R3-P2(config-if)#ip address 10.23.0.3 255.255.255.0
R3-P2(config-if)#ip ospf 1 area 0
R3-P2(config-if)#no shutdown
R3-P2(config-if)#
*Nov 11 11:45:52.807: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Nov 11 11:45:53.807: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
R3-P2(config-if)#
*Nov 11 11:46:00.035: %OSPF-5-ADJCHG: Process 1, Nbr 10.2.2.2 on FastEthernet1/1 from LOADING to FULL, Loading Done
R3-P2(config-if)#
R3-P2(config-if)#do ping 10.23.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.23.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/22/28 ms
R3-P2(config-if)#
R3-P2(config-if)#interface f1/0
R3-P2(config-if)#ip address 10.34.0.3 255.255.255.0
R3-P2(config-if)#ip ospf 1 area 0
R3-P2(config-if)#no shutdown
R3-P2(config-if)#
*Nov 11 11:47:05.563: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Nov 11 11:47:06.563: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R3-P2(config-if)#end
R3-P2#
*Nov 11 11:48:59.663: %OSPF-5-ADJCHG: Process 1, Nbr 10.4.4.4 on FastEthernet1/0 from LOADING to FULL, Loading Done


R4#
R4#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#hostname R4-P3
R4-P3(config)#
R4-P3(config)#ip cef
R4-P3(config)#
R4-P3(config)#no ip domain lookup
R4-P3(config)#
R4-P3(config)#interface loopback0
R4-P3(config-if)#
*Nov 11 11:47:57.395: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R4-P3(config-if)#ip address 10.4.4.4 255.255.255.255
R4-P3(config-if)#ip ospf 1 area 0
R4-P3(config-if)#
R4-P3(config-if)#interface f1/0
R4-P3(config-if)#ip address 10.34.0.4 255.255.255.0
R4-P3(config-if)#ip ospf 1 area 0
R4-P3(config-if)#no shutdown
R4-P3(config-if)#
*Nov 11 11:48:40.419: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Nov 11 11:48:41.419: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R4-P3(config-if)#
*Nov 11 11:48:49.663: %OSPF-5-ADJCHG: Process 1, Nbr 10.3.3.3 on FastEthernet1/0 from LOADING to FULL, Loading Done
R4-P3(config-if)#do ping 10.34.0.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.34.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/24/36 ms
R4-P3(config-if)#
R4-P3(config-if)#interface f0/0
R4-P3(config-if)#ip address 10.45.0.4 255.255.255.0
R4-P3(config-if)#ip ospf 1 area 0
R4-P3(config-if)#no shutdown
R4-P3(config-if)#
*Nov 11 11:49:34.171: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Nov 11 11:49:35.171: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R4-P3(config-if)#end
R4-P3#
*Nov 11 11:51:10.691: %OSPF-5-ADJCHG: Process 1, Nbr 10.5.5.5 on FastEthernet0/0 from LOADING to FULL, Loading Done


R5#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R5-PE3(config)#hostname R5-PE2
R5-PE2(config)#
R5-PE2(config)#ip cef
R5-PE2(config)#
R5-PE2(config)#no ip domain lookup
R5-PE2(config)#
R5-PE2(config)#interface loopback0
R5-PE2(config-if)#
*Nov 11 11:30:08.643: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R5-PE2(config-if)#ip address 10.5.5.5 255.255.255.255
R5-PE2(config-if)#ip ospf 1 area 0
R5-PE2(config-if)#
R5-PE2(config-if)#interface f0/0
R5-PE2(config-if)#ip address 10.45.0.5 255.255.255.0
R5-PE2(config-if)#ip ospf 1 area 0
R5-PE2(config-if)#no shutdown
R5-PE2(config-if)#
*Nov 11 11:30:45.035: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Nov 11 11:30:46.035: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R5-PE2(config-if)#
*Nov 11 11:30:50.191: %OSPF-5-ADJCHG: Process 1, Nbr 10.4.4.4 on FastEthernet0/0 from LOADING to FULL, Loading Done
R5-PE2(config-if)#end
R5-PE2#


R1-PE1#ping 10.5.5.5 source 10.1.1.1 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/60/92 ms


Notice the traceroute initially didn't use any MPLS labels.
R1-PE1#traceroute 10.5.5.5 source 10.1.1.1
Type escape sequence to abort.
Tracing the route to 10.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
  1 10.12.0.2 16 msec 16 msec 12 msec
  2 10.23.0.3 24 msec 56 msec 24 msec
  3 10.34.0.4 68 msec 60 msec 60 msec
  4 10.45.0.5 68 msec 60 msec 52 msec


Step 2: Configure MPLS on the core network.

There are just few MPLS commands to enable. I also manually configured the MPLS label range on each router so it's easy to troubleshoot and trace which router is using the labels.

R1-PE1#
R1-PE1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1-PE1(config)#mpls ?
  discovery    Configure LSP discovery
  export       Configure periodic export of MPLS PAL table
  ip           Dynamic MPLS forwarding for IP
  label        Label properties
  ldp          Label Distribution Protocol
  oam          OAM configuration
  static       MPLS static application
  traffic-eng  Configure Traffic Engineering parameters

R1-PE1(config)#mpls label ?
  mode      MPLS Label allocation mode
  protocol  Set platform default label distribution protocol
  range     Label range

R1-PE1(config)#mpls label range ?
  <16-1048575>  Minimum label value for dynamic label range

R1-PE1(config)#mpls label range 100 ?
  <100-1048575>  Maximum label value for dynamic label range

R1-PE1(config)#mpls label range 100 199       // MANUALLY CONFIGURE MPLS LABELS TO BE USED
R1-PE1(config)#
R1-PE1(config)#mpls  ip      // GLOBALLY ENABLE MPLS
R1-PE1(config)#
R1-PE1(config)#interface f0/0
R1-PE1(config-if)#mpls ?
  accounting   Enable MPLS accounting on this interface
  bgp          MPLS BGP commands
  ip           Configure dynamic MPLS forwarding for IP
  l2transport  Layer 2 packet over MPLS config commands
  label        Label properties
  ldp          Configure Label Distribution Protocol (LDP) parameters
  mtu          Set MPLS Maximum Transmission Unit
  netflow      Configure Egress Netflow Accounting
  traffic-eng  Configure Traffic Engineering parameters

R1-PE1(config-if)#mpls ip        // ENABLE MPLS (AND LDP) ON THE SPECIFIED INTERFACE
R1-PE1(config-if)#end
R1-PE1#
*Nov 11 12:01:36.759: %LDP-5-NBRCHG: LDP Neighbor 10.2.2.2:0 (1) is UP


R2-P1#
R2-P1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2-P1(config)#mpls label range 200 299
R2-P1(config)#mpls ip
R2-P1(config)#interface f0/0
R2-P1(config-if)#mpls ip
R2-P1(config-if)#
*Nov 11 12:01:36.631: %LDP-5-NBRCHG: LDP Neighbor 10.1.1.1:0 (1) is UP
R2-P1(config-if)#
R2-P1(config-if)#interface f1/1
R2-P1(config-if)#mpls ip 
*Nov 11 12:26:31.343: %LDP-5-NBRCHG: LDP Neighbor 10.3.3.3:0 (2) is UP    
R2-P1(config-if)#end
R2-P1#


R3-P2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3-P2(config)#mpls label range 300 399
R3-P2(config)#mpls ip
R3-P2(config)#interface f1/1
R3-P2(config-if)#mpls ip
*Nov 11 12:26:21.343: %LDP-5-NBRCHG: LDP Neighbor 10.2.2.2:0 (2) is UP
R3-P2(config-if)#interface f1/0
R3-P2(config-if)#mpls ip
R3-P2#
*Nov 11 12:26:20.047: %LDP-5-NBRCHG: LDP Neighbor 10.4.4.4:0 (1) is UP
R3-P2(config-if)#end
R3-P2#


R4-P3#
R4-P3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R4-P3(config)#mpls label range 400 499
R4-P3(config)#mpls ip
R4-P3(config)#
R4-P3(config)#interface f1/0
*Nov 11 12:26:09.991: %LDP-5-NBRCHG: LDP Neighbor 10.3.3.3:0 (2) is UP
R4-P3(config-if)#mpls ip
R4-P3(config-if)#interface f0/0
R4-P3(config-if)#mpls ip     
*Nov 11 12:12:35.227: %LDP-5-NBRCHG: LDP Neighbor 10.5.5.5:0 (1) is UP
R4-P3(config-if)#end
R4-P3#


R5-PE2#
R5-PE2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R5-PE2(config)#mpls label range 500 599
R5-PE2(config)#mpls ip
R5-PE2(config)#
R5-PE2(config)#interface f0/0
R5-PE2(config-if)#mpls ip
R5-PE2(config-if)#
*Nov 11 11:52:14.691: %LDP-5-NBRCHG: LDP Neighbor 10.4.4.4:0 (1) is UP
R5-PE2(config-if)#end
R5-PE2#
R5-PE2#
R5-PE2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R5-PE2(config)#mpls label range 500 599
R5-PE2(config)#mpls ip
R5-PE2(config)#
R5-PE2(config)#interface f0/0
R5-PE2(config-if)#mpls ip
R5-PE2(config-if)#
*Nov 11 11:52:14.691: %LDP-5-NBRCHG: LDP Neighbor 10.4.4.4:0 (1) is UP
R5-PE2(config-if)#end
R5-PE2#


R1-PE1#show mpls ?
  discovery         Information about LSP discovery
  flow              MPLS netflow information
  forwarding-table  Show the Label Forwarding Table
  interfaces        Per-interface MPLS forwarding information
  ip                MPLS IP information
  l2transport       MPLS circuit transport info
  label             Label information
  ldp               Label Distribution Protocol information
  memory            Memory usage information
  oam               OAM information
  static            Show MPLS static information
  traffic-eng       Traffic engineering information

R1-PE1#show mpls ldp ?
  backoff           LDP session setup backoff table
  bindings          Show the LDP Label Information Base (LIB)
  capabilities      Display LDP Capabilities information
  discovery         Display sources for locally generated LDP Discovery Hello
                    PDUs
  graceful-restart  Show Graceful Restart summary
  igp               IGP-related info
  neighbor          Display LDP neighbor information
  parameters        Display LDP configuration parameters

R1-PE1#show mpls ldp bindings
  lib entry: 10.1.1.1/32, rev 2
        local binding:  label: imp-null
        remote binding: lsr: 10.2.2.2:0, label: 200
  lib entry: 10.2.2.2/32, rev 4
        local binding:  label: 100
        remote binding: lsr: 10.2.2.2:0, label: imp-null
  lib entry: 10.4.4.4/32, rev 6
        local binding:  label: 101
        remote binding: lsr: 10.2.2.2:0, label: 201
  lib entry: 10.5.5.5/32, rev 8
        local binding:  label: 102
        remote binding: lsr: 10.2.2.2:0, label: 202
  lib entry: 10.12.0.0/24, rev 10
        local binding:  label: imp-null
        remote binding: lsr: 10.2.2.2:0, label: imp-null
  lib entry: 10.23.0.0/24, rev 12
        local binding:  label: 103
        remote binding: lsr: 10.2.2.2:0, label: imp-null
  lib entry: 10.34.0.0/24, rev 14
        local binding:  label: 104
        remote binding: lsr: 10.2.2.2:0, label: 203
  lib entry: 10.45.0.0/24, rev 16
        local binding:  label: 105
        remote binding: lsr: 10.2.2.2:0, label: 204
R1-PE1#
R1-PE1#show mpls ldp bindings ?
  A.B.C.D             Destination prefix
  advertisement-acls  Show advertisement access lists
  all                 Display LIB information in all VRFs
  detail              Show detailed information
  local               Display only locally assigned labels
  local-label         Match locally assigned label values
  neighbor            Display labels from LDP neighbor
  remote-label        Match remotely assigned label values
  vrf                 VRF Routing/Forwarding instance information
  |                   Output modifiers
  <cr>

R1-PE1#show mpls ldp bindings 10.5.5.5 ?
  <0-32>   Mask length
  A.B.C.D  Destination mask

R1-PE1#show mpls ldp bindings 10.5.5.5 32
  lib entry: 10.5.5.5/32, rev 8
        local binding:  label: 102
        remote binding: lsr: 10.2.2.2:0, label: 202


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 10.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
102        202        10.5.5.5/32      0             Fa0/0      10.12.0.2 


R2-P1#show mpls ldp bindings 10.5.5.5 32
  lib entry: 10.5.5.5/32, rev 8
        local binding:  label: 202
        remote binding: lsr: 10.1.1.1:0, label: 102
        remote binding: lsr: 10.3.3.3:0, label: 304

R2-P1#show mpls forwarding-table 10.5.5.5 
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
202        304        10.5.5.5/32      0             Fa1/1      10.23.0.3  


R3-P2#show mpls ldp bindings 10.5.5.5 32
  lib entry: 10.5.5.5/32, rev 14
        local binding:  label: 304
        remote binding: lsr: 10.4.4.4:0, label: 402
        remote binding: lsr: 10.2.2.2:0, label: 202

R3-P2#show mpls forwarding-table 10.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
304        402        10.5.5.5/32      0             Fa1/0      10.34.0.4


R4-P3#show mpls ldp bindings 10.5.5.5 32
  lib entry: 10.5.5.5/32, rev 8
        local binding:  label: 402
        remote binding: lsr: 10.5.5.5:0, label: imp-null      // DIRECTLY CONNECTED ROUTE ON R5 (PENULTIMATE HOP POPPING/POP)
        remote binding: lsr: 10.3.3.3:0, label: 304
R4-P3#
R4-P3#show mpls forwarding-table 10.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
402        Pop Label  10.5.5.5/32      0             Fa0/0      10.45.0.5 


R5-PE2#show mpls ldp bindings 10.5.5.5 32
  lib entry: 10.5.5.5/32, rev 8
        local binding:  label: imp-null
        remote binding: lsr: 10.4.4.4:0, label: 402

R5-PE2#show mpls forwarding-table 10.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
None       No Label   10.5.5.5/32      0  


Notice the traceroute displays an MPLS label.
R1-PE1#traceroute 10.5.5.5 source 10.1.1.1
Type escape sequence to abort.
Tracing the route to 10.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
  1 10.12.0.2 [MPLS: Label 202 Exp 0] 128 msec 56 msec 68 msec
  2 10.23.0.3 [MPLS: Label 304 Exp 0] 40 msec 60 msec 40 msec
  3 10.34.0.4 [MPLS: Label 402 Exp 0] 44 msec 8 msec 40 msec
  4 10.45.0.5 68 msec 104 msec 40 msec


These are the initial router configurations.


R1-PE1#show run
Building configuration...

Current configuration : 1285 bytes
!
! Last configuration change at 12:38:40 UTC Sun Nov 11 2018
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1-PE1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!        
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 100 199
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!        
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.1.1 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 10.12.0.1 255.255.255.0
 ip ospf 1 area 0
 duplex half
 mpls ip
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!        
!
mgcp profile default
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
 transport input all
!        
!
end



R2-P1#show run
Building configuration...

Current configuration : 1322 bytes
!
! Last configuration change at 12:26:18 UTC Sun Nov 11 2018
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2-P1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!        
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 200 299
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!        
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.2.2.2 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 10.12.0.2 255.255.255.0
 ip ospf 1 area 0
 duplex half
 mpls ip
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/1
 ip address 10.23.0.2 255.255.255.0
 ip ospf 1 area 0
 duplex auto
 speed auto
 mpls ip
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!        
!
!
mgcp profile default
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
 transport input all
!
!
end



R3-P2#show run
Building configuration...

Current configuration : 1304 bytes
!
! Last configuration change at 12:26:17 UTC Sun Nov 11 2018
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3-P2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!        
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 300 399
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!        
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.3.3.3 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet1/0
 ip address 10.34.0.3 255.255.255.0
 ip ospf 1 area 0
 duplex auto
 speed auto
 mpls ip
!        
interface FastEthernet1/1
 ip address 10.23.0.3 255.255.255.0
 ip ospf 1 area 0
 duplex auto
 speed auto
 mpls ip
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!        
!
mgcp profile default
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
 transport input all
!        
!
end



R4-P3#show run
Building configuration...

Current configuration : 1283 bytes
!
! Last configuration change at 12:45:54 UTC Sun Nov 11 2018
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4-P3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!        
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 400 499
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!        
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.4.4.4 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 10.45.0.4 255.255.255.0
 ip ospf 1 area 0
 duplex half
 mpls ip
!
interface FastEthernet1/0
 ip address 10.34.0.4 255.255.255.0
 ip ospf 1 area 0
 duplex auto
 speed auto
 mpls ip
!
interface FastEthernet1/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
router ospf 1
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!        
!
mgcp profile default
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
 transport input all
!        
!
end



R5-PE2#show run
Building configuration...

Current configuration : 1285 bytes
!
! Last configuration change at 12:06:50 UTC Sun Nov 11 2018
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5-PE2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!        
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 500 599
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!        
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.5.5.5 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 10.45.0.5 255.255.255.0
 ip ospf 1 area 0
 duplex half
 mpls ip
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
router ospf 1
 network 10.0.0.0 0.255.255.255 area 0
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!        
!
mgcp profile default
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
 transport input all
!        
!
end

Friday, January 11, 2019

Configuring Path Control via IP SLA Tracking

The following list summarizes available IP SLA operation types:
* ICMP (echo, jitter)
* RTP (VoIP)
* TCP connection 

* UDP (echo, jitter)
* DNS
* DHCP
* HTTP
* FTP


The general steps to configure an ICMP-based IP SLA operation are as follows:

Step 1: Create the IP SLA operation and assign it an integer operation number, using the ip sla <sla ops-number> global configuration command.

Step 2: Define the operation type and the parameters for that operation type. For ICMP echo, you define the destination IP address or host name, and optionally, the source IP address or host name, using the icmp-echo { destination-ipaddress | destination-hostname } [ source-ip { ip-address | hostname } | source-interface <interface-name> ] SLA operation subcommand.

Step 3: (Optional) Define a (non-default) frequency at which the operation should send the packets, in seconds, using the frequency <seconds> IP SLA sub-command.

Step 4: Schedule when the SLA will run, using the ip sla schedule <sla-ops-number> [ life { forever | seconds }] [ start-time { hh : mm [ : ss ] [ month day | day month ] |pending | now | after hh : mm : ss }] [ ageout seconds ] [ recurring ] global command.


R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface loop 0
R1(config-if)#
*Jul 10 10:13:34.615: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#
R1(config-if)#interface serial 2/0
R1(config-if)#description ### ISP 1 ###
R1(config-if)#ip address 209.165.201.2 255.255.255.252
R1(config-if)#bandwidth 128
R1(config-if)#no shut
*Jul 10 10:14:52.911: %LINK-3-UPDOWN: Interface Serial2/0, changed state to up
R1(config-if)#
*Jul 10 10:14:53.919: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R1(config-if)#
R1(config-if)#interface serial 2/3
R1(config-if)#description ### ISP 2 ###
R1(config-if)#ip address 209.165.202.130 255.255.255.252
R1(config-if)#bandwidth 128      
R1(config-if)#no shut
*Jul 10 10:15:09.603: %LINK-3-UPDOWN: Interface Serial2/3, changed state to up
R1(config-if)#
*Jul 10 10:15:10.611: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/3, changed state to up
R1(config-if)#end
R1#


R2#conf t
R2(config)#hostname ISP1
Enter configuration commands, one per line.  End with CNTL/Z.
ISP1(config)#interface loop 0
ISP1(config-if)#
*Jul 10 10:17:01.027: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
ISP1(config-if)#description ### INTERNET WEB SERVER ###
ISP1(config-if)#ip address 209.165.200.254 255.255.255.255
ISP1(config-if)#
ISP1(config-if)#interface loop 1
ISP1(config-if)#
*Jul 10 10:17:36.167: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
ISP1(config-if)#description ### ISP1 DNS SERVER ###
ISP1(config-if)#ip address 209.165.201.30 255.255.255.255
ISP1(config-if)#
ISP1(config-if)#interface serial 2/0
ISP1(config-if)#description ### R1 ####
ISP1(config-if)#ip address 209.165.201.1 255.255.255.252
ISP1(config-if)#bandwidth 128
ISP1(config-if)#no shut
ISP1(config-if)#
*Jul 10 10:18:42.263: %LINK-3-UPDOWN: Interface Serial2/0, changed state to up
ISP1(config-if)#
*Jul 10 10:18:43.271: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
ISP1(config-if)#
ISP1(config-if)#do ping 209.165.201.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.165.201.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/24 ms
ISP1(config-if)#
ISP1(config-if)#interface serial 2/1
ISP1(config-if)#description ### ISP 2 ###
ISP1(config-if)#ip address 209.165.200.225 255.255.255.252
ISP1(config-if)#bandwidth 128
ISP1(config-if)#no shut
ISP1(config-if)#
*Jul 10 10:19:48.787: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up
ISP1(config-if)#
*Jul 10 10:19:49.795: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up
ISP1(config-if)#end
ISP1#


R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config-if)#hostname ISP2
ISP2(config)#interface loop 0
ISP2(config-if)#
*Jul 10 10:18:11.047: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
ISP2(config-if)#description ### INTERNET WEB SERVER ###
ISP2(config-if)#ip address 209.165.200.254 255.255.255.255
ISP2(config-if)#
ISP2(config)#interface loop 1
ISP2(config-if)#
*Jul 10 10:20:00.983: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
ISP2(config-if)#description ### ISP2 DNS SERVER ###
ISP2(config-if)#ip address 209.165.202.158 255.255.255.255
ISP2(config-if)#
ISP2(config)#interface serial 2/3
ISP2(config-if)#description ### R1 ###
ISP2(config-if)#ip address 209.165.202.129 255.255.255.252
ISP2(config-if)#no shut
ISP2(config-if)#
*Jul 10 10:21:18.899: %LINK-3-UPDOWN: Interface Serial2/3, changed state to up
ISP2(config-if)#
*Jul 10 10:21:19.907: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/3, changed state to up
ISP2(config-if)#do ping 209.165.202.130
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.165.202.130, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/21/28 ms
ISP2(config-if)#
ISP2(config-if)#bandwidth 128
ISP2(config-if)#
ISP2(config-if)#interface serial 2/1
ISP2(config-if)#description ### ISP 1 ###
ISP2(config-if)#ip address 209.165.200.226 255.255.255.252
ISP2(config-if)#bandwidth 128
ISP2(config-if)#no shut
ISP2(config-if)#
*Jul 10 10:22:15.387: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up
ISP2(config-if)#
*Jul 10 10:22:16.399: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up
ISP2(config-if)#
ISP2(config-if)#do ping 209.165.200.225
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.165.200.225, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/32 ms
ISP2(config-if)#end
ISP2#


R1#show interface description | inc up
Se2/0                          up             up       ### ISP 1 ###
Se2/3                          up             up       ### ISP 2 ###
Lo0                            up             up


ISP1#show interface description | inc up
Se2/0                          up             up       ### R1 ####
Se2/1                          up             up       ### ISP 2 ###
Lo0                            up             up       ### INTERNET WEB SERVER ###
Lo1                            up             up       ### ISP1 DNS SERVER ###


ISP2#show interface description | exc down
Interface                      Status         Protocol Description
Se2/1                          up             up       ### ISP 1 ###
Se2/3                          up             up       ### R1 ###
Lo0                            up             up       ### INTERNET WEB SERVER ###
Lo1                            up             up       ### ISP2 DNS SERVER ###


R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip route 0.0.0.0 0.0.0.0 209.165.201.1 
R1(config)#end
R1#


ISP1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ISP1(config)#router eigrp 1
ISP1(config-router)#network 209.165.200.224 0.0.0.3
ISP1(config-router)#network 209.165.201.0 0.0.0.31
ISP1(config-router)#no auto-summary
ISP1(config-router)#exit
ISP1(config)#ip route 192.168.1.0 255.255.255.0 209.165.201.2
ISP1(config)#end
ISP1#
*Jul 10 10:38:55.691: %DUAL-5-NBRCHANGE: EIGRP-IPv4 1: Neighbor 209.165.200.226 (Serial2/1) is up: new adjacency


ISP2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ISP2(config)#router eigrp 1
ISP2(config-router)#network 209.165.200.224 0.0.0.3
ISP2(config-router)#
*Jul 10 10:36:16.343: %DUAL-5-NBRCHANGE: EIGRP-IPv4 1: Neighbor 209.165.200.225 (Serial2/1) is up: new adjacency
ISP2(config-router)#network 209.165.202.128 0.0.0.31
ISP2(config-router)#exit
ISP2(config)#ip route 192.168.1.0 255.255.255.0 209.165.202.130
ISP2(config)#end
ISP2#


R1#tclsh
R1(tcl)#foreach address {
+>(tcl)#209.165.200.254
+>(tcl)#209.165.201.30
+>(tcl)#209.165.202.158
+>(tcl)#} {
+>(tcl)#ping $address source 192.168.1.1
+>(tcl)#}
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.165.200.254, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/16/24 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.165.201.30, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/9/12 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.165.202.158, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/16/20 ms


R1#tclsh     // ROUTING VIA ISP1 HOP
R1(tcl)#foreach address {
+>(tcl)#209.165.200.254
+>(tcl)#209.165.201.30
+>(tcl)#209.165.202.158
+>(tcl)#} {
+>(tcl)#trace $address source 192.168.1.1
+>(tcl)#}
Type escape sequence to abort.
Tracing the route to 209.165.200.254
VRF info: (vrf in name/id, vrf out name/id)
  1 209.165.201.1 20 msec 36 msec 16 msec
Type escape sequence to abort.
Tracing the route to 209.165.201.30
VRF info: (vrf in name/id, vrf out name/id)
  1 209.165.201.1 4 msec 20 msec 20 msec
Type escape sequence to abort.
Tracing the route to 209.165.202.158
VRF info: (vrf in name/id, vrf out name/id)
  1 209.165.201.1 8 msec 20 msec 20 msec
  2 209.165.200.226 24 msec 28 msec 16 msec


R1#conf t  // CONFIGURE IP SLA TO MONITOR ISP REACHABILITY; PROBES CAN BE ICMP, FTP, HTTP AND JITTER; ROUTER CPU AND LINK UTILIZATION SHOULD BE CONSIDERED AND MONITORED
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip sla ?
  <1-2147483647>          Entry Number
  auto                    IP SLAs Auto Configuration
  enable                  Enable IPSLA features
  endpoint-list           Endpoint list configuration
  ethernet-monitor        IP SLAs Auto Ethernet Configuration
  group                   Group Configuration or Group Scheduling
  key-chain               Use MD5 Authentication for IP SLAs Control Messages
  logging                 Enable Syslog
  low-memory              Configure Low Water Memory Mark
  reaction-configuration  IP SLAs Reaction-Configuration
  reaction-trigger        IP SLAs Trigger Assignment
  reset                   IP SLAs Reset
  responder               Enable IP SLAs Responder
  restart                 Restart An Active Entry
  schedule                Entry Scheduling
  server                  IPPM server configuration

R1(config)#ip sla 11
R1(config-ip-sla)#?
IP SLAs entry configuration commands:
  dhcp         DHCP Operation
  dns          DNS Query Operation
  ethernet     Ethernet Operations
  exit         Exit Operation Configuration
  ftp          FTP Operation
  http         HTTP Operation
  icmp-echo    ICMP Echo Operation
  icmp-jitter  ICMP Jitter Operation
  mpls         MPLS Operation
  path-echo    Path Discovered ICMP Echo Operation
  path-jitter  Path Discovered ICMP Jitter Operation
  tcp-connect  TCP Connect Operation
  udp-echo     UDP Echo Operation
  udp-jitter   UDP Jitter Operation
  voip         Voice Over IP Operation

R1(config-ip-sla)#icmp-echo ?
  Hostname or A.B.C.D  Destination IP address or hostname, broadcast disallowed

R1(config-ip-sla)#icmp-echo 209.165.201.30      // ICMP ECHO PROBE
R1(config-ip-sla-echo)#frequency ?
  <1-604800>  Frequency in seconds

R1(config-ip-sla-echo)#frequency 10
R1(config-ip-sla-echo)#exit
R1(config)#ip sla ?
  <1-2147483647>          Entry Number
  auto                    IP SLAs Auto Configuration
  enable                  Enable IPSLA features
  endpoint-list           Endpoint list configuration
  ethernet-monitor        IP SLAs Auto Ethernet Configuration
  group                   Group Configuration or Group Scheduling
  key-chain               Use MD5 Authentication for IP SLAs Control Messages
  logging                 Enable Syslog
  low-memory              Configure Low Water Memory Mark
  reaction-configuration  IP SLAs Reaction-Configuration
  reaction-trigger        IP SLAs Trigger Assignment
  reset                   IP SLAs Reset
  responder               Enable IP SLAs Responder
  restart                 Restart An Active Entry
  schedule                Entry Scheduling
  server                  IPPM server configuration

R1(config)#ip sla schedule ?
  <1-2147483647>  Entry number

R1(config)#ip sla schedule 11 ?
  ageout      How long to keep this Entry when inactive
  life        Length of time to execute in seconds
  recurring   Probe to be scheduled automatically every day
  start-time  When to start this entry
  <cr>

R1(config)#ip sla schedule 11 life ?
  <0-2147483647>  Life seconds (default 3600)
  forever         continue running forever

R1(config)#ip sla schedule 11 life forever ?
  ageout      How long to keep this Entry when inactive
  recurring   Probe to be scheduled automatically every day
  start-time  When to start this entry
  <cr>

R1(config)#ip sla schedule 11 life forever start-time ?
  after     Start after a certain amount of time from now
  hh:mm     Start time (hh:mm)
  hh:mm:ss  Start time (hh:mm:ss)
  now       Start now
  pending   Start pending

R1(config)#ip sla schedule 11 life forever start-time now
R1(config)#end
R1#
*Jul 10 10:51:26.079: %SYS-5-CONFIG_I: Configured from console by console
R1#show ip sla ?
  application             IP SLAs Application
  authentication          IP SLAs Authentication Information
  auto                    IP SLAs Auto Show Commands
  configuration           IP SLAs Configuration
  endpoint-list           IP SLAs Endpoint list configuration
  enhanced-history        IP SLAs Enhanced History
  ethernet-monitor        IP SLAs Auto Ethernet Monitor
  event-publisher         IP SLAs Event Publisher
  group                   IP SLAs Group Scheduling/Configuration
  history                 IP SLAs History
  mpls-lsp-monitor        IP SLAs MPLS LSP Monitor
  reaction-configuration  IP SLAs Reaction Configuration
  reaction-trigger        IP SLAs Reaction Trigger
  responder               IP SLAs Responder Information
  statistics              IP SLAs Statistics
  summary                 IP SLAs Statistics Summary
  twamp                   IP SLAs TWAMP
R1#show ip sla configuration ?
  <1-2147483647>  Entry Number
  |               Output modifiers
  <cr>

R1#show ip sla configuration 11      // VERIFY IP SLA CONFIGURATION
IP SLAs Infrastructure Engine-III
Entry number: 11
Owner:
Tag:
Operation timeout (milliseconds): 5000
Type of operation to perform: icmp-echo
Target address/Source address: 209.165.201.30/0.0.0.0
Type Of Service parameter: 0x0
Request size (ARR data portion): 28
Verify data: No
Vrf Name:
Schedule:
   Operation frequency (seconds): 10  (not considered if randomly scheduled)
   Next Scheduled Start Time: Start Time already passed
   Group Scheduled : FALSE
   Randomly Scheduled : FALSE
   Life (seconds): Forever
   Entry Ageout (seconds): never
   Recurring (Starting Everyday): FALSE
   Status of entry (SNMP RowStatus): Active
Threshold (milliseconds): 5000
Distribution Statistics:
   Number of statistic hours kept: 2
   Number of statistic distribution buckets kept: 1
   Statistic distribution interval (milliseconds): 20
Enhanced History:
History Statistics:
   Number of history Lives kept: 0
   Number of history Buckets kept: 15
   History Filter Type: None


R1#show ip sla statistics      // VERIFY IP SLA STATISTICS SUCH AS NUMBER OF SUCCESSES, FAILURES, ETC
IPSLAs Latest Operation Statistics

IPSLA operation id: 11
        Latest RTT: 16 milliseconds
Latest operation start time: 10:52:37 UTC Tue Jul 10 2018
Latest operation return code: OK
Number of successes: 9
Number of failures: 0
Operation time to live: Forever


R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip sla 22
R1(config-ip-sla)#icmp-echo 209.165.202.158
R1(config-ip-sla-echo)#frequency 10
R1(config-ip-sla-echo)#exit
R1(config)#ip sla schedule 22 life forever start-time now
R1(config)#end
R1#
*Jul 10 10:53:41.491: %SYS-5-CONFIG_I: Configured from console by console
R1#
R1#show ip sla configuration 22
IP SLAs Infrastructure Engine-III
Entry number: 22
Owner:
Tag:
Operation timeout (milliseconds): 5000
Type of operation to perform: icmp-echo
Target address/Source address: 209.165.202.158/0.0.0.0
Type Of Service parameter: 0x0
Request size (ARR data portion): 28
Verify data: No
Vrf Name:
Schedule:
   Operation frequency (seconds): 10  (not considered if randomly scheduled)
   Next Scheduled Start Time: Start Time already passed
   Group Scheduled : FALSE
   Randomly Scheduled : FALSE
   Life (seconds): Forever
   Entry Ageout (seconds): never
   Recurring (Starting Everyday): FALSE
   Status of entry (SNMP RowStatus): Active
Threshold (milliseconds): 5000
Distribution Statistics:
   Number of statistic hours kept: 2
   Number of statistic distribution buckets kept: 1
   Statistic distribution interval (milliseconds): 20
Enhanced History:
History Statistics:
   Number of history Lives kept: 0
   Number of history Buckets kept: 15
   History Filter Type: None


R1#show ip sla statistics 22
IPSLAs Latest Operation Statistics

IPSLA operation id: 22
        Latest RTT: 40 milliseconds
Latest operation start time: 10:54:09 UTC Tue Jul 10 2018
Latest operation return code: OK
Number of successes: 4
Number of failures: 0
Operation time to live: Forever


R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#no ip route 0.0.0.0 0.0.0.0 209.165.201.1
R1(config)#ip route 0.0.0.0 0.0.0.0 209.165.201.1 5     // CONFIGURE FLOATING STATIC ROUTE THAT WILL APPEAR DEPENDING ON IP SLA RESULT
R1(config)#
R1(config)#do 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 209.165.201.1 to network 0.0.0.0

S*    0.0.0.0/0 [5/0] via 209.165.201.1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback0
L        192.168.1.1/32 is directly connected, Loopback0
      209.165.201.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.201.0/30 is directly connected, Serial2/0
L        209.165.201.2/32 is directly connected, Serial2/0
      209.165.202.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.202.128/30 is directly connected, Serial2/3
L        209.165.202.130/32 is directly connected, Serial2/3
R1(config)#
R1(config)#track ?
  <1-1000>    Tracked object
  resolution  Tracking resolution parameters
  timer       Polling interval timers

R1(config)#track 1 ?
  application  Application
  interface    Select an interface to track
  ip           IP protocol
  list         Group objects in a list
  stub-object  Stub tracking object

R1(config)#track 1 ip ?
  route  IP route
  sla    IP Service Level Agreement

R1(config)#track 1 ip sla ?
  <1-2147483647>  Entry number

R1(config)#track 1 ip sla 11 ?
  reachability  Reachability
  state         Return code state
  <cr>

R1(config)#track 1 ip sla 11 reachability     // BIND IP SLA TO A TRACK OBJECT
R1(config-track)#?    
Tracking instance configuration commands:
  default        Set a command to its defaults
  default-state  Default object state
  delay          Tracking delay
  exit           Exit from tracking configuration mode
  no             Negate a command or set its defaults

R1(config-track)#delay ?
  down  Delay down change notification
  up    Delay up change notification

R1(config-track)#delay down ?
  <0-180>  Seconds to delay

R1(config-track)#delay down 10 ?
  up  Delay up change notification
  <cr>

R1(config-track)#delay down 10 up ?
  <0-180>  Seconds to delay

R1(config-track)#delay down 10 up 1      // CONFIGURE DELAY TO AVOID ROUTE FLAPPING
R1(config-track)#end
R1#
*Jul 10 10:58:18.631: %SYS-5-CONFIG_I: Configured from console by console
R1#debug ip routing
IP routing debugging is on
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip route 0.0.0.0 0.0.0.0 209.165.201.1 2 ?
  multicast  multicast route
  name       Specify name of the next hop
  permanent  permanent route
  tag        Set tag for this route
  track      Install route depending on tracked item
  <cr>

R1(config)#ip route 0.0.0.0 0.0.0.0 209.165.201.1 2 track ?
  <1-1000>  tracked object number

R1(config)#ip route 0.0.0.0 0.0.0.0 209.165.201.1 2 track 1
R1(config)#
*Jul 10 10:58:56.711: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 10:58:56.715: RT: closer admin distance for 0.0.0.0, flushing 1 routes
*Jul 10 10:58:56.719: RT: add 0.0.0.0/0 via 209.165.201.1, static metric [2/0]
*Jul 10 10:58:56.719: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 10:58:56.723: RT: rib update return code: 17
*Jul 10 10:58:56.727: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 10:58:56.731: RT: rib update return code: 17
R1(config)#
R1(config)#track 2 ip sla 22 reachability
R1(config-track)#delay down 10 up 1
R1(config-track)#
R1(config-track)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 209.165.202.129 3 track 2
R1(config)#
*Jul 10 10:59:56.255: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 10:59:56.259: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 10:59:56.263: RT: rib update return code: 17
*Jul 10 10:59:56.271: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.202.129   1048578
*Jul 10 10:59:56.275: RT: rib update return code: 17
R1(config)#end
R1#

R1#show ip route      // THE NEW STATIC ROUTE DIDN'T TAKE EFFECT SINCE ADMIN DISTANCE OF 3 HIGHER THAN 2 (LOWER AD IS PREFERRED)
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 209.165.201.1 to network 0.0.0.0

S*    0.0.0.0/0 [2/0] via 209.165.201.1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback0
L        192.168.1.1/32 is directly connected, Loopback0
      209.165.201.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.201.0/30 is directly connected, Serial2/0
L        209.165.201.2/32 is directly connected, Serial2/0
      209.165.202.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.202.128/30 is directly connected, Serial2/3
L        209.165.202.130/32 is directly connected, Serial2/3
R1#


ISP1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ISP1(config)#interface loop 1      // DISABLE ISP1 DNS
ISP1(config-if)#shut
ISP1(config-if)#
*Jul 10 11:00:18.183: %LINK-5-CHANGED: Interface Loopback1, changed state to administratively down
*Jul 10 11:00:19.183: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to down


R1#
*Jul 10 11:02:51.871: %TRACKING-5-STATE: 1 ip sla 11 reachability Up->Down
*Jul 10 11:02:51.875: RT: del 0.0.0.0 via 209.165.201.1, static metric [2/0]
*Jul 10 11:02:51.875: RT: delete network route to 0.0.0.0/0
*Jul 10 11:02:51.879: RT: default path has been cleared
*Jul 10 11:02:51.879: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.202.129   1048578
*Jul 10 11:02:51.879: RT: add 0.0.0.0/0 via 209.165.202.129, static metric [3/0]
*Jul 10 11:02:51.883: RT: default path is now 0.0.0.0 via 209.165.202.129
*Jul 10 11:02:51.883: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 11:02:51.883: RT: rib update return code: 17
*Jul 10 11:02:51.907: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.202.129   1048578
R1#
*Jul 10 11:02:51.911: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 11:02:51.915: RT: rib update return code: 17

R1#show ip route    // ROUTING TABLE INSTALLS THE NEXT FLOATING STATIC ROUTE GOING TO ISP2 (AD 3)
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 209.165.202.129 to network 0.0.0.0

S*    0.0.0.0/0 [3/0] via 209.165.202.129
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback0
L        192.168.1.1/32 is directly connected, Loopback0
      209.165.201.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.201.0/30 is directly connected, Serial2/0
L        209.165.201.2/32 is directly connected, Serial2/0
      209.165.202.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.202.128/30 is directly connected, Serial2/3
L        209.165.202.130/32 is directly connected, Serial2/3
R1#
R1#show ip sla statistics      // ICMP TO ISP 1 DNS FAILED
IPSLAs Latest Operation Statistics

IPSLA operation id: 11
        Latest RTT: NoConnection/Busy/Timeout
Latest operation start time: 11:03:27 UTC Tue Jul 10 2018
Latest operation return code: Timeout
Number of successes: 67
Number of failures: 7
Operation time to live: Forever

IPSLA operation id: 22
        Latest RTT: 32 milliseconds
Latest operation start time: 11:03:19 UTC Tue Jul 10 2018
Latest operation return code: OK
Number of successes: 57
Number of failures: 2
Operation time to live: Forever


R1#traceroute 209.165.200.254 source 192.168.1.1     // TRAFFIC NOW GOES VIA ISP 2 HOP
Type escape sequence to abort.
Tracing the route to 209.165.200.254
VRF info: (vrf in name/id, vrf out name/id)
  1 209.165.202.129 44 msec 36 msec 12 msec


ISP1(config)#interface loop 1
ISP1(config-if)#no shut
ISP1(config-if)#
*Jul 10 11:03:04.459: %LINK-3-UPDOWN: Interface Loopback1, changed state to up
*Jul 10 11:03:05.463: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up


R1#
*Jul 10 11:05:32.887: %TRACKING-5-STATE: 1 ip sla 11 reachability Down->Up
*Jul 10 11:05:32.891: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 11:05:32.895: RT: closer admin distance for 0.0.0.0, flushing 1 routes
*Jul 10 11:05:32.899: RT: add 0.0.0.0/0 via 209.165.201.1, static metric [2/0]
*Jul 10 11:05:32.899: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.202.129   1048578
*Jul 10 11:05:32.903: RT: rib update return code: 17
*Jul 10 11:05:32.907: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.202.129   1048578
*Jul 10 11:05:32.911: RT: rib update return code: 17
*Jul 10 11:05:32.915: RT: updating static 0.0.0.0/0 (0x0):
    via 209.165.201.1   1048578
*Jul 10 11:05:32.919: RT:
R1#rib update return code: 17
R1#
R1#show ip sla statistics
IPSLAs Latest Operation Statistics

IPSLA operation id: 11
        Latest RTT: 8 milliseconds
Latest operation start time: 11:06:07 UTC Tue Jul 10 2018
Latest operation return code: OK
Number of successes: 72
Number of failures: 18
Operation time to live: Forever


IPSLA operation id: 22
        Latest RTT: 24 milliseconds
Latest operation start time: 11:06:09 UTC Tue Jul 10 2018
Latest operation return code: OK
Number of successes: 74
Number of failures: 2
Operation time to live: Forever


R1#show ip route     // ROUTE VIA ISP1 RE-ESTABLISHED WITH AD 2
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 209.165.201.1 to network 0.0.0.0

S*    0.0.0.0/0 [2/0] via 209.165.201.1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback0
L        192.168.1.1/32 is directly connected, Loopback0
      209.165.201.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.201.0/30 is directly connected, Serial2/0
L        209.165.201.2/32 is directly connected, Serial2/0
      209.165.202.0/24 is variably subnetted, 2 subnets, 2 masks
C        209.165.202.128/30 is directly connected, Serial2/3
L        209.165.202.130/32 is directly connected, Serial2/3