How to configure External BGP (EBGP)

In this article, we will see how to configure External BGP between 2 Autonomous systems and how to advertise some networks.

For this, we will use the following topology:

Capture1FAI1 and FAI2 are in different Autonomous systems, so they have to use EBGP to connect and advertise routes to each other. We are supposing that all the interfaces are configured, and the networks 10.0.0.1/24 and 20.0.0.1/24 are in our case loopback interfaces.

Let’s start the configuration:

FAI_1(config)#router bgp 1
FAI_1(config-router)#neighbor 12.0.0.2 remote-as 2
FAI_1(config-router)#exit
FAI_2(config)#router bgp 2
FAI_2(config-router)#neighbor 12.0.0.1 remote-as 1
FAI_2(config-router)#exit

This is how we configure basic EBGP, start with the router bgp “AS number” command to enable the BGP process. The neighbor “@ip of neighbor” remote-as “AS number of the neighbor” specifies your neighbor IP address and his AS.

After this configuration, you have to see an informational log on your CLI screen as the following:

FAI_1# %BGP-5-ADJCHANGE: neighbor 12.0.0.2 Up
FAI_2# %BGP-5-ADJCHANGE: neighbor 12.0.0.1 Up

The TCP session is now up between the 2 FAIs. If you want to verify this, you can use the following command:

FAI_1#show ip bgp summary
BGP router identifier 10.0.0.1, local AS number 1BGP table version is 1, main routing table version 1
Neighbor       V     AS MsgRcvd MsgSent   TblVer InQ OutQ Up/Down State/PfxRcd
12.0.0.2        4       2     13             13       1         0   0                                  00:10:56       0

But if you see the routing table, we can’t see networks 10.0.0.0/24 and 20.0.0.0/24. Let’s verify this:

FAI_1#show ip route
Codes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – 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 set10.0.0.0/24 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0

You can see that we have only the directly connected routes on FAI1, and same thing on FAI2.

In fact, there is nothing strange here, because we didn’t advertise the networks in the BGP process yet. So let’s do that:

FAI_1(config)#router bgp 1
FAI_1(config-router)#network 10.0.0.0 mask 255.255.255.0
FAI_1(config-router)#exit
FAI_2(config)#router bgp 2
FAI_2(config-router)#network 20.0.0.0 mask 255.255.255.0
FAI_2(config-router)#exit

There we go! To advertise networks, we have to use the network “network” mask “maks” command. Note that you have to use the specific mask of your network, otherwise, the router won’t advertise the network.

Let’s see the routing table now of the 2 routers:

FAI_1#show ip route
Codes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – 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
20.0.0.0/24 is subnetted, 1 subnets
B       20.0.0.0 [20/0] via 12.0.0.2, 00:00:10
10.0.0.0/24 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0

 

FAI_2#show ip route
Codes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – 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
20.0.0.0/24 is subnetted, 1 subnets
C       20.0.0.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
B       10.0.0.0 [20/0] via 12.0.0.1, 00:00:30
12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0

You can see that every router has advertised its network to the other autonomous system. You can verify also with the BGP commands:

FAI_1#show ip bgp summary
BGP router identifier 10.0.0.1, local AS number 1BGP table version is 5, main routing table version 5
2 network entries using 240 bytes of memory
2 path entries using 104 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 2) using 32 bytes of memory
BGP using 772 total bytes of memory
BGP activity 2/0 prefixes, 3/1 paths, scan interval 60 secs
Neighbor       V     AS MsgRcvd MsgSent   TblVer InQ OutQ Up/Down State/PfxRcd
12.0.0.2       4       2                    29     30       5           0   0        00:00:34       1

You can see that the prefix received (PfxRcd) statement is 1, which explain that FAI1 received 1 route from its neighbor.

Before finishing this article, let’s try to ping the FAI2 loopback interface from the loopback interface of FAI1:

FAI_1#ping 20.0.0.1 source l0
Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 20.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/38/68 ms

Good! Everything is working.
I hope this article on EBGP configuration was helpful for you, If you have any question, just leave a comment.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.