Wednesday, June 20, 2012

Removing Private AS numbers in BGP

 

Configuration for Removing Private AS Numbers in BGP

 TOPOLOGY

Send and Receive Updates

This procedure explains the sequence of events that occur when Router 3 advertises a network (10.0.0.0/24 in this case).
1.      Router 3 advertises the network 10.0.0.0/24 with the AS path attribute 65000 to Router 2.
2.      Router 2 receives the update from Router 3 and makes an entry for the network 10.0.0.0 /24 in its routing table with the next hop as 172.16.0.1 (serial interface S0 on Router 3).
3.      Router 2 (Service Provider Device), when configured with the neighbor 192.168.0.2 remove-private-AS command, strips off the private AS number and constructs a new update packet with its own AS number as the AS path attribute for the 10.0.0.0/24 network and sends the same to Router 1 which is in AS1.
4.      Router 1 receives the eBGP update for the network 10.0.0.0/24 and makes an entry in its routing table with the next hop as 192.168.0.1 (serial interface S1 on Router 2). The AS path attribute for this network as seen on Router 1 is AS 5 (Router 2). Thus, the private AS numbers are prevented from entering the BGP tables of the Internet.
Configurations:
R3
!
interface Loopback0
 ip address 10.0.0.1 255.255.255.0
!
interface Serial1/0
 ip address 172.16.0.1 255.255.255.0
 serial restart-delay 0
!
router bgp 65000
 no synchronization
 bgp log-neighbor-changes
 network 10.0.0.0 mask 255.255.255.0
 neighbor 172.16.0.2 remote-as 5
 no auto-summary
!--- Configures Router 2 as an eBGP neighbor in public AS 5.


R2
interface Loopback0
 ip address 172.30.1.1 255.255.0.0
!
interface Serial1/0
 ip address 172.16.0.2 255.255.255.0
 serial restart-delay 0
!
interface Serial1/1
 ip address 192.168.0.1 255.255.255.0
 serial restart-delay 0
!
router bgp 5
 no synchronization
 bgp log-neighbor-changes
 network 172.30.0.0
 network 192.168.0.0
 neighbor 172.16.0.1 remote-as 65000
 neighbor 192.168.0.2 remote-as 1
 
R1
!
interface Serial1/1
 ip address 192.168.0.2 255.255.255.0
 serial restart-delay 0
!
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 192.168.0.1 remote-as 5
--- Configures Router 2 as an eBGP neighbor in public AS 5.

Verify:

Without the command:
 
 neighbor 192.168.0.2 remove-private-AS
 
in R2. In R1 network 10.0.0.0/24 The private AS 65000 is appearing as the source AS.  
 
R1#show ip bgp
BGP table version is 5, local router ID is 192.168.0.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
*> 10.0.0.0/24      192.168.0.1                            0 5 65000 i
*> 172.30.0.0       192.168.0.1              0             0 5 i

Now let’s remove the private AS 65000
R2
!
router bgp 5
 no synchronization
 bgp log-neighbor-changes
 network 172.30.0.0
 network 192.168.0.0
 neighbor 172.16.0.1 remote-as 65000
 neighbor 192.168.0.2 remote-as 1
 neighbor 192.168.0.2 remove-private-as
!--- Removes the private AS numbers from outgoing eBGP updates.
 no auto-summary
!


R1#show ip bgp
BGP table version is 6, local router ID is 192.168.0.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
*> 10.0.0.0/24      192.168.0.1                            0 5 i
*> 172.30.0.0       192.168.0.1              0             0 5 i

No comments:

Post a Comment