BGP Remove Private AS

 Similar to IP Address, BGP also have Public and Private information. Here, we say Public and Private AS instead of Public and Private IP address.  You can refer more at BGP Public and Private AS.

Now, in this article, lets see about BGP Remote Private AS. Consider the below topology,

You can see that, 
  • R1 is in AS_65000, which is a Private AS
  • R2 is in AS_2, which is a Public AS
  • R3 is in AS_3, which is a Public AS
  • Each routers has a loopback IP address
R1 Interface Configuration:
R1#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.12.1    YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Loopback0                  1.1.1.1         YES manual up                    up
R1#

R2 Interface Configuration:
R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.12.2    YES manual up                    up
FastEthernet0/1            192.168.23.2    YES manual up                    up
Loopback0                  2.2.2.2         YES manual up                    up
R2#

R3 Interface Configuration:
R3#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.23.3    YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Loopback0                  3.3.3.3         YES manual up                    up
R3#

R1 BGP Configuration:
R1#conf terminal
R1(config)#router bgp 65000
R1(config-router)#neighbor 192.168.12.2 remote-as 2
R1(config-router)#redistribute connected
R1(config-router)#end
R1#

R2 BGP Configuration:
R2#conf terminal
R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.12.1 remote-as 65000
R2(config-router)#neighbor 192.168.23.3 remote-as 3
R2(config-router)#redistribute connected
R2(config-router)#end
R2#

R3 BGP Configuration:
R3#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router bgp 3
R3(config-router)#neighbor 192.168.23.2 remote-as 2
R3(config-router)#redistribute connected
R3(config-router)#end
R3#

Now if we look at the R3 BGP table, we can see that the network 1.1.1.1/32 is learned through the path AS_2 (Public AS) and AS_65000 (Private_AS).

Now lets move on how to remove the private AS from R3 BGP table    :

As per our topology we need to remove private AS from R3. So the configuration needs to be done from R2.
R2#conf terminal
R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.23.3 remove-private-as
R2(config-router)#end
R2#

Below is the BGP table of R3 after clearing the bgp session using the command "clear ip bgp *"

Now
, we can see that the private AS number has been removed from the BGP table of R3. You can remove the private AS by using the command "
remove-private-as" only when there is no mix up of Public and Private AS in its path.

If you have a combination of both Private and Public AS in its path, then you need to use "remove-private-as all" command.

You can also have a look at your video tutorial:
We will discuss about how to remove private AS even when we have both Public and Private AS in its path.

1 Comments

Post a Comment