This lab is designed by my friend – Andrey – whom I met in Cisco Learning network. Thank you Andrey 😀
Start-up objective:
1. R1 – R4 run OSPF
2. R1, R4, and R5 run BGP.
3. R5 sends its full BGP table to the AS 2 routers
4. The both R1 and R4 send AS 2 networks to R5
Actual Objective:
1. Configure full connectivity between the routers and any network connected to R5 without BGP
to OSPF redistribution.
2. Make R1-R5 path preferred to the both inbound and outbound traffic while using secondary R4-
R5 link if primary link fails.
Here are the configuration from R1 to R5:
R1#sh run | section router ospf 1
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 192.168.1.1 0.0.0.0 area 0
default-information originate metric 10
R1#sh run | s ip route
ip route 0.0.0.0 0.0.0.0 218.186.20.5 100
R1#sh run | section route-map r5-reachability
ip local policy route-map r5-reachability
route-map r5-reachability permit 10
set ip next-hop verify-availability 218.186.20.5 10 track 1
set ip next-hop 4.4.4.4
route-map r5-reachability permit 20
set metric 200
R1#sh run | section ip sla
ip sla monitor 1
type echo protocol ipIcmpEcho 218.186.20.5
frequency 5
ip sla monitor schedule 1 life forever start-time now
R1#sh run | section bgp 2
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 2
neighbor 4.4.4.4 update-source Loopback1
neighbor 4.4.4.4 next-hop-self
neighbor 218.186.20.5 remote-as 1
no auto-summary
R1#sh run | section inter
interface Loopback1
ip address 1.1.1.1 255.255.255.255
interface FastEthernet0/0
description Connection to R5
ip address 218.186.20.1 255.255.255.248
duplex auto
speed auto
interface FastEthernet0/1
description Connection to R2
ip address 192.168.1.1 255.255.255.0
ip ospf network point-to-point
duplex auto
speed auto
R2#sh run | section int
interface Loopback2
ip address 2.2.2.2 255.255.255.255
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
ip ospf network point-to-point
duplex auto
speed auto
interface FastEthernet0/1
ip address 192.168.1.2 255.255.255.0
ip ospf network point-to-point
duplex auto
speed auto
R2#sh run | s router ospf 1
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 192.168.1.2 0.0.0.0 area 0
network 192.168.2.2 0.0.0.0 area 0
R3#sh run | s inter
interface Loopback3
ip address 3.3.3.3 255.255.255.255
interface FastEthernet0/0
description Connection to R2
ip address 192.168.3.3 255.255.255.0
ip ospf network point-to-point
duplex auto
speed auto
interface FastEthernet0/1
description Connection to R4
ip address 192.168.2.3 255.255.255.0
ip ospf network point-to-point
duplex auto
speed auto
R3#sh run | s router ospf 1
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 192.168.2.3 0.0.0.0 area 0
network 192.168.3.3 0.0.0.0 area 0
R4#sh run | s inter
interface Loopback4
ip address 4.4.4.4 255.255.255.255
interface FastEthernet0/0
description Connection to R3
ip address 192.168.3.4 255.255.255.0
ip ospf network point-to-point
duplex auto
speed auto
interface FastEthernet0/1
description Connection to R5
ip address 218.186.20.12 255.255.255.248
duplex auto
speed auto
R4#sh run | s router ospf 1
router ospf 1
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 192.168.3.4 0.0.0.0 area 0
default-information originate metric 100
R4#sh run | s ip route
ip route 0.0.0.0 0.0.0.0 218.186.20.13 150
R4#sh run | s router bgp 2
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 2
neighbor 1.1.1.1 update-source Loopback4
neighbor 1.1.1.1 next-hop-self
neighbor 218.186.20.13 remote-as 1
no auto-summary
R5#sh run | s inter
interface Loopback1
ip address 200.1.1.1 255.255.255.240
interface Loopback2
ip address 200.1.1.17 255.255.255.240
interface Loopback3
ip address 200.1.1.33 255.255.255.240
interface FastEthernet0/0
description Connection to R1
ip address 218.186.20.5 255.255.255.248
duplex auto
speed auto
interface FastEthernet0/1
description Connection to R4
ip address 218.186.20.13 255.255.255.248
duplex auto
speed auto
R5#sh run | s router bgp 1
router bgp 1
no synchronization
bgp log-neighbor-changes
network 200.1.1.0 mask 255.255.255.240
network 200.1.1.16 mask 255.255.255.240
network 200.1.1.32 mask 255.255.255.240
neighbor 218.186.20.1 remote-as 2
neighbor 218.186.20.12 remote-as 2
no auto-summary
R5#sh run | s ip route
ip route 0.0.0.0 0.0.0.0 218.186.20.1
ip route 0.0.0.0 0.0.0.0 218.186.20.12 10
Verification:
Under normal circumstances the link between R1 and R5 should be used for inbound and outbound traffic.
R5#sh ip route
218.186.20.0/29 is subnetted, 2 subnets
C 218.186.20.0 is directly connected, FastEthernet0/0
C 218.186.20.8 is directly connected, FastEthernet0/1
200.1.1.0/28 is subnetted, 3 subnets
C 200.1.1.0 is directly connected, Loopback1
C 200.1.1.16 is directly connected, Loopback2
C 200.1.1.32 is directly connected, Loopback3
S* 0.0.0.0/0 [1/0] via 218.186.20.1
The static default route to R1 is the only route injected into the routing table of R5.
R5#traceroute 192.168.2.3
Type escape sequence to abort.
Tracing the route to 192.168.2.3
1 218.186.20.1 0 msec 4 msec 0 msec
2 192.168.1.2 4 msec 0 msec 0 msec
3 192.168.2.3 4 msec * 0 msec
R1#sh ip bgp
BGP table version is 17, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*> 200.1.1.0/28 218.186.20.5 0 100 1 i
* i 4.4.4.4 0 100 0 1 i
*> 200.1.1.16/28 218.186.20.5 0 100 1 i
* i 4.4.4.4 0 100 0 1 i
*> 200.1.1.32/28 218.186.20.5 0 100 1 i
* i 4.4.4.4 0 100 0 1 i
The preferred route would be via R5 to reach the connected routes of R5.
R3#sh ip route
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/3] via 192.168.2.2, 01:02:11, FastEthernet0/1
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 192.168.2.2, 01:02:11, FastEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback3
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 192.168.3.4, 01:02:11, FastEthernet0/0
O 192.168.1.0/24 [110/2] via 192.168.2.2, 01:02:11, FastEthernet0/1
C 192.168.2.0/24 is directly connected, FastEthernet0/1
C 192.168.3.0/24 is directly connected, FastEthernet0/0
O*E2 0.0.0.0/0 [110/10] via 192.168.2.2, 00:19:54, FastEthernet0/1
R3 takes the route via 192.168.2.2 instead of 192.168.3.4
R3#traceroute 200.1.1.1
Type escape sequence to abort.
Tracing the route to 200.1.1.1
1 192.168.2.2 4 msec 4 msec 0 msec
2 192.168.1.1 4 msec 0 msec 4 msec
3 218.186.20.5 4 msec * 0 msec
The route cross from R2 to R1 then to R5.
R4#sh ip bgp
BGP table version is 10, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
* i200.1.1.0/28 1.1.1.1 0 100 0 1 i
*> 218.186.20.13 0 0 1 i
* i200.1.1.16/28 1.1.1.1 0 100 0 1 i
*> 218.186.20.13 0 0 1 i
* i200.1.1.32/28 1.1.1.1 0 100 0 1 i
*> 218.186.20.13 0 0 1 i
R4 is a direct peer to BGP I could not think out of the box now lol….I should use 1.1.1.1 instead….based on objective. Help!
Shut down interface fa0/0 of R1
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#shut
R1(config-if)#
*Mar 2 21:21:23.054: %BGP-5-ADJCHANGE: neighbor 218.186.20.5 Down Interface flap
R1(config-if)#
*Mar 2 21:21:25.049: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Mar 2 21:21:26.051: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R1#sh ip bgp
BGP table version is 20, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*>i200.1.1.0/28 4.4.4.4 0 100 0 1 i
*>i200.1.1.16/28 4.4.4.4 0 100 0 1 i
*>i200.1.1.32/28 4.4.4.4 0 100 0 1 i
The next hop changes to R4
R1#traceroute 200.1.1.1
Type escape sequence to abort.
Tracing the route to 200.1.1.1
1 192.168.1.2 0 msec 0 msec 4 msec
2 192.168.2.3 0 msec 0 msec 4 msec
3 192.168.3.4 0 msec 0 msec 4 msec
4 218.186.20.13 4 msec * 0 msec
R1#
R2#sh ip route supernets-only
Gateway of last resort is 192.168.2.3 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/100] via 192.168.2.3, 00:02:20, FastEthernet0/0
Route changes, R2 knows how to reach external network via R3.
R2#traceroute 200.1.1.1
Type escape sequence to abort.
Tracing the route to 200.1.1.1
1 192.168.2.3 0 msec 0 msec 4 msec
2 192.168.3.4 0 msec 4 msec 0 msec
3 218.186.20.13 0 msec * 0 msec
R2#
Packet from R2 to R3 then to R4 and finally to R5
R3#sh ip route supernets-only
Gateway of last resort is 192.168.3.4 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/100] via 192.168.3.4, 00:04:01, FastEthernet0/0
R3 knows how to reach external network via R4.
R3#traceroute 200.1.1.1
Type escape sequence to abort.
Tracing the route to 200.1.1.1
1 192.168.3.4 4 msec 0 msec 0 msec
2 218.186.20.13 4 msec * 0 msec
R3#
R4#sh ip bgp
BGP table version is 10, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*> 200.1.1.0/28 218.186.20.13 0 0 1 i
*> 200.1.1.16/28 218.186.20.13 0 0 1 i
*> 200.1.1.32/28 218.186.20.13 0 0 1 i
iBGP alternate valid route removed.
R5#sh ip route supernets-only
Gateway of last resort is 218.186.20.12 to network 0.0.0.0
S* 0.0.0.0/0 [10/0] via 218.186.20.12
R1 route was removed and R4 route inserted into the routing table.