Saturday, 16 June 2012

BGP: allowas-in

BGP: allowas-in

·         As we discussed in AS-PATH post, AS-PATH is used to prevent the loops.
·         If any router gets an update which has its own AS number, it simply drops it
·         But what if sometimes we have a situation, where we have discontinuous Autonomous Systems?????
·         Solution is “allowas-in”
·         Let me take a small scenario to explain this…


           R2---------------R1--------------R3

·         R2: Ser1/1 – 10.1.12.2 ßà R1: Ser1/1 – 10.1.12.1
·         R1: Ser1/0 – 100.1.13.1 ßà R3: Ser1/0 – 100.1.13.3

·         AS 2300: R2 and R3
·         AS 100: R1

·         eBGP between R1 and R3
·         eBGP between R1 and R2

BGP Configs:

R3(config-router)#do show run | begin router bgp
router bgp 2300
 no synchronization
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 neighbor 100.1.13.1 remote-as 100
 no auto-summary
!

R1(config-router)#do show run | begin router bgp
router bgp 100
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor 10.1.12.2 remote-as 2300
 neighbor 100.1.13.3 remote-as 2300
 no auto-summary
!

R2(config-router)#do show run | begin router bgp
router bgp 2300
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 100
 no auto-summary
!

R3(config-router)#do show ip bgp
BGP table version is 2, 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, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
R3(config-router)#

R1(config-router)#do show ip bgp
BGP table version is 2, 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
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.3/32       100.1.13.3               0             0 2300 i
R1(config-router)#

R2(config-router)#do show ip bgp

R2(config-router)#

·         *** R2 does not have the prefix 23.23.23.23/32 in its BGP Table as the packet is dropped because the prefix has its own AS.

·         Now let me configure “allowas-in” command in R3 and see what happens:

R2(config-router)#neighbor 10.1.12.1 allowas-in
R2(config-router)#
R2(config-router)#do show ip bgp
BGP table version is 2, 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
*> 3.3.3.3/32       10.1.12.1                              0 100 2300 i
R2(config-router)#

*** Now I see the prefix in the R2’s BGP Table though it has its own AS 2300 in the AS-PATH list!!!

1 comment:

  1. Very well explained, although you made 2 typos in the following lines:
    1. · Now let me configure “allowas-in” command in R3 and see what happens:

    The configuration takes place in R2, not R3, so it should be corrected to:
    · Now let me configure “allowas-in” command in R2 and see what happens:

    2. · *** R2 does not have the prefix 23.23.23.23/32 in its BGP Table as the packet is dropped because the prefix has its own AS.

    Instead, it should be written:
    · *** R2 does not have the prefix 3.3.3.3/32 in its BGP Table as the packet is dropped because the prefix has its own AS.

    ReplyDelete