Lab Objective:
The focus of this lab is to understand Cisco Policy Based Routing (PBR) implementation and configuration in Cisco IOS routers. Additional technologies include EOT and path control.
Lab Topology:
The lab network topology is illustrated below:
|
IMPORTANT NOTE If you are using the www.howtonetwork.net racks, please bring up the LAN interfaces connected to the routers by issuing the no shutdown command on the connected switches. If you are using a home lab with no interface fastethernet 0/0 Alternately, you can simply connect the interfaces to a hub or switch if you have one available in your own lab. |
Task 1
Configure hostnames, IP addressing on all routers as illustrated in the network topology. In addition, configure a Loopback 0 interface on R1 with the IP address 1.1.1.1/32.
Task 2
Configure EIGRP as illustrated in the topology. Do NOT enable EIGRP on the R1-R3 link or the R2-R3 link. You should ensure that no EIGRP packets are sent out of the FastEthernet0/0 interface on R2. R1 should advertise a default route to R4. Configure a static default route on R2 pointing to R3. Configure three static routes on R3: two static routes for the 150.1.1.0/24 subnet should point to R1; two static routes for 150.2.2.0/24 and 0.0.0.0/0 should point to R2.Verify your configuration using the appropriate commands.
Task 3
Configure IOS PBR on R1 so that all TCP and ICMP traffic from the 150.1.1.0/24 subnet to any subnet is forwarded to 10.0.0.2 (R2). In the event that the path via R2 is unavailable, configure PBR so that the router forwards this traffic to 10.0.0.6 (R3). However, this alternate path should ONLY be used based on Cisco Discovery Protocol (CDP) reachability information. Finally, ensure that all other traffic from the 150.1.1.0/24 subnet to any subnet should be forwarded via 10.0.0.3 (R3). If this path is down, this traffic should be discarded. Verify your configuration using the appropriate show commands and/or debugging commands.
Task 4
Configure IOS PBR with EOT on R2 and R3 such that when either of the routers’ WAN links to R1 is down, all traffic from the local LAN is sent across the R2-R3 link. When the WAN link is up, traffic from the LAN segments should be forwarded to R1. Verify your PBR configuration using the appropriate show and/or debugging commands.
Lab Validation
Task 1
Please refer to previous labs for basic IPv4, IPv6 addressing and hostname configuration. This will not be included in this section to avoid being redundant.
Task 2
Please refer to previous labs for basic EIGRP configuration. Following this, verify your EIGRP configuration using the show ip eigrp neighbors andshow ip route commands. Following this configuration, your route tables should show the following route information:
| R1#show ip route Codes: 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 Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets |
| R2#show ip route Codes: 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 Gateway of last resort is 10.0.0.10 to network 0.0.0.0 10.0.0.0/30 is subnetted, 2 subnets |
| R3#show ip route Codes: 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 Gateway of last resort is 10.0.0.9 to network 0.0.0.0 10.0.0.0/30 is subnetted, 2 subnets |
| R4#show ip route Codes: 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 Gateway of last resort is 150.1.1.1 to network 0.0.0.0 150.1.0.0/24 is subnetted, 1 subnets |
Task 3
The requirements of this task are three-fold. First, all TCP and ICMP traffic should be policy routed via 10.0.0.2 (R2). This can be completed by specifying the next hop or interface for this type of traffic. The second requirement is that in the event that the path to R2 is not available, the same traffic should then be sent via R3; however, this should only be done based on CDP reachability information. In other words, if CDP determines that R3 is unavailable, the traffic should not be sent to this router.
To satisfy this second requirement, we need to use the verify-availability keyword. The verify-availability keyword is used to force the router to check the Cisco Discovery Protocol (CDP) database to determine if an entry is available for the next hop that is specified by the set ip default next-hop command. This command prevents traffic from being black holed in situations where the specified next hop IP address is not directly connected to the router, for example. In such cases, if the specified next hop IP address does become unreachable, the router would never know and will continue sending packets to it, resulting in a black holing of traffic. This keyword is applied using a separate line in the route map.
Finally, the third requirement is that all other traffic be policy routed via R3. This can be done by specifying either the next hop address or specifying the egress interface. The requirements within this task are satisfied by configuring R1 as follows:
| R1(config)#ip access-list extended TCP-AND-ICMP R1(config-ext-nacl)#permit icmp 150.1.1.0 0.0.0.255 any R1(config-ext-nacl)#permit tcp 150.1.1.0 0.0.0.255 any R1(config-ext-nacl)#exit R1(config)#route-map LAN-PBR permit 10 R1(config-route-map)#match ip address TCP-AND-ICMP R1(config-route-map)#set ip next-hop 10.0.0.2 R1(config-route-map)#set ip next-hop verify-availability R1(config-route-map)#set ip default next-hop 10.0.0.6 R1(config-route-map)#exit R1(config)#route-map LAN-PBR permit 20 R1(config-route-map)#set ip next-hop 10.0.0.6 R1(config-route-map)#exit R1(config)#interface fastethernet 0/0 R1(config-if)#ip policy route-map LAN-PBR R1(config-if)#exit |
Following this, verify your route map using the show route-map <name> command:
| R1#show route-map LAN-PBR route-map LAN-PBR, permit, sequence 10 Match clauses: ip address (access-lists): TCP-AND-ICMP Set clauses: ip next-hop 10.0.0.2 ip next-hop verify-availability ip default next-hop 10.0.0.6 Policy routing matches: 0 packets, 0 bytes route-map LAN-PBR, permit, sequence 20 |
Next, verify your solution by pinging or initiating a Telnet session to R3. You can also enable debugging for PBR to verify matches against the configured policy:
| R4#ping 150.3.3.3
Type escape sequence to abort. |
| R1#debug ip policy Policy routing debugging is on R1# R1# R1# R1# *Jun 3 10:54:53.467: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 10:54:53.467: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.2, len 100, FIB policy routed *Jun 3 10:54:53.487: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 10:54:53.487: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.2, len 100, FIB policy routed *Jun 3 10:54:53.507: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 10:54:53.507: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.2, len 100, FIB policy routed *Jun 3 10:54:53.523: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 10:54:53.527: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.2, len 100, FIB policy routed *Jun 3 10:54:53.543: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 10:54:53.543: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.2, len 100, FIB policy routed |
Next, verify failover based on CDP reachability by disabling the R1-R2 link and performing the same ping test from R4 to the LAN IP address of R3:
| R4#ping 150.3.3.3
Type escape sequence to abort. |
| R1(config)#interface serial 0/0 R1(config-if)#shut R1(config-if)# *Jun 3 11:23:40.587: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.6, len 100, FIB policy routed *Jun 3 11:23:40.607: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 11:23:40.607: CEF-IP-POLICY: fib for addr 10.0.0.2 is default; Nexthop rejected *Jun 3 11:23:40.607: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.6, len 100, FIB policy routed *Jun 3 11:23:40.623: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 11:23:40.623: CEF-IP-POLICY: fib for addr 10.0.0.2 is default; Nexthop rejected *Jun 3 11:23:40.623: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.6, len 100, FIB policy routed *Jun 3 11:23:40.643: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 11:23:40.643: CEF-IP-POLICY: fib for addr 10.0.0.2 is default; Nexthop rejected *Jun 3 11:23:40.643: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.6, len 100, FIB policy routed *Jun 3 11:23:40.659: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 11:23:40.663: CEF-IP-POLICY: fib for addr 10.0.0.2 is default; Nexthop rejected *Jun 3 11:23:40.663: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.6, len 100, FIB policy routed |
Task 4
This task requires that Enhanced Object Tracking be used to track the status of each of the routers’ WAN connections to R1. This task is completed as follows:
| R2(config)#track 1 interface serial 0/0 line-protocol R2(config-track)#exit R2(config)#route-map LAN-PBR permit 10 R2(config-route-map)#set ip next-hop verify-availability 10.0.0.1 1 track 1 R2(config-route-map)#set ip next-hop 10.0.0.10 R2(config-route-map)#exit R2(config)#interface fastethernet 0/0 R2(config-if)#ip policy route-map LAN-PBR R2(config-if)#exit |
| R3(config)#track 1 interface serial 1/0 line-protocol R3(config-track)#exit R3(config)#route-map LAN-PBR permit 10 R3(config-route-map)#set ip next-hop verify-availability 10.0.0.5 1 track 1 R3(config-route-map)#set ip next-hop 10.0.0.9 R3(config-route-map)#exit R3(config)#interface fastethernet 0/0 R3(config-if)#ip policy route-map LAN-PBR R3(config-if)#exit |
Following this, first verify your EOT configuration using the show track command:
| R2#show track Track 1 Interface Serial0/0 line-protocol Line protocol is Up 1 change, last change 00:00:26 Tracked by: ROUTE-MAP 0 |
| R3#show track Track 1 Interface Serial1/0 line-protocol Line protocol is Up 1 change, last change 00:00:32 Tracked by: ROUTE-MAP 0 |
Next, verify route map configuration using the show route-map <name> command:
| R2#show route-map LAN-PBR route-map LAN-PBR, permit, sequence 10 Match clauses: Set clauses: ip next-hop verify-availability 10.0.0.1 1 track 1 [up] ip next-hop 10.0.0.10 Policy routing matches: 0 packets, 0 bytes |
| R3#show route-map LAN-PBR route-map LAN-PBR, permit, sequence 10 Match clauses: Set clauses: ip next-hop verify-availability 10.0.0.5 1 track 1 [up] ip next-hop 10.0.0.9 Policy routing matches: 0 packets, 0 bytes |
To test your solution, first ping from the R2 or R3 LAN subnet to the R4. To view PBR operation in real time, enable PBR debugging while sending the pings. The following shows host 150.2.2.254 sending pings to 150.1.1.4 (R4s LAN IP) while PBR debugging is enabled on R2:
| R2#debug ip policy Policy routing debugging is on R2# R2# R2# R2# *May 17 18:08:49.475: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:08:49.475: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.1, len 100, FIB policy routed *May 17 18:08:49.479: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:08:49.479: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.1, len 100, FIB policy routed *May 17 18:08:49.487: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:08:49.487: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.1, len 100, FIB policy routed *May 17 18:08:49.491: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:08:49.491: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.1, len 100, FIB policy routed *May 17 18:08:49.499: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:08:49.499: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.1, len 100, FIB policy routed |
Next, verify redundancy by disabling the R1-R2 link and performing the same test:
| R2(config)#interface serial 0/0 R2(config-if)#shut R2(config-if)# *May 17 18:10:48.739: %TRACKING-5-STATE: 1 interface Se0/0 line-protocol Up->Down *May 17 18:10:48.763: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 254: Neighbor 10.0.0.1 (Serial0/0) is down: interface down *May 17 18:10:50.739: %LINK-5-CHANGED: Interface Serial0/0, changed state to administratively down *May 17 18:10:51.739: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down R2(config-if)# R2(config-if)# *May 17 18:10:59.215: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:10:59.215: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.10, len 100, FIB policy routed *May 17 18:10:59.251: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:10:59.251: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.10, len 100, FIB policy routed *May 17 18:10:59.283: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:10:59.283: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.10, len 100, FIB policy routed *May 17 18:10:59.315: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:10:59.315: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.10, len 100, FIB policy routed *May 17 18:10:59.347: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, len 100, FIB policy match *May 17 18:10:59.351: IP: s=150.2.2.254 (FastEthernet0/0), d=150.1.1.4, g=10.0.0.10, len 100, FIB policy routed |
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1316 bytes R1# |
R2
|
R2#term len 0 Current configuration : 1149 bytes R2# |
R3
|
R3#term len 0 Current configuration : 1447 bytes R3# |
R4
|
R4#term len 0 Current configuration : 833 bytes R4# |
