The BGP setup is as follows. R1 and R2 are in AS 100, R3 is in AS200.
R1#show running-config inter loopback 1 Building configuration... Current configuration : 252 bytes ! interface Loopback1 ip address 10.10.20.1 255.255.255.0 secondary ip address 10.10.30.1 255.255.255.0 secondary ip address 10.10.40.1 255.255.255.0 secondary ip address 10.10.50.1 255.255.255.0 secondary ip address 10.10.10.1 255.255.255.0 endThe 5 networks are announced in BGP with the help of the "network" command.
R1#show running-config | section bgp router bgp 100 no synchronization bgp log-neighbor-changes network 10.10.10.0 mask 255.255.255.0 network 10.10.20.0 mask 255.255.255.0 network 10.10.30.0 mask 255.255.255.0 network 10.10.40.0 mask 255.255.255.0 network 10.10.50.0 mask 255.255.255.0 neighbor 192.168.100.2 remote-as 100 no auto-summaryR3 announces just on network.
R3#show running-config inter loopback 0 Building configuration... Current configuration : 66 bytes ! interface Loopback0 ip address 172.17.0.3 255.255.255.255 end R3#show running-config | section bgp router bgp 200 no synchronization bgp log-neighbor-changes network 20.20.20.0 mask 255.255.255.0 neighbor 192.168.100.5 remote-as 100 no auto-summary R3#The BGP tables of the 3 routers look now like this:
R1#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 10.10.10.0/24 0.0.0.0 0 32768 i *> 10.10.20.0/24 0.0.0.0 0 32768 i *> 10.10.30.0/24 0.0.0.0 0 32768 i *> 10.10.40.0/24 0.0.0.0 0 32768 i *> 10.10.50.0/24 0.0.0.0 0 32768 i *>i20.20.20.0/24 192.168.100.2 0 100 0 200 i R2#show ip bgp Network Next Hop Metric LocPrf Weight Path *>i10.10.10.0/24 192.168.100.1 0 100 0 i *>i10.10.20.0/24 192.168.100.1 0 100 0 i *>i10.10.30.0/24 192.168.100.1 0 100 0 i *>i10.10.40.0/24 192.168.100.1 0 100 0 i *>i10.10.50.0/24 192.168.100.1 0 100 0 i *> 20.20.20.0/24 192.168.100.6 0 0 200 i R3#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 10.10.10.0/24 192.168.100.5 0 100 i *> 10.10.20.0/24 192.168.100.5 0 100 i *> 10.10.30.0/24 192.168.100.5 0 100 i *> 10.10.40.0/24 192.168.100.5 0 100 i *> 10.10.50.0/24 192.168.100.5 0 100 i *> 20.20.20.0/24 0.0.0.0 0 32768 iR2 now aggregates the routes from network 10.10.0.0 into one route 10.0.0.0/8. The component routes on R2 are now marked as suppressed. R3 does only see the aggregated route. The aggregated routes is also in the BGP table of R1.
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router bgp R2(config)#router bgp 100 R2(config-router)#aggregate-address 10.0.0.0 255.0.0.0 summary-only R2(config-router)#endThe BGP tables of the 3 routers look now like this:
R1#show ip bgp Network Next Hop Metric LocPrf Weight Path *>i10.0.0.0 192.168.100.2 0 100 0 i *> 10.10.10.0/24 0.0.0.0 0 32768 i *> 10.10.20.0/24 0.0.0.0 0 32768 i *> 10.10.30.0/24 0.0.0.0 0 32768 i *> 10.10.40.0/24 0.0.0.0 0 32768 i *> 10.10.50.0/24 0.0.0.0 0 32768 i *>i20.20.20.0/24 192.168.100.2 0 100 0 200 i R2#show ip bgp BGP table version is 54, local router ID is 172.17.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 *> 10.0.0.0 0.0.0.0 32768 i s>i10.10.10.0/24 192.168.100.1 0 100 0 i s>i10.10.20.0/24 192.168.100.1 0 100 0 i s>i10.10.30.0/24 192.168.100.1 0 100 0 i s>i10.10.40.0/24 192.168.100.1 0 100 0 i s>i10.10.50.0/24 192.168.100.1 0 100 0 i *> 20.20.20.0/24 192.168.100.6 0 0 200 i R3#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 10.0.0.0 192.168.100.5 0 0 100 i *> 20.20.20.0/24 0.0.0.0 0 32768 iThe component routes com from R1, so it makes no sense to see the 10.0.0.0/8 here. Let's filter it out.
R2#conf term R2(config)#ip prefix-list INTERNAL seq 5 deny 10.0.0.0/8 R2(config)#ip prefix-list INTERNAL seq 10 permit 0.0.0.0/0 le 32 R2(config)#router bgp 100 R2(config-router)#neighbor 192.168.100.1 prefix-list INTERNAL out R2(config-router)#end R2#clear ip bgp 192.168.100.1 soft out R2# R1#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 10.10.10.0/24 0.0.0.0 0 32768 i *> 10.10.20.0/24 0.0.0.0 0 32768 i *> 10.10.30.0/24 0.0.0.0 0 32768 i *> 10.10.40.0/24 0.0.0.0 0 32768 i *> 10.10.50.0/24 0.0.0.0 0 32768 i *>i20.20.20.0/24 192.168.100.2 0 100 0 200 iThe prefix 10.0.0.0/8 is gone from the BGP table of R1.
As final configuration 2 of the 5 suppressed routes in direction of R3 are unsuppressed.
For this a route map as unsuppress-map is needed.
R2#conf term R2(config)#ip prefix-list UNSUP seq 5 permit 10.10.20.0/24 R2(config)#ip prefix-list UNSUP seq 10 permit 10.10.40.0/24 R2(config)#route-map UNSUP permit 10 R2(config-route-map)# match ip address prefix-list UNSUP R2(config-route-map)#exit R2(config)#router bgp 100 R2(config-router)#neighbor 192.168.100.6 unsuppress-map UNSUP R2(config-router)#end R2#clear ip bgp 192.168.100.6 soft out R2# R3#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 10.0.0.0 192.168.100.5 0 0 100 i *> 10.10.20.0/24 192.168.100.5 0 100 i *> 10.10.40.0/24 192.168.100.5 0 100 i *> 20.20.20.0/24 0.0.0.0 0 32768 iThe 2 prefixes are now in the BGP table in addition to the aggregated route.
No comments:
Post a Comment