Lab Objective:
The focus of this lab is to understand PBR implementation and configuration in Cisco IOS routers. Additional technologies include IP SLA Operations and Enhanced Object Tracking.
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. Ensure that no EIGRP packets are sent out of the LAN interfaces of R2 and R3. Do NOT enable EIGRP for the R2-R3 link. Ensure that R1 advertises a default route to R4. Next, configure static default routes on R2 and R3 as follows:
- R2 should have a default static route pointing to R3
- R3 should have a default static route pointing to R2
Verify your configuration using the appropriate commands on all routers in the network.
Task 3
Configure IOS PBR on R1 so that when R1 loses the EIGRP route to the 150.2.2.0/24 subnet, all traffic sourced from the 150.1.1.0/24 subnet to this destination is sent via R3. In addition to this, configure IOS PBR on R1 so that when R1 loses the EIGRP route to the 150.3.3.0/24 subnet, all traffic sourced from the 150.1.1.0/24 subnet to this destination is sent via R2. To avoid black holing traffic, configure R1 to check the CDP database to determine if an entry is available for the specified next hop address. Verify your configuration using the appropriate commands.
Task 4
Configure PBR on R2 and R3 so that when either of their WAN connections to R1 are down, only HTTP and HTTPS should be permitted from the local LAN segment and sent across the R2-R3 WAN link. Assuming that QoS is enabled on the R2-R3 link, this traffic should be forwarded using an IP Precedence of 4. All other traffic from the LAN subnet of the router that lost its WAN connection to R1 should be forwarded with an IP Precedence of 2.
When the WAN link to R1 is up, all traffic should follow the EIGRP route through R1. When completing this task, you MUST adhere to the following restrictions:
- You MUST use Cisco Enhanced Object Tracking (EOT) in your solution
- You MUST use Cisco IOS IP SLA Operations and in your solution
- The Cisco IOS IP SLA Operation should ping the connected IP address of R1
- As long as EIGRP routing information is present, PBR should be inactive
Verify the PBR configuration using the appropriate show commands 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 0.0.0.0 to network 0.0.0.0 10.0.0.0/30 is subnetted, 2 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, 3 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, 3 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
In order to complete this task, we need to use the set ip default next-hop route map set clause. In order to ensure that CDP reachability is verified, we also need to use the set ip default next-hop verify-availability set clause. The verify-availability keyword forces the router to check the 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. This task is completed as follows:
| R1(config)#ip access-list extended TO-R2-LAN R1(config-ext-nacl)#permit ip 150.1.1.0 0.0.0.255 150.2.2.0 0.0.0.255 R1(config-ext-nacl)#exit R1(config)#ip access-list extended TO-R3-LAN R1(config-ext-nacl)#permit ip 150.1.1.0 0.0.0.255 150.3.3.0 0.0.0.255 R1(config-ext-nacl)#exit R1(config)#route-map LAN-PBR permit 10 R1(config-route-map)#match ip address TO-R2-LAN 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)#match ip address TO-R3-LAN R1(config-route-map)#set ip next-hop verify-availability R1(config-route-map)#set ip default next-hop 10.0.0.2 R1(config-route-map)#exit R1(config)#route-map LAN-PBR deny 30 R1(config-route-map)#exit R1(config)#interface fastethernet 0/0 R1(config-if)#ip policy route-map LAN-PBR R1(config-if)#exit |
Next, verify your PBR configuration 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): TO-R2-LAN Set clauses: 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 route-map LAN-PBR, deny, sequence 30 |
Test your solution by shutting first shutting down the R1-R2 link and then pinging 150.2.2.0/24 from R4. You can enable PBR debugging to view PBR operation in real time:
| R4#ping 150.2.2.2
Type escape sequence to abort. |
| R1#debug ip policy Policy routing debugging is on R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface serial 0/0 R1(config-if)#shutdown R1(config-if)#end R1# R1# *Jun 3 17:58:19.942: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, len 100, FIB policy match *Jun 3 17:58:19.942: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, g=10.0.0.6, len 100, FIB policy routed *Jun 3 17:58:19.974: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, len 100, FIB policy match *Jun 3 17:58:19.974: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, g=10.0.0.6, len 100, FIB policy routed *Jun 3 17:58:20.006: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, len 100, FIB policy match *Jun 3 17:58:20.006: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, g=10.0.0.6, len 100, FIB policy routed *Jun 3 17:58:20.038: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, len 100, FIB policy match *Jun 3 17:58:20.038: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, g=10.0.0.6, len 100, FIB policy routed *Jun 3 17:58:20.070: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, len 100, FIB policy match *Jun 3 17:58:20.070: IP: s=150.1.1.4 (FastEthernet0/0), d=150.2.2.2, g=10.0.0.6, len 100, FIB policy routed |
Next, test the Policy Based Routing operation for the 150.3.3.0/24 subnet by shutting down the R1-R3 link and pinging R3s LAN IP address from R4:
| R4#ping 150.3.3.3
Type escape sequence to abort. |
| R1#debug ip policy Policy routing debugging is on R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface serial 0/1 R1(config-if)#shutdown R1(config-if)#end R1# R1# *Jun 3 18:04:25.286: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 18:04:25.286: 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 18:04:25.302: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 18:04:25.306: 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 18:04:25.322: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 18:04:25.322: 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 18:04:25.342: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 18:04:25.342: 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 18:04:25.362: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, len 100, FIB policy match *Jun 3 18:04:25.362: IP: s=150.1.1.4 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.2, len 100, FIB policy routed |
Task 4
This task requires the use of the set ip next-hop <address> and the set ip next-hop verify-availability <address> <sequence> track <object number>] route map mode subcommands. The issue is that this command supersedes dynamic routing as far as traffic forwarding goes. Therefore, to ensure that PBR is used ONLY when the dynamic routing information is no longer available, while still using the set ip next-hop [<address> | verify-availability <address> <sequence> track <object number>] route map mode subcommand, we need to use the NOT command with a Boolean tracked object.
The NOT keyword negates the state of the object, which means that when the object is up, the tracked list detects the object as down. In other words, what will happen is that when the tracked object (tracked via IP SLA Operation) is up, PBR will see it as down, therefore using the dynamic routing information. Inversely, when the tracked object is down, PBR will see it as up and therefore implement policy routing. This task is completed as follows:
| R1(config)#ip sla monitor responder |
| R3(config)#ip sla monitor responder R3(config)#ip sla monitor 1 R3(config-sla-monitor)#$rotocol ipIcmpEcho 10.0.0.5 source-ipaddr 10.0.0.6 R3(config-sla-monitor-echo)#exit R3(config)#ip sla monitor schedule 1 life forever start-time now R3(config)#track 1 rtr 1 R3(config-track)#exit R3(config)#track 2 list boolean or R3(config-track)#object 1 not R3(config-track)#exit R3(config)#ip access-list extended HTTP-AND-HTTPS R3(config-ext-nacl)#permit tcp any any eq www R3(config-ext-nacl)#permit tcp any any eq 443 R3(config-ext-nacl)#route-map LAN-PBR permit 10 R3(config-route-map)#match ip address HTTP-AND-HTTPS R3(config-route-map)#set ip next-hop verify-availability 10.0.0.9 1 track 2 R3(config-route-map)#set ip precedence 4 R3(config-route-map)#exit R3(config)#route-map LAN-PBR permit 20 R3(config-route-map)#set ip next-hop verify-availability 192.0.2.1 1 track 2 R3(config-route-map)#set ip precedence 2 R3(config-route-map)#exit R3(config)#interface fastethernet 0/0 R3(config-if)#ip policy route-map LAN-PBR R3(config-if)#exit |
Given this configuration, as long as the IP SLA Operation reports a success, the tracked object will show up as down, which in turn means that PBR will NOT be used. The IP SLA Operation has been configured to ping directly connected R1 WAN interface from both routers. The assumption here is that if R2 and R3 both cannot ping the WAN interfaces to which they are connected to R1, then it is safe to assume that EIGRP is also down between these two routers and R1. Following this configuration, first verify the IP SLA Operation state using the show ip sla monitor statistics command on both routers:
| R2#show ip sla monitor statistics 1 Round trip time (RTT) Index 1 Latest RTT: 11 ms Latest operation start time: *01:22:54.466 UTC Wed May 18 2011 Latest operation return code: OK Number of successes: 9 Number of failures: 0 Operation time to live: Forever |
| R3#show ip sla monitor statistics 1 Round trip time (RTT) Index 1 Latest RTT: 12 ms Latest operation start time: *12:21:00.694 UTC Tue May 17 2011 Latest operation return code: OK Number of successes: 6 Number of failures: 0 Operation time to live: Forever |
Next, verify the EOT configuration using the show track command on both routers:
| R2#show track Track 1 Response Time Reporter 1 state State is Up 4 changes, last change 00:09:25 Latest operation return code: OK Latest RTT (millisecs) 11 Tracked by: Track-list 2 Track 2 |
| R3#show track Track 1 Response Time Reporter 1 state State is Up 2 changes, last change 00:06:45 Latest operation return code: OK Latest RTT (millisecs) 12 Tracked by: Track-list 2 Track 2 |
Note in the output above that track list 2, which is tracking track list 1 and is also being tracked in the PBR configuration shows a down state. This is because of the Bolean NOT keyword in the EOT configuration which inverses the logic. As long as track list 1 shows up, track list 2 will show down. When track list 1 shows down, track list 2 will show up. This can be verified by looking at the route maps configured on both routers using the show route-map command:
| R2#show route-map LAN-PBR route-map LAN-PBR, permit, sequence 10 Match clauses: ip address (access-lists): HTTP-AND-HTTPS Set clauses: ip precedence flash-override ip next-hop verify-availability 10.0.0.10 1 track 2 [down] Policy routing matches: 0 packets, 0 bytes route-map LAN-PBR, permit, sequence 20 |
| R3#show route-map LAN-PBR route-map LAN-PBR, permit, sequence 10 Match clauses: ip address (access-lists): HTTP-AND-HTTPS Set clauses: ip precedence flash-override ip next-hop verify-availability 10.0.0.9 1 track 2 [down] Policy routing matches: 0 packets, 0 bytes route-map LAN-PBR, permit, sequence 20 |
To test our configuration, first initiate an HTTP or HTTPS session from LAN-to-LAN between R2 and R3. As long as the EIGRP is up and IP SLA Operations reports an OK, the PBR configuration will be ignored and normal forwarding will be used. You can enable HTTP and HTTPS functionality on Cisco IOS routers using the ip http server or ip http secure-server global configuration commands on the routers. The following shows forwarding for an HTTP connection from host 150.2.2.254 (connected to R2) to 150.3.3.3 (R3) while EIGRP is up and Policy Based Routing debugging is enabled on R2:
| R2#debug ip policy Policy routing debugging is on R2# R2# *May 18 01:36:14.670: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 44, FIB policy match *May 18 01:36:14.670: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 44, FIB policy rejected – normal forwarding *May 18 01:36:14.686: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 40, FIB policy match *May 18 01:36:14.686: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 40, FIB policy rejected – normal forwarding *May 18 01:36:14.686: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 40, FIB policy match *May 18 01:36:14.686: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 40, FIB policy rejected – normal forwarding |
Next, shut down BOTH of the WAN interfaces on R1 and verify the route maps configured on R2 and R3 using the show route-map <name>command:
| R1(config)#interface serial 0/0 R1(config-if)#shutdown R1(config-if)#exit R1(config)#interface serial 0/1 R1(config-if)#shutdown R1(config-if)#exit |
| R2#show route-map LAN-PBR route-map LAN-PBR, permit, sequence 10 Match clauses: ip address (access-lists): HTTP-AND-HTTPS Set clauses: ip precedence flash-override ip next-hop verify-availability 10.0.0.10 1 track 2 [up] Policy routing matches: 0 packets, 0 bytes route-map LAN-PBR, permit, sequence 20 |
| R3#show route-map LAN-PBR route-map LAN-PBR, permit, sequence 10 Match clauses: ip address (access-lists): HTTP-AND-HTTPS Set clauses: ip precedence flash-override ip next-hop verify-availability 10.0.0.9 1 track 2 [up] Policy routing matches: 0 packets, 0 bytes route-map LAN-PBR, permit, sequence 20 |
Next, an HTTP connection is again initiated from the 150.2.2.254 host to 150.3.3.3 while Policy Based Routing (PBR) debugging is enabled on R2:
| R2#debug ip policy Policy routing debugging is on R2# R2# *May 18 02:28:12.477: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 44, FIB policy match *May 18 02:28:12.477: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.10, len 44, FIB policy routed *May 18 02:28:12.493: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 40, FIB policy match *May 18 02:28:12.493: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.10, len 40, FIB policy routed *May 18 02:28:12.493: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, len 40, FIB policy match *May 18 02:28:12.493: IP: s=150.2.2.254 (FastEthernet0/0), d=150.3.3.3, g=10.0.0.10, len 40, FIB policy routed |
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1478 bytes R1# |
R2
|
R2#term len 0 Current configuration : 1536 bytes R2# |
R3
|
R3#term len 0 Current configuration : 1852 bytes R3# |
R4
|
R4#term len 0 Current configuration : 833 bytes R4# |
