Internet Router Redundancy Example 1

We have a topology above. I will tell about it from left to right. I have a PC. Its gateway is R0 that has 50.0.0.0/24 subnet and R0 do SNAT from fa0/1 (inside) to fa0/0 (outside). R0 has a default route to virtual address of 10.130.0.1.
R1 is VRRP master and R2 is VRRP backup. R1 and R2 has a BGP neighborship with R3, and they receives a default route from R3. R1 has a track definition to decrement VRRP priority when it losts neighborship with R3 and default route. R1 also has preemption.
R1 and R2 are announcing prefix of 50.0.0.0/24.
Now let’s have a look at the configs and some show outputs.
R0#sh run | inc some lines
version 12.4
!
interface Loopback0
ip address 172.16.0.0 255.255.255.255
!
interface FastEthernet0/0
ip address 10.130.0.2 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 10.240.0.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 10.130.0.1
!
!
ip nat pool PUBLIC 50.0.0.1 50.0.0.1 prefix-length 24
ip nat inside source static 10.240.0.10 50.0.0.1
!
R0#sh ip route | begin Gate
Gateway of last resort is 10.130.0.1 to network 0.0.0.0
172.16.0.0/32 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 2 subnets
C 10.130.0.0 is directly connected, FastEthernet0/0
C 10.240.0.0 is directly connected, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 10.130.0.1
R1#sh run
!
version 12.4
hostname R1
!
track timer ip route 1
!
track 1 ip route 0.0.0.0 0.0.0.0 reachability
delay down 0 up 5
!
interface FastEthernet0/0
ip address 10.130.0.3 255.255.255.0
duplex auto
speed auto
vrrp 1 ip 10.130.0.1
vrrp 1 preempt delay minimum 30
vrrp 1 priority 200
vrrp 1 track 1 decrement 150
!
interface FastEthernet0/1
ip address 100.0.0.1 255.255.255.248
duplex auto
speed auto
!
router bgp 65000
bgp log-neighbor-changes
neighbor 100.0.0.3 remote-as 65003
!
address-family ipv4
neighbor 100.0.0.3 activate
no auto-summary
no synchronization
network 50.0.0.0 mask 255.255.255.0
exit-address-family
!
ip route 50.0.0.0 255.255.255.0 10.130.0.2
!
R1#sh vrrp brief
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa0/0 1 200 3218 Y Master 10.130.0.3 10.130.0.1
R1#sh bgp ipv4 uni
BGP table version is 23, local router ID is 100.0.0.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
*> 0.0.0.0 100.0.0.3 0 0 65003 i
*> 50.0.0.0/24 10.130.0.2 0 32768 i
R1#sh bgp ipv4 uni summary
BGP router identifier 100.0.0.1, local AS number 65000
BGP table version is 23, main routing table version 23
2 network entries using 240 bytes of memory
2 path entries using 104 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 2) using 32 bytes of memory
BGP using 772 total bytes of memory
BGP activity 11/9 prefixes, 12/10 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
100.0.0.3 4 65003 4538 4534 23 0 0 00:55:48 1
R1#sh 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 100.0.0.3 to network 0.0.0.0
50.0.0.0/24 is subnetted, 1 subnets
S 50.0.0.0 [1/0] via 10.130.0.2
100.0.0.0/29 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
C 10.130.0.0 is directly connected, FastEthernet0/0
B* 0.0.0.0/0 [20/0] via 100.0.0.3, 00:56:14
It’s important to track the default route to change the VRRP role of R1. To change it quickly, we want to optimize the track timers. Line of “track timer ip route 1” means every 1 second to check if the related route is in the routing table or not. Some IOS versions let us configure it as msec. Under track 1 definition, we also configured “delay down 0 up 5”. It means after up event of the track, it waits 5 seconds to run the related action and immediately for down state. In our situation, R1 decrements or increments 150 VRRP 1 priority, so R1 and R2 changes their roles.
R3 knows R1 is the master. Thanks to local preference R3 prefers R1 to R2. We see that local preference is a BGP local path attribute for only R3. We used it to prefer R1 to R2 when we go to 50.0.0.0/24. We also could use weight path attribute on R3 to do it.
R2#sh run | inc some lines
!
version 12.4
!
hostname R2
!
ip cef
!
interface FastEthernet0/0
ip address 10.130.0.4 255.255.255.0
duplex auto
speed auto
vrrp 1 ip 10.130.0.1
!
interface FastEthernet0/1
ip address 100.0.0.2 255.255.255.248
duplex auto
speed auto
!
router bgp 65000
bgp log-neighbor-changes
neighbor 100.0.0.3 remote-as 65003
!
address-family ipv4
neighbor 100.0.0.3 activate
no auto-summary
no synchronization
network 50.0.0.0 mask 255.255.255.0
exit-address-family
!
ip forward-protocol nd
ip route 50.0.0.0 255.255.255.0 10.130.0.2
!
end
R2#sh vrrp brief
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa0/0 1 100 3609 Y Backup 10.130.0.3 10.130.0.1
R2#
R2#show bgp ipv4 uni
BGP table version is 3, local router ID is 100.0.0.2
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
*> 0.0.0.0 100.0.0.3 0 0 65003 i
*> 50.0.0.0/24 10.130.0.2 0 32768 i
R2#
R2#show bgp ipv4 uni summ
BGP router identifier 100.0.0.2, local AS number 65000
BGP table version is 3, main routing table version 3
2 network entries using 240 bytes of memory
2 path entries using 104 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 1) using 32 bytes of memory
BGP using 772 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
100.0.0.3 4 65003 879 878 3 0 0 00:14:34 1
R2#
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 100.0.0.3 to network 0.0.0.0
50.0.0.0/24 is subnetted, 1 subnets
S 50.0.0.0 [1/0] via 10.130.0.2
100.0.0.0/29 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
C 10.130.0.0 is directly connected, FastEthernet0/0
B* 0.0.0.0/0 [20/0] via 100.0.0.3, 00:14:51
R2#
R3#sh run
!
version 12.4
!
hostname R3
!
ip cef
!
interface Loopback0
ip address 8.8.8.8 255.255.255.255
!
interface FastEthernet0/0
ip address 100.0.0.3 255.255.255.248
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
router bgp 65003
bgp router-id 3.3.3.3
bgp log-neighbor-changes
timers bgp 1 20
neighbor 100.0.0.1 remote-as 65000
neighbor 100.0.0.1 transport connection-mode passive
neighbor 100.0.0.2 remote-as 65000
neighbor 100.0.0.2 transport connection-mode passive
!
address-family ipv4
redistribute static route-map ZERO
neighbor 100.0.0.1 activate
neighbor 100.0.0.1 default-originate
neighbor 100.0.0.1 route-map R1-IN in
neighbor 100.0.0.2 activate
neighbor 100.0.0.2 default-originate
neighbor 100.0.0.2 route-map R2-IN in
default-information originate
no auto-summary
no synchronization
exit-address-family
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 Null0
!
ip prefix-list CUSTOMER1 seq 5 permit 50.0.0.0/24
!
ip prefix-list ZERO seq 5 permit 0.0.0.0/0
!
route-map R1-OUT permit 10
match ip address prefix-list ZERO
!
route-map R1-IN permit 10
match ip address prefix-list CUSTOMER1
set local-preference 200
!
route-map R2-IN permit 10
match ip address prefix-list CUSTOMER1
set local-preference 100
!
route-map R2-OUT permit 10
match ip address prefix-list ZERO
!
end
R3#sh bgp ipv4 unicast
BGP table version is 5, local router ID is 3.3.3.3
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
*> 50.0.0.0/24 100.0.0.1 0 200 0 65000 i
* 100.0.0.2 0 100 0 65000 i
R3#sh bgp ipv4 unicast sum
R3#sh bgp ipv4 unicast summary
BGP router identifier 3.3.3.3, local AS number 65003
BGP table version is 5, main routing table version 5
1 network entries using 120 bytes of memory
2 path entries using 104 bytes of memory
4/1 BGP path/bestpath attribute entries using 496 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 2) using 32 bytes of memory
BGP using 776 total bytes of memory
BGP activity 1/0 prefixes, 4/2 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
100.0.0.1 4 65000 1062 1064 5 0 0 00:01:48 1
100.0.0.2 4 65000 1063 1066 5 0 0 00:01:50 1
R3#
R3#
R3#sh 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
50.0.0.0/24 is subnetted, 1 subnets
B 50.0.0.0 [20/0] via 100.0.0.1, 00:01:56
100.0.0.0/29 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/0
8.0.0.0/32 is subnetted, 1 subnets
C 8.8.8.8 is directly connected, Loopback0
S* 0.0.0.0/0 is directly connected, Null0
R3#
When we cut the neighbourship between R1 and R3, 5 pings times unreachable to 8.8.8.8.. Here are the logs when we cut it.
R3(config)#ip route 100.0.0.1 255.255.255.255 null 0
R3(config)#
R3(config)#
*Mar 1 00:04:54.031: %BGP-3-NOTIFICATION: received from neighbor 100.0.0.1 4/0 (hold time expired) 0 bytes
*Mar 1 00:04:54.031: %BGP-5-ADJCHANGE: neighbor 100.0.0.1 Down BGP Notification received
VPCS> ping 8.8.8.8 -c 1000
8.8.8.8 icmp_seq=1 timeout
84 bytes from 8.8.8.8 icmp_seq=2 ttl=253 time=31.105 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=253 time=23.819 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=253 time=26.460 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=253 time=22.174 ms
84 bytes from 8.8.8.8 icmp_seq=6 ttl=253 time=22.219 ms
84 bytes from 8.8.8.8 icmp_seq=7 ttl=253 time=23.258 ms
84 bytes from 8.8.8.8 icmp_seq=8 ttl=253 time=29.321 ms
84 bytes from 8.8.8.8 icmp_seq=9 ttl=253 time=33.893 ms
84 bytes from 8.8.8.8 icmp_seq=10 ttl=253 time=21.473 ms
84 bytes from 8.8.8.8 icmp_seq=11 ttl=253 time=32.470 ms
84 bytes from 8.8.8.8 icmp_seq=12 ttl=253 time=31.800 ms
84 bytes from 8.8.8.8 icmp_seq=13 ttl=253 time=29.438 ms
84 bytes from 8.8.8.8 icmp_seq=14 ttl=253 time=23.635 ms
84 bytes from 8.8.8.8 icmp_seq=15 ttl=253 time=29.520 ms
84 bytes from 8.8.8.8 icmp_seq=16 ttl=253 time=28.330 ms
84 bytes from 8.8.8.8 icmp_seq=17 ttl=253 time=23.623 ms
84 bytes from 8.8.8.8 icmp_seq=18 ttl=253 time=25.131 ms
84 bytes from 8.8.8.8 icmp_seq=19 ttl=253 time=40.100 ms
84 bytes from 8.8.8.8 icmp_seq=20 ttl=253 time=37.773 ms
84 bytes from 8.8.8.8 icmp_seq=21 ttl=253 time=48.656 ms
84 bytes from 8.8.8.8 icmp_seq=22 ttl=253 time=47.084 ms
84 bytes from 8.8.8.8 icmp_seq=23 ttl=253 time=37.209 ms
8.8.8.8 icmp_seq=24 timeout
8.8.8.8 icmp_seq=25 timeout
*10.130.0.3 icmp_seq=26 ttl=254 time=21.772 ms (ICMP type:3, code:1, Destination host unreachable)
*10.130.0.3 icmp_seq=27 ttl=254 time=21.527 ms (ICMP type:3, code:1, Destination host unreachable)
*10.130.0.3 icmp_seq=28 ttl=254 time=30.973 ms (ICMP type:3, code:1, Destination host unreachable)
84 bytes from 8.8.8.8 icmp_seq=29 ttl=253 time=41.659 ms
84 bytes from 8.8.8.8 icmp_seq=30 ttl=253 time=39.202 ms
84 bytes from 8.8.8.8 icmp_seq=31 ttl=253 time=32.339 ms
R1>
*Mar 1 00:04:55.275: %BGP-5-ADJCHANGE: neighbor 100.0.0.3 Down BGP Notification sent
*Mar 1 00:04:55.275: %BGP-3-NOTIFICATION: sent to neighbor 100.0.0.3 4/0 (hold time expired) 0 bytes
*Mar 1 00:04:56.627: %TRACKING-5-STATE: 1 ip route 0.0.0.0/0 reachability Up->Down
*Mar 1 00:04:59.943: %VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Master -> Backup
R2#
*Mar 1 00:05:00.203: %VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Backup -> Master
There is also one point that we should think is what if R1 lost local connectivity but it has BGP neighorship with R3 and it is VRRP master still. Under VRRP, unless there is a physical issue on the interface VRRP mastership doesn’t change. Actually, we would better also prefer to use a track for local reachability. Maybe it use a track as below..
track 2 ip route 10.130.0.2 255.255.255.255 reachability
!
interface FastEthernet0/0
ip address 10.130.0.3 255.255.255.0
duplex auto
speed auto
vrrp 1 ip 10.130.0.1
vrrp 1 preempt delay minimum 30
vrrp 1 priority 200
vrrp 1 track 1 decrement 150
vrrp 1 track 2 decrement 150
We mentioned that we can use weight instead of local preference before. Let’s try it. First, delete route-map lines and set the weights for R1 and R2 neighbourships. After clearing BGP, we see R1 has 500 and R2 has 400 weight.
R3(config-router)#add ipv4 uni
R3(config-router-af)#no nei 100.0.0.1 route-map R1-IN in
R3(config-router-af)#no nei 100.0.0.2 route-map R2-IN in
R3(config-router-af)#nei 100.0.0.1 weight 500
R3(config-router-af)#nei 100.0.0.2 weight 400
R3(config-router-af)#end
R3#clear bgp ipv4 uni * in
R3#sh bgp ipv4 uni
BGP table version is 6, local router ID is 3.3.3.3
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
*> 50.0.0.0/24 100.0.0.1 0 500 65000 i
* 100.0.0.2 0 400 65000 iWe will improve this topology to learn more about BGP..