Tuesday, October 11, 2011

LAB: BGP AllowAS in

- 0Configure R2 and SW2 to advertise networks 2.2.2.0/24 and 8.8.8.0/24 into BGP.
- Configure AS 200 border routers so that in case AS 200 is partitioned, the remaining segments could transit AS 100 to recover connectivity.

BGP loop-prevention mechanism does not allow a BGP speaker to accept prefixes with the local AS number in the AS_PATH list. However, in some cases, it would be desirable to accept the routes originated in the same AS via another AS. There are two common scenarios:

1) The company’s network is partitioned and every partition connects to the Internet or ISP. Every network has its own set of prefixes but uses the same AS number. In this case, in order for the partitions to exchange prefixes they must accept the NLRIs with the same AS number.

2) The company connects to an ISP and wants to use it as a transit path in case the company’s network becomes segmented due to an emergency. In this case, the prefixes advertised to the ISP must be accepted back by the border peers.
Cisco IOS allows for accepting the prefixes with the local AS number from a specific peer using the command 
neighbor <IP> allowas-in [<count>].

Here <count> is the number of the local AS number occurrences in the AS_PATH attribute, which defaults to one. This parameter serves the purpose similar to the hop-count limit in distance-vector protocol and implement the wellknow count-to-infinity loop prevention technique.

In order to prevent routing loops with this feature, you should be careful implementing prefix aggregation. Specifically, only one “partition” or border peer could implement summarization, or summarization should not be used at all. Otherwise, the upstream ASes will have troubles selecting the proper entry point to the AS partitions. Needless to mention that using the AllowAS in feature is highly un-recommended and only advised as a last resort.

configuration:

R2:
router bgp 200
network 2.2.2.0 mask 255.255.255.0
!
interface Loopback1
ip address 2.2.2.2 255.255.255.0
R3:
router bgp 200
neighbor 155.1.13.1 allowas-in
R5:
router bgp 200
neighbor 155.1.45.4 allowas-in
SW2:
router bgp 200
network 8.8.8.0 mask 255.255.255.0
!
interface Loopback1
ip address 8.8.8.8 255.255.255.0


Configure the routers so that AS 200 split in two parts. To accomplish this, configure the routers as follows:

R3:
router eigrp 1
passive-interface FastEthernet 0/0
passive-interface Serial 1/2
R5:
router eigrp 1
passive-interface Serial 0/0
passive-interface Serial 0/1
!
interface Serial 0/0
shutdown


verification:

Rack1R3#show ip bgp regexp _200$                        
BGP table version is 321, local router ID is 150.1.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
*> 5.5.5.0/24       155.1.13.1                             0 100 200 i
*> 8.8.8.0/24       155.1.13.1                             0 100 200 i
*> 10.0.0.0/22      155.1.13.1                             0 100 200 i
*> 10.10.10.0/24    155.1.13.1                             0 100 200 i

Rack1R5#show ip bgp regexp _200$                          
BGP table version is 407, local router ID is 150.1.5.5
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
*> 0.0.0.0          155.1.45.4                             0 100 200 i
*> 2.2.2.0/24       155.1.45.4                             0 100 200 i
*> 3.3.3.0/24       155.1.45.4                             0 100 200 i
s> 10.0.0.0/24      155.1.45.4                             0 100 200 i
s> 10.0.1.0/24      155.1.45.4                             0 100 200 i
s> 10.0.2.0/24      155.1.45.4                             0 100 200 i
s> 10.0.3.0/24      155.1.45.4                             0 100 200 i
*> 222.22.0.0       155.1.45.4                             0 100 200 i
*> 222.22.1.0       155.1.45.4                             0 100 200 i

No comments:

Post a Comment