Skip to content
7LayerX

Routing / Field note

Build your first eBGP session: Cisco IOS-XE and FRRouting

Configure a small two-router eBGP lab, advertise one route from each side, and check the session safely.

7LayerX Editorialupdated 2 min readBGPIPv4

This guide builds a small eBGP session between two routers. R1 belongs to AS 65010. R2 belongs to AS 65020. They have a direct link and exchange one practice network each.

The addresses use ranges reserved for examples. Do this in a simulator or isolated lab. The commands are not a ready-made production change.

Lab plan

DeviceASLink addressNetwork to advertiseRouter ID
R165010198.51.100.1/30192.0.2.0/24192.0.2.1
R265020198.51.100.2/30203.0.113.0/24203.0.113.1

Before starting, configure the link addresses and create the networks to advertise. On IOS-XE, the example uses loopback interfaces. On FRRouting, the network routes must already be present in the Linux routing table. The BGP network command advertises a matching route; it does not create that route.

Cisco IOS-XE example

The commands below configure the interfaces, peer, and two lab prefixes. Check your router's interface names and release before using them.

! R1
interface GigabitEthernet0/0/0
 ip address 198.51.100.1 255.255.255.252
 no shutdown
!
interface Loopback0
 ip address 192.0.2.1 255.255.255.0
!
router bgp 65010
 bgp router-id 192.0.2.1
 neighbor 198.51.100.2 remote-as 65020
 network 192.0.2.0 mask 255.255.255.0
!
! R2
interface GigabitEthernet0/0/0
 ip address 198.51.100.2 255.255.255.252
 no shutdown
!
interface Loopback0
 ip address 203.0.113.1 255.255.255.0
!
router bgp 65020
 bgp router-id 203.0.113.1
 neighbor 198.51.100.1 remote-as 65010
 network 203.0.113.0 mask 255.255.255.0

FRRouting example

FRR requires an inbound and outbound policy for eBGP by default in many standard configurations. This example allows only the two lab prefixes. Configure the link and loopback routes in Linux before starting BGP.

! R1 — /etc/frr/frr.conf
ip prefix-list R1-IN seq 5 permit 203.0.113.0/24
ip prefix-list R1-OUT seq 5 permit 192.0.2.0/24
route-map R1-IN permit 10
 match ip address prefix-list R1-IN
route-map R1-OUT permit 10
 match ip address prefix-list R1-OUT
router bgp 65010
 bgp router-id 192.0.2.1
 neighbor 198.51.100.2 remote-as 65020
 address-family ipv4 unicast
  network 192.0.2.0/24
  neighbor 198.51.100.2 route-map R1-IN in
  neighbor 198.51.100.2 route-map R1-OUT out
 exit-address-family
!
! R2 — reverse the prefixes and neighbor direction
ip prefix-list R2-IN seq 5 permit 192.0.2.0/24
ip prefix-list R2-OUT seq 5 permit 203.0.113.0/24
route-map R2-IN permit 10
 match ip address prefix-list R2-IN
route-map R2-OUT permit 10
 match ip address prefix-list R2-OUT
router bgp 65020
 bgp router-id 203.0.113.1
 neighbor 198.51.100.1 remote-as 65010
 address-family ipv4 unicast
  network 203.0.113.0/24
  neighbor 198.51.100.1 route-map R2-IN in
  neighbor 198.51.100.1 route-map R2-OUT out
 exit-address-family

The two prefixes and policies are an example for the named lab only. FRR's eBGP policy defaults and syntax can change between profiles and releases. Confirm them in the documentation for the FRR version you run.

Check the session and routes

First confirm that the link works. Then check the BGP session and route table. A neighbor showing Established means the BGP session is up; it does not by itself prove that the expected routes are accepted or installed for forwarding.

! Cisco IOS-XE
show ip bgp summary
show ip bgp
show ip route bgp
!
! FRRouting
show bgp summary
show bgp ipv4 unicast
show ip route

You should see the neighbor session established and the other router's permitted lab prefix in the BGP table. If not, check the remote AS, link reachability, address-family activation, route-map, and whether the route to advertise exists.

Try another platform

The BGP learning experience includes copyable examples for eBGP setup, Local Preference, and iBGP route sharing. For session failures, use the layered BGP neighbor checklist.

Pass it along

Found this useful? Share it.

Choose a platform or copy the direct link.

LinkedInXFacebook

Continue reading

Reader signal

Was this useful?

Your feedback helps shape the next field note and lab.

… views

Views count when this page opens. You can change or remove your vote during this tab session.