Search This Blog

Thursday, June 7, 2012

BGP Allows-in feature


Here is another BGP LAB:

R1 and R4 belong to AS65014 while R2 and R3 belong to AS65023, as we can see from the network topology AS65023 stands in the middle of AS65014.

Routes which advertised by R1 to R2 won’t be learned by R4 due to their AS-PATH, which in this case R4 will see his AS in the path.


R4:
R4# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.42.0/24 is directly connected, Loopback2
C    192.168.41.0/24 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 2 subnets
B       10.1.12.0 [20/0] via 10.1.34.3, 00:09:44
C       10.1.34.0 is directly connected, FastEthernet0/0

As you may recall BGP uses AS-PATH to prevent routing loops, where a BGP peer sees his AS nuber in the AS-PATH he will discard the route.
In order to overcome this problem we can configure R4 and R1 to accept routes with their AS in the path:

R1:
R1(config)#router bgp 65014                 
R1(config-router)#no neighbor 10.1.12.2 allowas-in 1

R4:
R4(config)#router bgp 65014                 
R4(config-router)#no neighbor 10.1.34.3 allowas-in 1

The number after the command allows-in define the number of times that the router will accept his AS in the path, in this case only 1 time.

The result:
R4#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

B    192.168.12.0/24 [20/0] via 10.1.34.3, 00:00:02
C    192.168.42.0/24 is directly connected, Loopback2
B    192.168.11.0/24 [20/0] via 10.1.34.3, 00:00:02
C    192.168.41.0/24 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 2 subnets
B       10.1.12.0 [20/0] via 10.1.34.3, 00:14:20
C       10.1.34.0 is directly connected, FastEthernet0/0


No comments:

Post a Comment