ALLOWAS-IN” CONFIGURATION IN BGP

BGP routers use AS attribute feature for loop prevention mechanism which prompts them to check if their own AS is anywhere in the path. If their AS number is seen in the path, the prefix is rejected (since BGP senses a loop).Below scenario will help understand the default behaviour of BGP to drop prefix learned via same AS in the path and how to mitigate this condition (using “Allowas-in” where prefix coming from same AS in path may be required not to be dropped.

allowas-in-configuration-in-bgp

Below is the base configuration on R1,R2 and R3 where R1 and R3 are in same AS = 1 and R2 is in AS = 2.All the Routers form eBGP neighborship.

Loopback of Each Router is advertised in BGP to its neighbor.

R1#
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 1.1.1.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
no auto-summary
R2#
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.23.2 255.255.255.0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
network 2.2.2.0 mask 255.255.255.0
network 192.168.12.0
network 192.168.23.0
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.1 soft-reconfiguration inbound
neighbor 192.168.23.3 remote-as 1
neighbor 192.168.23.3 soft-reconfiguration inbound
no auto-summary
R3#
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.23.3 255.255.255.0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 3.3.3.0 mask 255.255.255.0
network 192.168.23.0
neighbor 192.168.23.2 remote-as 2
neighbor 192.168.23.2 soft-reconfiguration inbound
no auto-summary

Once the eBGP neighborship is up between the Routers,next lets see the bgp Routes learned by R3 using “show ip bgp” command –

R3#sh ip 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
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork                Next Hop            Metric   LocPrf  Weight   Path
*> 2.2.2.0/24       192.168.23.2        0                              0         2 i
*> 3.3.3.0/24       0.0.0.0                   0                          32768     i
*> 192.168.12.0    192.168.23.2       0                              0         2 i
*  192.168.23.0     192.168.23.2       0                              0         2 i
*>                            0.0.0.0                 0                          32768     i
R3#

As seen above , R3 is not learning Loopback of R1 (1.1.1.1/24) since its coming from same AS number ie AS 1. R3 will see the prefix of nework 1.1.1.0/24 and seeing the AS path contains its same AS ie 1 , will drop the route.

In order to allow same AS prefix to be received from eBGP neighbor and installed in BGP table, “Allowas-in” command will be issued on R3 towards R2 as below –

R3#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router bgp
R3(config-router)#neighb 192.168.23.2 allowas-in

Once the command is issued, R3 is now able to install route for 1.1.1.0/24 network in its BGP table as below –

R3#sh 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
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork              Next Hop              Metric   LocPrf   Weight   Path
*> 1.1.1.0/24       192.168.23.2                                         0         2 1 i
*> 2.2.2.0/24       192.168.23.2       0                                 0         2 i
*  3.3.3.0/24        192.168.23.2                                           0         2 1 i
*>                          0.0.0.0                  0                            32768     i
*> 192.168.12.0   192.168.23.2       0                                 0         2 i
*  192.168.23.0     192.168.23.2      0                                 0         2 i
*>                           0.0.0.0                 0                             32768    i

Hope this document helped the viewers. Thanks a lot all !!!

Please follow and like us:

Related Post

Tags:

Add Comment

Social Media Auto Publish Powered By : XYZScripts.com
Select your currency