How to Configure and verify eBGP (IPv4 and IPv6 address families)
The BGP uses 2 primary modes of information exchange such as external BGP and internal BGP, to communicate external and internal peers respectively. The eBGP stands for the external border gateway protocol. This protocol used to transport information to the other BGP enabled system in the different autonomous systems. This eBGP will work opposite to the iBGP. In this below sections, you will get an idea about the eBGP, byte AS number and private AS.
Peer ASs establishes links via an external peer BGP session. All route advertisements between an external peer take place by the eBGP mode of the information exchange. To propagate the route through an AS and advertises it to the internal peers. To advertise a route to the different peers AS, again BGP uses the eBGP.
The BGP will work in collaboration with the IBGP to transfer the data from the external internet or AS as well as vice versa. The eBGP multihop is the option which is used to peer with an external neighbor. If there are many paths between the eBGP peers you can take advantage of that. By default, the BGP allows to establish the eBGP neighbor relationship to the peers residing on the directly connected network, which is 1 by default for the eBGP peers.
Take the above diagram as the example for the eBGP configuration.
Take this simple topology network with 2 autonomous systems and 2 routers. Each router has the network on the loopback interface which is going to advertise in the BGP.
Rose(config)#router bgp 1
Rose(config-router)#neighbor 192.168.12.2 remote-as 2
Lilly(config)#router bgp 2
Lilly(config-router)#neighbor 192.168.12.1 remote-as 1
Here, use the command router bgp with an AS number to start the BGP. There neighbors are not at all automatically configured and you need to do with the command neighbor x.x.x.x remote-as. It is the way to configure the external BGP.
Rose# %BGP-5-ADJCHANGE: neighbor 192.168.12.2 Up
Lilly# %BGP-5-ADJCHANGE: neighbor 192.168.12.1 Up
Check whether the new BGP neighbor adjacency is received or not:
Rose(config)#router bgp 1
Rose(config-router)#neighbor 192.168.12.2 password MYPASS
Lilly(config)#router bgp 2
Lilly(config-router)#neighbor 192.168.12.1 password MYPASS
If you want to enable the MD5 authentication using the neighbor password command. Then the router can calculate the MD5 digest of the each TCP segment which is being sent.
Rose#show ip bgp summary
Lilly#show ip bgp summary
The command show ip bgp summary is the excellent one to check the BGP neighbors. It also helps to see the number of prefixes which you received from the each neighbor.
Rose(config)#router bgp 1
Rose(config-router)#network 22.214.171.124 mask 255.255.255.0
Lilly(config)#router bgp 2
Lilly(config-router)#network 126.96.36.199 mask 255.255.255.0
Then advertise a loopback interface using the command network. To advertise something with the BGP, make sure that the exact subnet mask is the command for a network.to type network 188.8.131.52 mask 255.0.0.0 on router rose cannot work, since that entry is not in a routing table.
Rose#show ip bgp
To look at the BGP database, make use of the show ip bgp. The router Rose has learned about the network 184.108.40.206/24 and a next hop IP address is the 192.168.12.2 is from the AS 2.
Lilly#show ip bgp
The router Lilly learned about the network 220.127.116.11/24 with the next hop IP address of the 192.168.12.1
Rose#show ip route bgp
Lilly#show ip route bgp
In a routing table, find an entry for the BGP with the administrative distance of 20 for an external BGP or eBGP.
The Commands used to verify the configuration as follows:
Show ip bgp summary
Show ip bgp rib failure
Show ip bgp neighbors address [received| advertised]
3.31.b 4 Byte AS number
The 4 byte ASN provide 232 or 4,294,967,296 ranging from the 0 to 4294967295. It is important to notice that the ASN include all the older 2 byte AS number through 65535. It greatly assists with the interoperability between the AS using the 2 byte AS number and those using the 4 byte AS number. The 4 byte AS number between 0 and 65535 is also called as mappable AS number, it can also be represented in simply 2 bytes. In that the first 16 bits are in each case all zeros.
The BGP autonomous system number is the 2 byte entity. The 2 bytes provide 65536 possible number of which 0, 65535, 23456, and 64512- 65534 are reserved by the IANA. The remaining 39000plus AS numbers are used already.
The 4 byte AS number can also be represented in one among the 3 ways such as:
It breaks the number up in the two 16 bit values as high order and lower separated by the dot. All of the 2 byte AS number may be represented by a low order value. Ex: AS number 65535 can be 0.65535, then 65536 can be 1.0, 6.5537 can be 1.1. The last AS number 4294967296 can be 65535.65535.
It is the simple decimal representation of an AS number. Ex: AS number 7747 can be denoted by 7747, and 123456 can be denoted by 123456.
It is the mixture of the asdot+ and asplain. Any AS number in a 2 byte range is denoted as asplain and any of the AS numbers above 2 bytes is denoted by asdot+. Ex: 65535 can be 65535 while the 65536 can be 1.0.
The BGP carries the ASN in the AS_PATH attribute, community attributes, open messages and aggregator attribute. The new BGP speaker advertise to the neighbor that it uses the 4 byte AS number using the BGP capability advertisements. If a neighbor advertises, that it uses the 4 byte AS number. The new BGP speaker uses the reserved 2 byte AS number 23456 is called the AS_TRANS. This speaker adds that ASN to an open message.
The BGP communities are mostly supported in the 4 byte ASN environment using the new extended community attribute which is called as 4 Octet AS specific BGP extended community. This recent and new community has the 4 byte AS number field and also 2 byte arbitrary number as opposed to the 2 byte ASN field in the legacy community attribute.
It is essential to keep in mind that the old BGP speaker will use the 2- byte ASN and the new BGP speaker will use the 4 byte ASN. The new BGP speaker advertises the route to the new BGP neighbors with the AS_PATH which carrying the 2 byte AS number when advertising to the old BGP neighbor while it adds an AS_TRANS AS number rather than adding the own 4 byte AS number. The AS4_PATH attributes are an optional transitive attribute that carries a real list of AS_PATH, carrying the both 4 byte as well as 2-byte ASN. Then the new BGP speaker will add the AS4_PATH attribute if there is any 4 byte AS number in a AS_PATH list.
The new BGP speaker constructs an AS_PATH attribute by simply replacing the 4 byte with the AS_TRANS. In that way, an AS_PATH shows the right number of Hops.
In the above example, R3 and R1 are using the 4 byte AS number. While R2 router is capable to use the 2 byte ASN only. The configuration for R1 and R2 routers are as follows:
When the R1 router discovers R2 router, the BGP openmessage and all capabilities, including the 4 byte AS number support. Mainly it pretends to be in the AS 23456 while an actual AS number is hidden in the capability.
Here R2 is not at all capable of understanding the 4 byte AS number and it is configured to peer with the router R1 in the AS 23456, then it will accept a BGP openmessage and also form the neighbors with R1. Then the show ip bgp neighbors command displays the capability advertised by the BGP speaker to the neighbor. When the R1 advertises the BGP UPDATE message holds the NLRI for the prefix 18.104.22.168/32, it includes the NEW AS_PATH attribute.
Then the router R2 will accept it when coming from the AS 23456. It forwards a same update message to router R3 after appending the own ASN 200 to an AS_PATH attributes. Even though, Router R3 understand the NEW AS_PATH attribute, it may reconstruct the original list of AS_PATH from that attribute.
When the Router R1 advertise the summarized route to router R2, it copies the entire information from the regular AGGREGATOR attribute and also puts in the NEW AGGREGATOR attribute, except an AS number. Then the regular attribute of the aggregator has the AS number 23456 while the new aggregator attribute has the AS number 65636. Since, router R3 may understand that new aggregator attribute, then it will reconstruct the right AS_PATH list.
The final aggregated route as follows:
3.31.c Private AS
The autonomous system is the collection of the connected IP routing prefixes under the control of one or more service providers or network operators. The multiple organizations can run the BGP using the private AS numbers to the ISP which connects all those organizations to an internet. The unique AS number is allotted to the each AS for use in the BGP routing. This AS numbers are very important because, an ASN uniquely identifies the each network on an internet. There are 2 types of AS numbers such as public ASN and private ASN.
The private ASN can be seen on the global internet. ( via eBGP). The private AS numbers are mainly used by the ISP who uses the BGP confederations or in the private networks. This private AS numbers are sometimes used to offer the AS number to the customers with multiple connections to the ISP, but who have no connection to any other ISP. It is becoming more rare. Use of the private ASN is now most frequently seen in the private networks which do not communicate directly with an internet. Most of the internet service provider utilizes the route filters to reject routes which contain the private ASN. By default, when the BGP advertises the AS path to remote systems it includes all the AS numbers including the Private AS numbers. You can also configure the software to remove the private AS numbers from the AS paths. The remote AS for that you offer connectivity is multihorned, but to the local AS only. The remote AS may not have any officially allocated AS numbers and it is not at all appropriate to make the remote AS the confederation member AS of a local AS. Most of the companies like to gain their own AS number and some companies will use private AS numbers to connect with the public AS network. The service can use the remove private command to prevent advertising the private AS numbers to the internet.
The BGP private AS number ranges from 64512 to 65535. As it is private, the number is not globally unique. The internet service provider require to ensure the strip private ASN off a BGP update to the eBGP peers while announcing the routing information over the internet. One best way to perform this is by using a command to remove private as a command.
In the below network, the user is using the private ASN 64512. Now configure the router at the internet service provider so that it will not advertise the user ASN out to the internet. It means that all the prefixes may appear as though it came directly from the internet service provider. Technically, an ISP normally own the user prefixes anyway.
To begin the configuration, check the router R3 NGP table:
Now, the output implies R3 is getting the 100.100.100.1/32 prefix from an ISP, but the users AS have been included in an AS_PATH. So just adjust it.
After the configuration, the user removed the AS.
The eBGP is normally used for the interconnection of the networks for the different organization or a global internet. These organizations can be an internet service provider, large corporations or universities which have the vast network infrastructure. It is used and also implemented at the border or edge router which gives interconnectivity for 2 or more autonomous systems. In this section, the eBGP configuration and verification are discussed clearly along with the byte AS number and private AS.