In this post we will learn basic BGP configuration on Cisco IOS router, we will advertise network to the EBGP peers and test connectivity. The post is in continuation of the BGP concepts discussed in previous post.
We will use below topology for this basic BGP configuration example. We have two router Router3, Router4. ASN3 will be used for router 3 and ASN4 will be used for router 4. There are two redundant path between the routers. The BGP neighbor will be formed between the routers using Loopback interface so in case one of the link is done the neighbor relationship remain up with second link.
![basic bgp configuration topology](https://clicksolution.org/wp-content/uploads/2023/12/image-14-1024x398.png)
Step 1> As we will form the neighbor relationship with Loopback interface. We will need to add the route to the loopback ip address. We will write two routes as there are two paths to reach the loopback ip address.
R3#
R3#configure terminal
R3(config)#ip route 4.4.4.4 255.255.255.255 10.43.43.1
R3(config)#ip route 4.4.4.4 255.255.255.255 10.34.34.2
R4#
R4#configure terminal
R4(config)#ip route 3.3.3.3 255.255.255.255 10.34.34.1
R4(config)#ip route 3.3.3.3 255.255.255.255 10.43.43.2
Step 2> Ensure we are able to ping the loopback ip address of the both routers.
R3#
R3#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R3#
R4#
R4#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R4#
Step 3> Now our basic connectivity is done. We will configure BGP on the routers.
R3#
R3(config)#router bgp 3
! starts the bpg process on the router and run BGP for ASN3
R3(config-router)#neighbor 4.4.4.4 remote-as 4
! tell to form the neighborship with ip 4.4.4.4 and its remote as is 4, Router 3 expects TCP packets from this IP address to form the neighborship.
R3(config-router)#neighbor 4.4.4.4 ebgp-multihop 2
! Now as we are not forming EBGP neighborship using directly connect interfaces we are using loopback interface in that case number of hops will be 2 we have to update the hops to 2. BGP assumes the devices are directly connected.
R3(config-router)#neighbor 4.4.4.4 update-source Loopback0
! We are telling to use Loopback 0 for any BGP communication.
R4#
R4(config)#router bgp 4
R4(config-router)#neighbor 3.3.3.3 remote-as 3
R4(config-router)#neighbor 3.3.3.3 ebgp-multihop 2
R4(config-router)#neighbor 3.3.3.3 update-source Loopback0
Step 4> Now we will check status of neighbor relationship.
R3#show ip bgp summary BGP router identifier 3.3.3.3, local AS number 3 BGP table version is 16, main routing table version 16 5 networks peaked at 16:48:58 Dec 28 2023 UTC (00:18:42.943 ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4.4.4.4 4 4 54 56 16 0 0 00:41:36 0
R4#show ip bgp summary BGP router identifier 4.4.4.4, local AS number 4 BGP table version is 18, main routing table version 18 5 networks peaked at 16:49:14 Dec 28 2023 UTC (00:19:24.067 ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 3.3.3.3 4 3 57 55 18 0 0 00:42:20 0 R4#
Step 5> Now as the neighborship is up we will start advertising the route. There are few ways to advertiste routes in BGP we will use network command to advertiste the route.
R3# R3(config)#router bgp 3 R3(config-router)#network 10.23.23.0 mask 255.255.255.252 R4# R4(config)#router bgp 4 R4(config-router)#network 10.14.14.0 mask 255.255.255.252
Step 6> Now validate the number of route received by BGP
R3#show ip bgp summary BGP router identifier 3.3.3.3, local AS number 3 BGP table version is 18, main routing table version 18 2 network entries using 496 bytes of memory 2 path entries using 272 bytes of memory 2/2 BGP path/bestpath attribute entries using 576 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 BGP using 1368 total bytes of memory BGP activity 7/5 prefixes, 13/11 paths, scan interval 60 secs 5 networks peaked at 16:48:58 Dec 28 2023 UTC (01:03:48.662 ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4.4.4.4 4 4 104 105 18 0 0 01:26:41 1
R4#show ip bgp summary BGP router identifier 4.4.4.4, local AS number 4 BGP table version is 20, main routing table version 20 2 network entries using 496 bytes of memory 2 path entries using 272 bytes of memory 2/2 BGP path/bestpath attribute entries using 576 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 BGP using 1368 total bytes of memory BGP activity 7/5 prefixes, 13/11 paths, scan interval 60 secs 5 networks peaked at 16:49:14 Dec 28 2023 UTC (01:03:25.537 ago) Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 3.3.3.3 4 3 105 103 20 0 0 01:26:22 1
Step 7> Validate route in the routing table:
R4#
R4#show ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - 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, m - OMP n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA 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 H - NHRP, G - NHRP registered, g - NHRP registration summary o - ODR, P - periodic downloaded static route, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR & - replicated local route overrides by connected Gateway of last resort is 10.106.32.1 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 10.106.32.1 3.0.0.0/32 is subnetted, 1 subnets S 3.3.3.3 [1/0] via 10.43.43.2 [1/0] via 10.34.34.1 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks C 10.14.14.0/30 is directly connected, GigabitEthernet6 L 10.14.14.2/32 is directly connected, GigabitEthernet6 B 10.23.23.0/30 [20/0] via 3.3.3.3, 00:05:32 C 10.34.34.0/30 is directly connected, GigabitEthernet5 L 10.34.34.2/32 is directly connected, GigabitEthernet5 C 10.43.43.0/30 is directly connected, GigabitEthernet4 L 10.43.43.1/32 is directly connected, GigabitEthernet4
Validate routes learned by BGP
We can see all the routes learned by BPG using command show ip bgp:
![](https://clicksolution.org/wp-content/uploads/2023/12/image-15-1024x474.png)
Final configuration of routers:
R3#R3#show run | sec route
ip route 4.4.4.4 255.255.255.255 10.34.34.2 ip route 4.4.4.4 255.255.255.255 10.43.43.1
router bgp 3 bgp log-neighbor-changes network 10.23.23.0 mask 255.255.255.252 neighbor 4.4.4.4 remote-as 4 neighbor 4.4.4.4 ebgp-multihop 2 neighbor 4.4.4.4 update-source Loopback0
R4#R4#show run | sec route
ip route 3.3.3.3 255.255.255.255 10.34.34.1 ip route 3.3.3.3 255.255.255.255 10.43.43.2
router bgp 4 bgp log-neighbor-changes network 10.14.14.0 mask 255.255.255.252 neighbor 3.3.3.3 remote-as 3 neighbor 3.3.3.3 ebgp-multihop 2 neighbor 3.3.3.3 update-source Loopback0
1 thought on “Basic BGP configuration”