This is another post about BGP Weight Attributes.
|
Objective:
1. Established EBGP peering using two methods.
2. Implement a policy for so that all networks on R4 will take the path via R3.
|
|
R1#sh run | sec bgp
router bgp 1 bgp log-neighbor-changes network 100.100.100.100 mask 255.255.255.255 neighbor 2.2.2.2 remote-as 2 <<<< Method # 1 to create BGP peering neighbor 2.2.2.2 ebgp-multihop 10 neighbor 2.2.2.2 update-source Loopback0 neighbor 192.168.13.3 remote-as 2 <<< Method # 2 to create BGP peering |
Static Route in R1 and R2:
|
R1#sh run | inc ip route
ip route 2.2.2.2 255.255.255.255 192.168.12.2 R2#sh run | inc ip route
ip route 1.1.1.1 255.255.255.255 192.168.12.1 |
|
R2#sh run | sec ospf
router ospf 1 network 2.2.2.2 0.0.0.0 area 0 network 192.168.24.0 0.0.0.255 area 0 |
|
R2#sh run | sec bgp
router bgp 2 bgp log-neighbor-changes network 192.168.12.0 neighbor 1.1.1.1 remote-as 1 <<< Method # 1 to create BGP peering neighbor 1.1.1.1 ebgp-multihop 10 neighbor 1.1.1.1 update-source Loopback0 neighbor 3.3.3.3 remote-as 2 neighbor 3.3.3.3 update-source Loopback0 neighbor 4.4.4.4 remote-as 2 neighbor 4.4.4.4 update-source Loopback0 neighbor 4.4.4.4 next-hop-self |
|
R3#sh run | sec ospf
router ospf 1 network 3.3.3.3 0.0.0.0 area 0 network 192.168.34.0 0.0.0.255 area 0 |
|
R3#sh run | sec bgp
router bgp 2 bgp log-neighbor-changes neighbor 2.2.2.2 remote-as 2 neighbor 2.2.2.2 update-source Loopback0 neighbor 4.4.4.4 remote-as 2 neighbor 4.4.4.4 update-source Loopback0 neighbor 4.4.4.4 next-hop-self neighbor 192.168.13.1 remote-as 1 |
|
R4#sh run | sec ospf
router ospf 1 network 4.4.4.4 0.0.0.0 area 0 network 192.168.24.0 0.0.0.255 area 0 network 192.168.34.0 0.0.0.255 area 0 |
|
R4#sh run | sec bgp
router bgp 2 bgp log-neighbor-changes network 11.11.11.11 mask 255.255.255.255 network 22.22.22.22 mask 255.255.255.255 network 33.33.33.33 mask 255.255.255.255 network 44.44.44.44 mask 255.255.255.255 neighbor 2.2.2.2 remote-as 2 neighbor 2.2.2.2 update-source Loopback0 neighbor 3.3.3.3 remote-as 2 neighbor 3.3.3.3 update-source Loopback0 |
|
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface 44.44.44.44 0 FULL/ – 00:00:36 192.168.24.4 Serial3/2 R3# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface 44.44.44.44 0 FULL/ – 00:00:32 192.168.34.4 Serial3/3 R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface 3.3.3.3 0 FULL/ – 00:00:38 192.168.34.3 Serial3/3 2.2.2.2 0 FULL/ – 00:00:32 192.168.24.2 Serial3/2 |
|
R1#sh ip bgp summary
BGP router identifier 100.100.100.100, local AS number 1 BGP table version is 6, main routing table version 6 5 network entries using 720 bytes of memory 5 path entries using 400 bytes of memory 2/2 BGP path/bestpath attribute entries using 272 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 1416 total bytes of memory BGP activity 5/0 prefixes, 5/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd R2#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 2 BGP table version is 7, main routing table version 7 6 network entries using 864 bytes of memory 7 path entries using 560 bytes of memory 4/3 BGP path/bestpath attribute entries using 544 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 1992 total bytes of memory BGP activity 6/0 prefixes, 7/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd R3#show ip bgp summary
BGP router identifier 3.3.3.3, local AS number 2 BGP table version is 7, main routing table version 7 6 network entries using 864 bytes of memory 7 path entries using 560 bytes of memory 3/2 BGP path/bestpath attribute entries using 408 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 1856 total bytes of memory BGP activity 6/0 prefixes, 7/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd R4#show ip bgp summary
BGP router identifier 44.44.44.44, local AS number 2 BGP table version is 8, main routing table version 8 6 network entries using 864 bytes of memory 7 path entries using 560 bytes of memory 3/3 BGP path/bestpath attribute entries using 408 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 1856 total bytes of memory BGP activity 6/0 prefixes, 7/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
|
R1#sh ip bgp
BGP table version is 6, local router ID is 100.100.100.100 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, Origin codes: i – IGP, e – EGP, ? – incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path R2#sh ip bgp
BGP table version is 9, 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, Origin codes: i – IGP, e – EGP, ? – incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path R3#show ip bgp
BGP table version is 9, 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, Origin codes: i – IGP, e – EGP, ? – incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path R4#show ip bgp
BGP table version is 11, local router ID is 44.44.44.44 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, Origin codes: i – IGP, e – EGP, ? – incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path |
|
R1#show ip route bgp
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 + – replicated route, % – next hop override Gateway of last resort is not set 11.0.0.0/32 is subnetted, 1 subnets ** As observed, the paths towards R4 network is via R2.
|
|
R1(config)#route-map SET-WEIGHT-R3 permit 10
R1(config-route-map)#set weigh R1(config-route-map)#set weight 500 R1(config-route-map)#match ip address 1 ** I have increased the weight to 500 ..the default weight is 0. By setting the weight to higher value than 0, then it will prefer the path with higher weight attribute”
|
|
R1(config)#access-list 1 permit 11.11.11.11 0.0.0.0
R1(config)#access-list 1 permit 22.22.22.22 0.0.0.0 R1(config)#access-list 1 permit 33.33.33.33 0.0.0.0 R1(config)#access-list 1 permit 44.44.44.44 0.0.0.0 |
|
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.13.3 route-map SET-WEIGHT-R3 in |
|
R1#clear ip bgp *
R1# *Sep 21 22:38:43.363: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down User reset *Sep 21 22:38:43.363: %BGP_SESSION-5-ADJCHANGE: neighbor 2.2.2.2 IPv4 Unicast topology base removed from session User reset *Sep 21 22:38:43.371: %BGP-5-ADJCHANGE: neighbor 192.168.13.3 Down User reset *Sep 21 22:38:43.375: %BGP_SESSION-5-ADJCHANGE: neighbor 192.168.13.3 IPv4 Unicast topology base removed from session User reset *Sep 21 22:38:43.871: %BGP-5-ADJCHANGE: neighbor 192.168.13.3 Up *Sep 21 22:38:43.875: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up R1#sh ip bgp
BGP table version is 7, local router ID is 100.100.100.100 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, Origin codes: i – IGP, e – EGP, ? – incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path *** As observed, we can see that the best path have changed to R3.****
|
Leave a comment