@Ronnie-Wong Ya, not sure what you were hinting at there, sorry. Still trying to wrap my head around BGP, it is a lot different than OSPF which I've worked with in the field. In the screenshots above R1 and R3 are not peered with R4 at all, simply because neither of them had a route to the 172.16.24.0/24 network, I didn't even issue peering commands for those routers until I figured out how to deal with that. Was planning to peer each with 172.16.24.4.
I did get everything talking, however I don't think it is how you accomplished the 4 router setup in your demonstration. Basically I used R2 to passively inject the 172.16.24.0/24 route into the OSPF process. Once R1 and R3 knew how to get to 172.16.24.4, I was able to create peering relationships between R4 and R1/R3. Had to leverage the ebgp-multihop
command. Current config status of my lab at the end of this post for reference.
One snag I ran into after all peering was online was on R1 attempting to issue the ssh 4.4.4.4
command just to get the CLI of R4. Turned out that R1 was using the default Gi0/0 interface IP to get there and R4 didn't have a route for 10.0.12.0/24. I used BGP on R2 to advertise it and I could then SSH to R4.
BGP is so strange, if you look at the R3 show bgp
output after I used R2 to inject 10.0.12.0/24 into the BGP process, it has an r>i
entry and a next hop of 2.2.2.2. A router that couldn't possible serve as a next hop for R3 to that network. It didn't make it into the routing table because of rib failure and it serves R4 okay. Just strange. Don't really understand it yet. OSPF always would propagate the next hop IP correctly. It seems that BGP has the ability to hand out bad next hops all over the place.
R4 has three entries for 10.0.12.0/24 in it's show bgp
output. It selected valid best for 172.16.24.2, I guess because that is the only one that would work? How did it know not to select one of the routes with a bad next hop?
R4 show bgp snippet:
* 10.0.12.0/24 3.3.3.3 0 65123 i <R4 not directly connected to this router.
* 1.1.1.1 0 65123 i <R4 not directly connected to this router.
*> 172.16.24.2 0 0 65123 i <How did R4 know to select this one?
R1#show ip int br
Interface IP-Address OK? Method Status Protocol
Embedded-Service-Engine0/0 unassigned YES NVRAM administratively down down
GigabitEthernet0/0 10.0.12.1 YES NVRAM up up
GigabitEthernet0/1 10.0.13.1 YES NVRAM up up
GigabitEthernet0/2 unassigned YES NVRAM administratively down down
Serial0/0/0 unassigned YES NVRAM administratively down down
Serial0/1/0 unassigned YES NVRAM administratively down down
Loopback0 1.1.1.1 YES NVRAM up up
R1#!
R1#show run | s ospf
router ospf 1
router-id 1.1.1.1
auto-cost reference-bandwidth 40000
network 1.1.1.1 0.0.0.0 area 0
network 10.0.12.0 0.0.0.255 area 0
network 10.0.13.0 0.0.0.255 area 0
R1#!
R1#show run | s bgp
router bgp 65123
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
neighbor 2.2.2.2 remote-as 65123
neighbor 2.2.2.2 update-source Loopback0
neighbor 3.3.3.3 remote-as 65123
neighbor 3.3.3.3 update-source Loopback0
neighbor 172.16.24.4 remote-as 65004
neighbor 172.16.24.4 ebgp-multihop 2
neighbor 172.16.24.4 update-source Loopback0
R1#!
R1#show bgp
BGP table version is 7, 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, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
r>i 2.2.2.2/32 2.2.2.2 0 100 0 i
r>i 3.3.3.3/32 3.3.3.3 0 100 0 i
* i 4.4.4.4/32 172.16.24.4 0 100 0 65004 i
*> 172.16.24.4 0 0 65004 i
* i 172.16.24.4 0 100 0 65004 i
r>i 10.0.12.0/24 2.2.2.2 0 100 0 i
R1#!
R1#show bgp sum
BGP router identifier 1.1.1.1, local AS number 65123
BGP table version is 7, main routing table version 7
5 network entries using 720 bytes of memory
7 path entries using 616 bytes of memory
4/3 BGP path/bestpath attribute entries using 640 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
BGP using 2000 total bytes of memory
BGP activity 11/6 prefixes, 44/37 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2.2.2.2 4 65123 24 23 7 0 0 00:17:21 3
3.3.3.3 4 65123 23 23 7 0 0 00:17:15 2
172.16.24.4 4 65004 28 26 7 0 0 00:16:11 1
R1#!
R1#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/41] via 10.0.12.2, 01:17:29, GigabitEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/41] via 10.0.13.3, 01:17:29, GigabitEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 172.16.24.4, 00:16:13
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.0.12.0/24 is directly connected, GigabitEthernet0/0
L 10.0.12.1/32 is directly connected, GigabitEthernet0/0
C 10.0.13.0/24 is directly connected, GigabitEthernet0/1
L 10.0.13.1/32 is directly connected, GigabitEthernet0/1
172.16.0.0/24 is subnetted, 1 subnets
O 172.16.24.0 [110/80] via 10.0.12.2, 00:46:24, GigabitEthernet0/0
R2#show ip int br
Interface IP-Address OK? Method Status Protocol
Embedded-Service-Engine0/0 unassigned YES NVRAM administratively down down
GigabitEthernet0/0 10.0.12.2 YES NVRAM up up
GigabitEthernet0/1 172.16.24.2 YES NVRAM up up
GigabitEthernet0/2 unassigned YES NVRAM administratively down down
Serial0/0/0 unassigned YES NVRAM administratively down down
Loopback0 2.2.2.2 YES NVRAM up up
R2#!
R2#show run | s ospf
router ospf 1
router-id 2.2.2.2
auto-cost reference-bandwidth 40000
passive-interface GigabitEthernet0/1
network 2.2.2.0 0.0.0.255 area 0
network 10.0.12.0 0.0.0.255 area 0
network 172.16.24.0 0.0.0.255 area 0
R2#!
R2#show run | s bgp
router bgp 65123
bgp log-neighbor-changes
network 2.2.2.2 mask 255.255.255.255
network 10.0.12.0 mask 255.255.255.0
network 10.0.13.0 mask 255.255.255.0
neighbor 1.1.1.1 remote-as 65123
neighbor 1.1.1.1 update-source Loopback0
neighbor 3.3.3.3 remote-as 65123
neighbor 3.3.3.3 update-source Loopback0
neighbor 172.16.24.4 remote-as 65004
neighbor 172.16.24.4 update-source GigabitEthernet0/1
R2#!
R2#show bgp
BGP table version is 7, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
r>i 1.1.1.1/32 1.1.1.1 0 100 0 i
*> 2.2.2.2/32 0.0.0.0 0 32768 i
r>i 3.3.3.3/32 3.3.3.3 0 100 0 i
* i 4.4.4.4/32 172.16.24.4 0 100 0 65004 i
* i 172.16.24.4 0 100 0 65004 i
*> 172.16.24.4 0 0 65004 i
*> 10.0.12.0/24 0.0.0.0 0 32768 i
*> 10.0.13.0/24 10.0.12.1 80 32768 i
R2#!
R2#show bgp sum
BGP router identifier 2.2.2.2, local AS number 65123
BGP table version is 7, main routing table version 7
6 network entries using 864 bytes of memory
8 path entries using 704 bytes of memory
5/4 BGP path/bestpath attribute entries using 800 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
BGP using 2392 total bytes of memory
BGP activity 12/6 prefixes, 44/36 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 65123 23 25 7 0 0 00:17:36 2
3.3.3.3 4 65123 23 24 7 0 0 00:17:24 2
172.16.24.4 4 65004 28 25 7 0 0 00:17:36 1
R2#!
R2#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/41] via 10.0.12.1, 01:17:38, GigabitEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/81] via 10.0.12.1, 01:17:38, GigabitEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 172.16.24.4, 00:16:32
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.0.12.0/24 is directly connected, GigabitEthernet0/0
L 10.0.12.2/32 is directly connected, GigabitEthernet0/0
O 10.0.13.0/24 [110/80] via 10.0.12.1, 01:17:38, GigabitEthernet0/0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.24.0/24 is directly connected, GigabitEthernet0/1
L 172.16.24.2/32 is directly connected, GigabitEthernet0/1
R3#show ip int br
Interface IP-Address OK? Method Status Protocol
Embedded-Service-Engine0/0 unassigned YES NVRAM administratively down down
GigabitEthernet0/0 10.0.13.3 YES NVRAM up up
GigabitEthernet0/1 192.168.35.3 YES NVRAM down down
GigabitEthernet0/2 unassigned YES NVRAM administratively down down
Serial0/0/0 unassigned YES NVRAM administratively down down
Serial0/1/0 unassigned YES NVRAM administratively down down
Loopback0 3.3.3.3 YES NVRAM up up
R3#!
R3#show run | s ospf
router ospf 1
router-id 3.3.3.3
auto-cost reference-bandwidth 40000
network 3.3.3.3 0.0.0.0 area 0
network 10.0.13.0 0.0.0.255 area 0
R3#!
R3#show run | s bgp
router bgp 65123
bgp log-neighbor-changes
network 3.3.3.3 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 65123
neighbor 1.1.1.1 update-source Loopback0
neighbor 2.2.2.2 remote-as 65123
neighbor 2.2.2.2 update-source Loopback0
neighbor 172.16.24.4 remote-as 65004
neighbor 172.16.24.4 ebgp-multihop 3
neighbor 172.16.24.4 update-source Loopback0
R3#!
R3#show bgp
BGP table version is 8, 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, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
r>i 1.1.1.1/32 1.1.1.1 0 100 0 i
r>i 2.2.2.2/32 2.2.2.2 0 100 0 i
*> 3.3.3.3/32 0.0.0.0 0 32768 i
*> 4.4.4.4/32 172.16.24.4 0 0 65004 i
* i 172.16.24.4 0 100 0 65004 i
* i 172.16.24.4 0 100 0 65004 i
r>i 10.0.12.0/24 2.2.2.2 0 100 0 i
r>i 10.0.13.0/24 10.0.12.1 80 100 0 i
R3#!
R3#show bgp sum
BGP router identifier 3.3.3.3, local AS number 65123
BGP table version is 8, main routing table version 8
6 network entries using 864 bytes of memory
8 path entries using 704 bytes of memory
5/4 BGP path/bestpath attribute entries using 800 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
BGP using 2392 total bytes of memory
BGP activity 11/5 prefixes, 33/25 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 65123 24 24 8 0 0 00:17:53 2
2.2.2.2 4 65123 24 24 8 0 0 00:17:47 4
172.16.24.4 4 65004 28 26 8 0 0 00:16:24 1
R3#!
R3#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/41] via 10.0.13.1, 01:17:57, GigabitEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/81] via 10.0.13.1, 01:17:57, GigabitEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 172.16.24.4, 00:16:24
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 10.0.12.0/24 [110/80] via 10.0.13.1, 01:17:57, GigabitEthernet0/0
C 10.0.13.0/24 is directly connected, GigabitEthernet0/0
L 10.0.13.3/32 is directly connected, GigabitEthernet0/0
172.16.0.0/24 is subnetted, 1 subnets
O 172.16.24.0 [110/120] via 10.0.13.1, 00:45:44, GigabitEthernet0/0
R4#show ip int br
Interface IP-Address OK? Method Status Protocol
Embedded-Service-Engine0/0 unassigned YES NVRAM administratively down down
GigabitEthernet0/0 172.16.24.4 YES NVRAM up up
GigabitEthernet0/1 unassigned YES NVRAM administratively down down
GigabitEthernet0/2 unassigned YES NVRAM administratively down down
Loopback0 4.4.4.4 YES NVRAM up up
R4#!
R4#show run | s ospf
R4#!
R4#show run | s bgp
router bgp 65004
bgp log-neighbor-changes
network 4.4.4.4 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 65123
neighbor 1.1.1.1 ebgp-multihop 2
neighbor 1.1.1.1 update-source GigabitEthernet0/0
neighbor 3.3.3.3 remote-as 65123
neighbor 3.3.3.3 ebgp-multihop 3
neighbor 3.3.3.3 update-source GigabitEthernet0/0
neighbor 172.16.24.2 remote-as 65123
neighbor 172.16.24.2 update-source GigabitEthernet0/0
R4#!
R4#show bgp
BGP table version is 17, 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, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
* 1.1.1.1/32 3.3.3.3 0 65123 i
* 1.1.1.1 0 0 65123 i
*> 172.16.24.2 0 65123 i
* 2.2.2.2/32 3.3.3.3 0 65123 i
* 1.1.1.1 0 65123 i
*> 172.16.24.2 0 0 65123 i
* 3.3.3.3/32 1.1.1.1 0 65123 i
* 3.3.3.3 0 0 65123 i
*> 172.16.24.2 0 65123 i
*> 4.4.4.4/32 0.0.0.0 0 32768 i
* 10.0.12.0/24 3.3.3.3 0 65123 i
* 1.1.1.1 0 65123 i
*> 172.16.24.2 0 0 65123 i
*> 10.0.13.0/24 3.3.3.3 0 65123 i
* 172.16.24.2 80 0 65123 i
------------------------------
R4#!
R4#show bgp sum
BGP router identifier 4.4.4.4, local AS number 65004
BGP table version is 17, main routing table version 17
6 network entries using 864 bytes of memory
15 path entries using 1320 bytes of memory
4/3 BGP path/bestpath attribute entries using 640 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
BGP using 2848 total bytes of memory
BGP activity 13/7 prefixes, 79/64 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 65123 27 29 17 0 0 00:17:13 4
3.3.3.3 4 65123 27 28 17 0 0 00:16:46 5
172.16.24.2 4 65123 26 29 17 0 0 00:18:22 5
R4#!
R4#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [20/0] via 172.16.24.2, 00:17:18
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 172.16.24.2, 00:17:18
3.0.0.0/32 is subnetted, 1 subnets
B 3.3.3.3 [20/0] via 172.16.24.2, 00:16:47
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 2 subnets
B 10.0.12.0 [20/0] via 172.16.24.2, 00:06:05
B 10.0.13.0 [20/0] via 3.3.3.3, 00:02:51
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.24.0/24 is directly connected, GigabitEthernet0/0
L 172.16.24.4/32 is directly connected, GigabitEthernet0/0