BGP Route Advertisement via Route Map is essential when controlling the BGP Routes and preventing Loops across administrative domains. Errors while configuring Route Map need to be understood by all network administrators to have better traction of BGP route advertisement and its impact.
Below is one such scenario wherein wrong name in configured in BGP while advertising to neighbour via Route Map.Router R1 and R2 connected to each other directly and forming eBGP neighborship to each other .R1 is advertising 2 Loopbacks (1.1.1.0/2 and 1.1.2.0/24) while R2 is advertising 1 Loopback (2.2.2.0/24).
(R1 Configuration)
ip address 1.1.1.1 255.255.255.0
!
interface Loopback2
ip address 1.1.2.1 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
!
router bgp 1
no synchronization
network 1.1.1.0 mask 255.255.255.0
network 1.1.2.0 mask 255.255.255.0
network 192.168.12.0
neighbor 192.168.12.2 remote-as 2
neighbor 192.168.12.2 soft-reconfiguration inbound
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
!
router bgp 2
no synchronization
network 2.2.2.0 mask 255.255.255.0
network 192.168.12.0
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.1 soft-reconfiguration inbound
BGP table version is 7, local router ID is 1.1.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
*> 1.1.2.0/24 0.0.0.0 0 32768 i
*> 2.2.2.0/24 192.168.12.2 0 0 2 i
*> 192.168.12.0 0.0.0.0 0 32768 i
* 192.168.12.2 0 0 2 i
BGP table version is 17, 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
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 192.168.12.1 0 0 1 i
*> 1.1.2.0/24 192.168.12.1 0 0 1 i
*> 2.2.2.0/24 0.0.0.0 0 32768 i
* 192.168.12.0 192.168.12.1 0 0 1 i
*> 0.0.0.0 0 32768 i
R1(config-std-nacl)#permit 1.1.2.0 0.0.0.255
R1(config-std-nacl)#deny any
R1(config-std-nacl)#exitR1(config)#Route-map FORNET1 deny 10
R1(config-route-map)#match ip address NET1
R1(config-route-map)#route-map FORNET1 permit 20
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 route-map FORNET2 out
BGP routing output is shown below when incorrect Route Map is called in BGP Route filtering –
BGP table version is 25, 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
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.0/24 0.0.0.0 0 32768 i
*> 192.168.12.0 0.0.0.0 0 32768 i
Now, we will call out the correct Route Map ie FORNET1 on BGP Router R1 as below –
R1(config-router)#no neighbor 192.168.12.2 route-map FORNET2 out
R1(config-router)# neighbor 192.168.12.2 route-map FORNET1 out
Once configured with correct Route map , BGP advertisement (using Route map filtering) is able to block network 1.1.2.0/24 from being advertised to R2 neighbor as per below output –
BGP table version is 18, 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
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 192.168.12.1 0 0 1 i
*> 2.2.2.0/24 0.0.0.0 0 32768 i
* 192.168.12.0 192.168.12.1 0 0 1 i
*> 0.0.0.0 0 32768 i
Related- Non-Exist-Map & BGP Advertise-Map