Section 2.0: Routing Configuration
2.1: Core Routing OSPF/EIGRP/RIP
Configure core routing for all the above protocols on all routers in the network. Redistribute only where necessary; you must use your judgement. See the solutions below where required.
There is a loopback on R3 10.50.13.97/28 in Area66. You will see this route on all participating OSPF routers but not on R5, which is running RIPv1. The RIP network between R5 and R1 is a /27. You are redistributing OSPF into RIP on R1, but it will not redistribute the /28 since it has a different mask belonging to the same major net.
The workaround is to summarize this in RIP on R1 to /27. Since you are restricted not to use a summarization technique, another technique to achieve this is to create a loopback on R1 with a /27 mask; this will automatically get into the RIP database, as it is the same major net. You can check this in the RIP database with show ip rip database on R1, and you will find the loopback as directly connected and not redistributed. This is not a good practice in real life but you can use this in lab setup.
It is always a good idea to hardcode the router IDs on each OSPF speaker. This way, it is easier to identify the router sending/receiving updates and troubleshoot any problems with the OSPF peers.
On R5, you need to enable split-horizon on the serial link to R1, as it is advertising the 22.214.171.124/8 route back to R1 (see the following debug output):
r1#debug ip routing 04:08:11: RT: network 126.96.36.199 is now variably masked 04:08:11: RT: add 188.8.131.52/16 via 10.50.13.130, rip metric [120/3] 04:08:11: RT: network 184.108.40.206 is now variably masked 04:08:11: RT: add 220.127.116.11/8 via 10.50.13.130, rip metric [120/3] 04:08:11: RT: network 18.104.22.168 is now variably masked 04:08:11: RT: add 22.214.171.124/8 via 10.50.13.130, rip metric [120/3] 04:08:11: RT: network 126.96.36.199 is now variably masked 04:08:11: RT: add 188.8.131.52/16 via 10.50.13.130, rip metric [120/3] 04:08:11: RT: network 184.108.40.206 is now variably masked 04:08:11: RT: add 220.127.116.11/8 via 10.50.13.130, rip metric [120/3] 04:08:39: RT: metric change to 18.104.22.168 via 10.50.13.130, rip metric [120/3] new metric [120/4] 04:08:39: RT: metric change to 22.214.171.124 via 10.50.13.130, rip metric [120/3] new metric [120/4] 04:08:39: RT: metric change to 126.96.36.199 via 10.50.13.130, rip metric [120/3] new metric [120/4] 04:08:39: RT: metric change to 188.8.131.52 via 10.50.13.130, rip metric [120/3] new metric [120/4] 04:08:39: RT: metric change to 184.108.40.206 via 10.50.13.130, rip metric [120/3] new metric [120/4]
Fix this by enabling split-horizon on Serial0 on R5.
Snip from R5 config:
interface Serial0 ip address 10.50.13.130 255.255.255.224 ip split-horizon no frame-relay inverse-arp
Configure EIGRP with the null routes, redistribute EIGRP into OSPF with a metric of 10, and then summarize them in OSPF to a /25 to advertise one route to all OSPF neighbors.
Basic RIP configuration to be done on R3, R6, and PIX using MD5 authentication. Do not configure any default route on PIX and R6. You should configure RIP on PIX to inject a default route for R3 using rip inside default version 2 authentication md5 cisco 1.
Make sure you can ping the AAA server from the PIX.
2.5.1: Basic BGP Configuration
Configure R1 as route-reflector server for BGP connection to R5, as it is not fully meshed. Also configure next-hop-self for R5 peer, as R1 will advertise all routes learned by iBGP peers and forward to R5 without changing the next hop, and this could cause reachability problems at times if you don't have proper routes on R5.
For iBGP between R3 and R6, you need to create static NAT for R6 Ethernet 10.10.6.2 to 10.50.31.22 and permit TCP port 49 on PIX for inbound connections. You will use 10.50.31.22 on R3 for BGP peer configuration.
It is always a good idea to hardcode the router IDs on each BGP speaker just like in the OSPF process for troubleshooting.
2.5.2: BGP Connections
This is a tricky one. The objective is to always build a BGP connection from outside-to-inside only. That is, R6 should not be able to build a BGP connection to R3, which it can by default since packets are going from a higher security level interface to a lower interface.
To achieve this task, you need to configure an ACL on the inside interface and deny R6 BGP connection to R3:
See also the PIX output in the Solutions section.
access-list inside deny tcp host 10.10.6.2 host 10.50.31.2 eq bgp (hitcnt=4)
2.5.3: BGP and OSPF
Another tricky question. It seems very straightforward to create loopbacks on R2 and R4. Advertise them in BGP using the network command, and redistribute into OSPF. All OSPF routers should see these routes.
Well, it is not so simple. After doing the above, check from R3 and R4 and see if you can ping using the optimal path. If you do traceroute from routers R3 and R4, you will notice that they are not taking the optimal path.
The solution is to use the BGP network backdoor command. You can also use the distance command, but you are restricted to use this to achieve this task. See solutions for R3 and R4.
Traceroute 220.127.116.11 from R4 and you will find that it is going through R5, whereas the optimal path is via R1.
Traceroute 18.104.22.168 or 22.214.171.124 from R3 and you will find that it is not using the optimal path either.
Note that there is a bug with the BGP network backdoor command in Cisco IOS Software Release 12.1T. When you apply the command it will not take effect. See bug id CSCdr12571 for more details. The workaround is to remove using the no network backdoor command and reapply back in. No need to clear BGP.
2.5.4: BGP and RIP
Traceroute 126.96.36.199 (loopback2) from R4. You will notice that the next hop is R5 10.10.45.5 and not R1 10.50.13.81 as it is for 188.8.131.52 (loopback1). Why?
Because we advertised 184.108.40.206 in RIP and BGP on R1, which made to BGP table on R5, and since R5 was peering eBGP with R4, it overwrote the route learned on R4 via OSPF as better admin distance. To confirm, turn on debug ip routing on R4 and clear ip route * as demonstrated in the following ip routing debug snippet from R4.
5d23h: RT: add 220.127.116.11/24 via 10.50.13.81, ospf metric [110/5] 5d23h: RT: closer admin distance for 18.104.22.168, flushing 1 routes 5d23h: RT: add 22.214.171.124/24 via 10.10.45.5, bgp metric [20/0]
As you can see, it overwrites the 126.96.36.199 route learned via OSPF with BGP.
To fix this, you need to tweak the eBGP admin distance from 20 to 120 (something higher than OSPF) as follows.
Configure the distance bgp 120 200 200 command on R4 in BGP.
Then clear ip route * and you will see that the OSPF route stays, as demonstrated in the following ip routing debug from R4.
5d23h: RT: add 188.8.131.52/24 via 10.50.13.81, ospf metric [110/5]
You will not notice this problem if you have BGP "synchronization" enabled on R4; do "no sync" on R4 BGP and you will run into this problem.
2.5.5: BGP Attributes
Advertise loopback1 using the network command on R6. You are restricted to use the network command to advertise loopback2; you will need to redistribute connected in BGP. Create an access list and a route map to redistribute loopback2 only. After doing so, do a show ip bgp on R6 and you will find that the origin-code for loopback2 is incomplete, denoted by a ?, because it has been redistributed and BGP hasn't learned this internally. To change the origin-code to denote i, use the set origin igp command in your route map:
access-list 16 permit 184.108.40.206 0.0.0.255 ! route-map loop2 permit 10 match ip address 16 set origin igp ! router bgp 3 no synchronization bgp router-id 220.127.116.11 bgp cluster-id 2795939494 bgp log-neighbor-changes network 18.104.22.168 mask 255.255.255.0 redistribute connected metric 2 route-map loop2
Done? No, not yet.
Check the routing table on R3 to see if you see the R6 Loopback1 and Loopback2. Check its next hop, and which routing protocol is it learning from:
r3#show ip route 22.214.171.124/24 is subnetted, 1 subnets O E2 126.96.36.199 [110/5] via 10.50.13.1, 00:00:07, Serial1/0.1 188.8.131.52/24 is subnetted, 1 subnets O E2 184.108.40.206 [110/5] via 10.50.13.1, 00:00:07, Serial1/0.1 O*E2 0.0.0.0/0 [110/1] via 10.50.13.17, 00:00:07, Serial1/0.3
See the following debugs, which show Loopback1 and Loopback2 being learned via OSPF (10.50.13.1) and not iBGP (10.50.31.22). This is because R3 is peering eBGP with R1 and redistributing BGP into OSPF on R1. Because OSPF is peering with R3, it is learning the route via OSPF and overwriting the iBGP route learned via R6. Very complex loop!
r3#debug ip routing IP routing debugging is on r3# 4d23h: RT: closer admin distance for 220.127.116.11, flushing 1 routes 4d23h: RT: add 18.104.22.168/24 via 10.50.13.1, ospf metric [110/5] 4d23h: RT: add 22.214.171.124/24 via 10.50.13.17, ospf metric [110/786] 4d23h: RT: add 126.96.36.199/24 via 10.50.13.1, ospf metric [110/834] 4d23h: RT: closer admin distance for 188.8.131.52, flushing 1 routes 4d23h: RT: add 184.108.40.206/24 via 10.50.13.1, ospf metric [110/5]
To fix this, create an access list and filter the two loopbacks using distribute-list inbound in OSPF:
r3# show running-config ! <snip> router ospf 110 router-id 220.127.116.11 distribute-list 16 in ! r3#show access-lists Standard IP access list 16 deny 18.104.22.168, wildcard bits 0.0.0.255 deny 22.214.171.124, wildcard bits 0.0.0.255 permit any r3# r3#debug ip routing IP routing debugging is on r3# <snip> 4d23h: RT: add 126.96.36.199/24 via 10.50.31.22, bgp metric [200/2] 4d23h: RT: add 188.8.131.52/24 via 10.50.31.22, bgp metric [200/2]
Routes are now being learned via iBGP and not OSPF.
Ping and traceroute to verify.