Networking - IP BGP Routing Configuration

BGP routing is an important aspect of IP routing, which is the only one exterior gayeway routing protocol. There are two flavors: iBGP and eBGP, depennding on if the beighbors are in the same AS. Especially EBGP, this is the routing protocol which routes the entire internet, connects between different ISPs, enterprise networks. BGP routing between ISP

BGP routing

The Internet is comprised of two parts: the internal fine-grained portions managed by an IGP such as OSPF, and the interconnections of those autonomous systems (AS) via BGP. BGP Basics:

  • The current version of BGP is BGP version 4, based on RFC4271.
  • BGP is the path-vector protocol that provides routing information for autonomous systems on the Internet via its AS-Path attribute.
  • BGP is a Layer 4 protocol that sits on top of TCP, using port 179.
  • BGP establises route by manually forming neighbors/Peers, exchange routing information between neighbors. Use “show ip bgp neighbor” or “show ip bgp summary” to see neighbors. The neighbors are not necessary to be physically connected neighbor, it can be logical neighbor, as long as it is IP reachable, with the help of IGP such as OSPF.
  • BGP establishes its BGP database after receiving the routing information from neighbors. The database can be examnined by “show ip bgp”.
  • BGP can insert BGP routes into router’s routing table depending on the weigh of route. By default, EBGP route has weight 20, IBGP route is 200, comparing to OSFP route is 100. These are well designed number, which we will see how important is.

Configure BGP routing

Below is the network topology of two Autonomous Systems 500 and 600. I created the network by running Cisco IOL image.

BGP routing network topology

Some highlights:

  • Each router has a loopback 0 interface, e.g. R1 has loopback0 with ip address 11.11.11.11; R2 has loopback 0 with ip address 22.22.22.22.
  • Each router has serial connections as WAN link, and Ethernet interface as LAN. WAN link is not supposed to be seen outside of AS, only LAN network is needed.
  • OSPF will be used as IGP
  • Loopback IP address will be used as neighbor address so that we can have redundancy especially in the case between R3 and R5.
  • IBGP will use full mesh instead of route reflector.

Following shows the IP address of each router.

R1:

R1#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol
Ethernet0/0            10.1.1.1        YES NVRAM  up                    up      
Serial1/0              4.4.4.2         YES NVRAM  up                    up      
Serial2/0              1.1.1.1         YES NVRAM  up                    up      
Loopback0              11.11.11.11     YES manual up                    up      
R1#

R2:

R2#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol
Ethernet0/0            20.1.1.1        YES NVRAM  up                    up      
Serial1/0              2.2.2.1         YES NVRAM  up                    up      
Serial2/0              1.1.1.2         YES NVRAM  up                    up      
Loopback0              22.22.22.22     YES manual up                    up      
R2#

R3:

R3#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol
Ethernet0/0            30.1.1.1        YES NVRAM  up                    up      
Serial1/0              2.2.2.2         YES NVRAM  up                    up      
Serial2/0              3.3.3.1         YES NVRAM  up                    up      
Serial3/0              5.5.5.1         YES NVRAM  up                    up      
Serial4/0              6.6.6.1         YES manual up                    up      
Loopback0              33.33.33.33     YES manual up                    up      
R3#

R4:

R4#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol
Ethernet0/0            40.1.1.1        YES NVRAM  up                    up      
Serial1/0              3.3.3.2         YES NVRAM  up                    up      
Serial2/0              4.4.4.1         YES NVRAM  up                    up      
Loopback0              44.44.44.44     YES manual up                    up      
R4#

R5:

R5#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol
Ethernet0/0            50.1.1.1        YES NVRAM  up                    up      
Serial1/0              5.5.5.2         YES NVRAM  up                    up      
Serial2/0              6.6.6.2         YES manual up                    up      
Loopback0              55.55.55.55     YES NVRAM  up                    up      
R5#

Configure OSPF as IGP for AS-500

R1:

R1#show run | s ospf
router ospf 100
 network 1.0.0.0 0.255.255.255 area 0
 network 4.0.0.0 0.255.255.255 area 0
 network 10.0.0.0 0.255.255.255 area 0
 network 11.11.11.11 0.0.0.0 area 0
R1#
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
40.1.1.1          0   FULL/  -        00:00:30    4.4.4.1         Serial1/0
20.1.1.1          0   FULL/  -        00:00:31    1.1.1.2         Serial2/0
R1#show ip route ospf
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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

O     2.0.0.0/8 [110/128] via 1.1.1.2, 03:56:15, Serial2/0
O     3.0.0.0/8 [110/128] via 4.4.4.1, 03:56:15, Serial1/0
O     20.0.0.0/8 [110/74] via 1.1.1.2, 03:56:15, Serial2/0
      22.0.0.0/32 is subnetted, 1 subnets
O        22.22.22.22 [110/65] via 1.1.1.2, 03:51:47, Serial2/0
O     30.0.0.0/8 [110/138] via 4.4.4.1, 03:56:15, Serial1/0
                 [110/138] via 1.1.1.2, 03:56:15, Serial2/0
      33.0.0.0/32 is subnetted, 1 subnets
O        33.33.33.33 [110/129] via 4.4.4.1, 03:51:05, Serial1/0
                     [110/129] via 1.1.1.2, 03:51:05, Serial2/0
O     40.0.0.0/8 [110/74] via 4.4.4.1, 03:56:15, Serial1/0
      44.0.0.0/32 is subnetted, 1 subnets
O        44.44.44.44 [110/65] via 4.4.4.1, 03:50:12, Serial1/0
R1#

R2:

R2#show running-config | s ospf
router ospf 100
 network 1.0.0.0 0.255.255.255 area 0
 network 2.0.0.0 0.255.255.255 area 0
 network 20.0.0.0 0.255.255.255 area 0
 network 22.22.22.22 0.0.0.0 area 0
R2#
R2#show running-config | s ospf
router ospf 100
 network 1.0.0.0 0.255.255.255 area 0
 network 2.0.0.0 0.255.255.255 area 0
 network 20.0.0.0 0.255.255.255 area 0
 network 22.22.22.22 0.0.0.0 area 0
R2#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
30.1.1.1          0   FULL/  -        00:00:38    2.2.2.2         Serial1/0
10.1.1.1          0   FULL/  -        00:00:31    1.1.1.1         Serial2/0
R2#show ip route ospf
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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

O     3.0.0.0/8 [110/128] via 2.2.2.2, 03:59:33, Serial1/0
O     4.0.0.0/8 [110/128] via 1.1.1.1, 03:59:43, Serial2/0
O     10.0.0.0/8 [110/74] via 1.1.1.1, 03:59:43, Serial2/0
      11.0.0.0/32 is subnetted, 1 subnets
O        11.11.11.11 [110/65] via 1.1.1.1, 03:55:50, Serial2/0
O     30.0.0.0/8 [110/74] via 2.2.2.2, 03:59:33, Serial1/0
      33.0.0.0/32 is subnetted, 1 subnets
O        33.33.33.33 [110/65] via 2.2.2.2, 03:54:24, Serial1/0
O     40.0.0.0/8 [110/138] via 2.2.2.2, 03:59:33, Serial1/0
                 [110/138] via 1.1.1.1, 03:59:33, Serial2/0
      44.0.0.0/32 is subnetted, 1 subnets
O        44.44.44.44 [110/129] via 2.2.2.2, 03:53:31, Serial1/0
                     [110/129] via 1.1.1.1, 03:53:31, Serial2/0
R2#

R3:

R3#show running-config | s ospf
router ospf 100
 network 2.0.0.0 0.255.255.255 area 0
 network 3.0.0.0 0.255.255.255 area 0
 network 30.0.0.0 0.255.255.255 area 0
 network 33.33.33.33 0.0.0.0 area 0
R3#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
40.1.1.1          0   FULL/  -        00:00:30    3.3.3.2         Serial2/0
20.1.1.1          0   FULL/  -        00:00:31    2.2.2.1         Serial1/0
R3#show ip route ospf
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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

O     1.0.0.0/8 [110/128] via 2.2.2.1, 04:00:56, Serial1/0
O     4.0.0.0/8 [110/128] via 3.3.3.2, 04:00:46, Serial2/0
O     10.0.0.0/8 [110/138] via 3.3.3.2, 04:00:46, Serial2/0
                 [110/138] via 2.2.2.1, 04:00:56, Serial1/0
      11.0.0.0/32 is subnetted, 1 subnets
O        11.11.11.11 [110/129] via 3.3.3.2, 03:57:04, Serial2/0
                     [110/129] via 2.2.2.1, 03:57:04, Serial1/0
O     20.0.0.0/8 [110/74] via 2.2.2.1, 04:00:56, Serial1/0
      22.0.0.0/32 is subnetted, 1 subnets
O        22.22.22.22 [110/65] via 2.2.2.1, 03:56:20, Serial1/0
O     40.0.0.0/8 [110/74] via 3.3.3.2, 04:00:46, Serial2/0
      44.0.0.0/32 is subnetted, 1 subnets
O        44.44.44.44 [110/65] via 3.3.3.2, 03:54:45, Serial2/0
R3#

R4:

R4#show running | se ospf
router ospf 100
 network 3.0.0.0 0.255.255.255 area 0
 network 4.0.0.0 0.255.255.255 area 0
 network 40.0.0.0 0.255.255.255 area 0
 network 44.44.44.44 0.0.0.0 area 0
R4#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.1.1.1          0   FULL/  -        00:00:30    4.4.4.2         Serial2/0
30.1.1.1          0   FULL/  -        00:00:31    3.3.3.1         Serial1/0
R4#show ip route ospf
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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

O     1.0.0.0/8 [110/128] via 4.4.4.2, 04:02:06, Serial2/0
O     2.0.0.0/8 [110/128] via 3.3.3.1, 04:02:16, Serial1/0
O     10.0.0.0/8 [110/74] via 4.4.4.2, 04:02:06, Serial2/0
      11.0.0.0/32 is subnetted, 1 subnets
O        11.11.11.11 [110/65] via 4.4.4.2, 03:58:25, Serial2/0
O     20.0.0.0/8 [110/138] via 4.4.4.2, 04:02:06, Serial2/0
                 [110/138] via 3.3.3.1, 04:02:16, Serial1/0
      22.0.0.0/32 is subnetted, 1 subnets
O        22.22.22.22 [110/129] via 4.4.4.2, 03:57:41, Serial2/0
                     [110/129] via 3.3.3.1, 03:57:41, Serial1/0
O     30.0.0.0/8 [110/74] via 3.3.3.1, 04:02:16, Serial1/0
      33.0.0.0/32 is subnetted, 1 subnets
O        33.33.33.33 [110/65] via 3.3.3.1, 03:56:59, Serial1/0
R4#

With above configuration, we should be able to ping from any router inside AS-500 to ping any interface IP inside AS-500.

If we don’t need to communicate outside, that is good enough. But that is not the internet about. we want to connect anywhere in the world! BGP comes to help for that!

configure iBGP for AS-500, plus EBG for R3

R1: only advertise LAN network, which is 10.0.0.0. No WAN interface exposed. peer-group “bgp-pgrp1” is created to apply to all three iBGP neighbors R2, R3, R4. we do the similar in R2, R3 and R4.

R1#show running-config | s bgp
router bgp 500
 bgp log-neighbor-changes
 network 10.0.0.0
 neighbor bgp-pgrp1 peer-group
 neighbor bgp-pgrp1 remote-as 500
 neighbor bgp-pgrp1 update-source Loopback0
 neighbor bgp-pgrp1 version 4
 neighbor bgp-pgrp1 next-hop-self
 neighbor 22.22.22.22 peer-group bgp-pgrp1
 neighbor 33.33.33.33 peer-group bgp-pgrp1
 neighbor 44.44.44.44 peer-group bgp-pgrp1
R1#

R2: only advertise LAN network, which is 20.0.0.0.

R2#show run | se bgp
router bgp 500
 bgp log-neighbor-changes
 network 20.0.0.0
 neighbor bgp-pgrp1 peer-group
 neighbor bgp-pgrp1 remote-as 500
 neighbor bgp-pgrp1 update-source Loopback0
 neighbor bgp-pgrp1 version 4
 neighbor bgp-pgrp1 next-hop-self
 neighbor 11.11.11.11 peer-group bgp-pgrp1
 neighbor 33.33.33.33 peer-group bgp-pgrp1
 neighbor 44.44.44.44 peer-group bgp-pgrp1
R2#

R4: only advertise LAN network, which is 40.0.0.0.

R4#show run | s bgp
router bgp 500
 bgp log-neighbor-changes
 network 40.0.0.0
 neighbor bgp-pgrp1 peer-group
 neighbor bgp-pgrp1 remote-as 500
 neighbor bgp-pgrp1 update-source Loopback0
 neighbor bgp-pgrp1 version 4
 neighbor bgp-pgrp1 next-hop-self
 neighbor 11.11.11.11 peer-group bgp-pgrp1
 neighbor 22.22.22.22 peer-group bgp-pgrp1
 neighbor 33.33.33.33 peer-group bgp-pgrp1
R4#

R3:only advertise LAN network, which is 30.0.0.0. Here R% is added as EBGP neighbor using loopback address 55.55.55.55 with remote-as 600. Also we need configure ebgp-multihop=2 as we use lookback interface, it takes two hops to reach R5 from R3. Another important thing is next-hop-self, which says when it advertise route (e.g. 50.0.0.0) from R5 to R1, R2, R4, it will use 33.33.33.33 as next hop address.

R3#show running-config | s bgp
router bgp 500
 bgp log-neighbor-changes
 network 30.0.0.0
 neighbor bgp-pgrp1 peer-group
 neighbor bgp-pgrp1 remote-as 500
 neighbor bgp-pgrp1 update-source Loopback0
 neighbor bgp-pgrp1 version 4
 neighbor bgp-pgrp1 next-hop-self
 neighbor 11.11.11.11 peer-group bgp-pgrp1
 neighbor 22.22.22.22 peer-group bgp-pgrp1
 neighbor 44.44.44.44 peer-group bgp-pgrp1
 neighbor 55.55.55.55 remote-as 600
 neighbor 55.55.55.55 ebgp-multihop 2
 neighbor 55.55.55.55 update-source Loopback0
R3#

R5: only advertise LAN network, which is 50.0.0.0.

R5#show running-config  | s bgp
router bgp 600
 bgp log-neighbor-changes
 network 50.0.0.0
 neighbor 33.33.33.33 remote-as 500
 neighbor 33.33.33.33 ebgp-multihop 2
 neighbor 33.33.33.33 update-source Loopback0
R5#

Check BGP neighor and datebase

R1:

R1#show ip bgp summary 
BGP router identifier 11.11.11.11, local AS number 500
BGP table version is 6, main routing table version 6
5 network entries using 700 bytes of memory
5 path entries using 380 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 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 1512 total bytes of memory
BGP activity 24/19 prefixes, 34/29 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4          500     124     124        6    0    0 01:49:47        1
33.33.33.33     4          500     125     126        6    0    0 01:50:00        2
44.44.44.44     4          500     125     125        6    0    0 01:49:51        1
R1#show ip bgp         
BGP table version is 6, local router ID is 11.11.11.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  10.0.0.0         0.0.0.0                  0         32768 i
 r>i 20.0.0.0         22.22.22.22              0    100      0 i
 r>i 30.0.0.0         33.33.33.33              0    100      0 i
 r>i 40.0.0.0         44.44.44.44              0    100      0 i
 *>i 50.0.0.0         33.33.33.33              0    100      0 600 i
R1#

R2:

R2#show ip bgp summary 
BGP router identifier 22.22.22.22, local AS number 500
BGP table version is 6, main routing table version 6
5 network entries using 700 bytes of memory
5 path entries using 380 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 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 1512 total bytes of memory
BGP activity 22/17 prefixes, 23/18 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4          500     125     125        6    0    0 01:50:41        1
33.33.33.33     4          500     128     126        6    0    0 01:50:41        2
44.44.44.44     4          500     126     126        6    0    0 01:50:41        1
R2#show ip bgp         
BGP table version is 6, local router ID is 22.22.22.22
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 r>i 10.0.0.0         11.11.11.11              0    100      0 i
 *>  20.0.0.0         0.0.0.0                  0         32768 i
 r>i 30.0.0.0         33.33.33.33              0    100      0 i
 r>i 40.0.0.0         44.44.44.44              0    100      0 i
 *>i 50.0.0.0         33.33.33.33              0    100      0 600 i
R2#

R3:

R3#show ip bgp summary 
BGP router identifier 33.33.33.33, local AS number 500
BGP table version is 6, main routing table version 6
5 network entries using 700 bytes of memory
5 path entries using 380 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 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 1512 total bytes of memory
BGP activity 24/19 prefixes, 35/30 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4          500     129     127        6    0    0 01:52:06        1
22.22.22.22     4          500     128     129        6    0    0 01:51:53        1
44.44.44.44     4          500     126     130        6    0    0 01:51:58        1
55.55.55.55     4          600     128     126        6    0    0 01:52:09        1
R3#show ip bgp         
BGP table version is 6, local router ID is 33.33.33.33
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 r>i 10.0.0.0         11.11.11.11              0    100      0 i
 r>i 20.0.0.0         22.22.22.22              0    100      0 i
 *>  30.0.0.0         0.0.0.0                  0         32768 i
 r>i 40.0.0.0         44.44.44.44              0    100      0 i
 *>  50.0.0.0         55.55.55.55              0             0 600 i
R3#

R4:

R4#show ip bgp summary 
BGP router identifier 44.44.44.44, local AS number 500
BGP table version is 6, main routing table version 6
5 network entries using 700 bytes of memory
5 path entries using 380 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 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 1512 total bytes of memory
BGP activity 22/17 prefixes, 23/18 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4          500     128     128        6    0    0 01:52:27        1
22.22.22.22     4          500     128     128        6    0    0 01:52:22        1
33.33.33.33     4          500     131     126        6    0    0 01:52:27        2
R4#show ip bgp         
BGP table version is 6, local router ID is 44.44.44.44
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 r>i 10.0.0.0         11.11.11.11              0    100      0 i
 r>i 20.0.0.0         22.22.22.22              0    100      0 i
 r>i 30.0.0.0         33.33.33.33              0    100      0 i
 *>  40.0.0.0         0.0.0.0                  0         32768 i
 *>i 50.0.0.0         33.33.33.33              0    100      0 600 i
R4#

R5:

R5#show ip bgp summary 
BGP router identifier 55.55.55.55, local AS number 600
BGP table version is 14, main routing table version 14
5 network entries using 700 bytes of memory
5 path entries using 380 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 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 1512 total bytes of memory
BGP activity 26/21 prefixes, 33/28 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
33.33.33.33     4          500     128     129       14    0    0 01:53:17        4
R5#show ip bgp         
BGP table version is 14, local router ID is 55.55.55.55
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  10.0.0.0         33.33.33.33                            0 500 i
 *>  20.0.0.0         33.33.33.33                            0 500 i
 *>  30.0.0.0         33.33.33.33              0             0 500 i
 *>  40.0.0.0         33.33.33.33                            0 500 i
 *>  50.0.0.0         0.0.0.0                  0         32768 i
R5#

check routing table and veirify

R1:

R1#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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.0.0.0/8 is directly connected, Serial2/0
L        1.1.1.1/32 is directly connected, Serial2/0
O     2.0.0.0/8 [110/128] via 1.1.1.2, 04:20:45, Serial2/0
O     3.0.0.0/8 [110/128] via 4.4.4.1, 04:20:45, Serial1/0
      4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        4.0.0.0/8 is directly connected, Serial1/0
L        4.4.4.2/32 is directly connected, Serial1/0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.0.0/8 is directly connected, Ethernet0/0
L        10.1.1.1/32 is directly connected, Ethernet0/0
      11.0.0.0/32 is subnetted, 1 subnets
C        11.11.11.11 is directly connected, Loopback0
O     20.0.0.0/8 [110/74] via 1.1.1.2, 04:20:45, Serial2/0
      22.0.0.0/32 is subnetted, 1 subnets
O        22.22.22.22 [110/65] via 1.1.1.2, 04:16:17, Serial2/0
O     30.0.0.0/8 [110/138] via 4.4.4.1, 04:20:45, Serial1/0
                 [110/138] via 1.1.1.2, 04:20:45, Serial2/0
      33.0.0.0/32 is subnetted, 1 subnets
O        33.33.33.33 [110/129] via 4.4.4.1, 04:15:35, Serial1/0
                     [110/129] via 1.1.1.2, 04:15:35, Serial2/0
O     40.0.0.0/8 [110/74] via 4.4.4.1, 04:20:45, Serial1/0
      44.0.0.0/32 is subnetted, 1 subnets
O        44.44.44.44 [110/65] via 4.4.4.1, 04:14:42, Serial1/0
B     50.0.0.0/8 [200/0] via 33.33.33.33, 01:53:05
R1#
R1#ping 50.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 50.1.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#ping 50.1.1.1 source 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 50.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/26/32 ms
R1#

R2:

R2#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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.0.0.0/8 is directly connected, Serial2/0
L        1.1.1.2/32 is directly connected, Serial2/0
      2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        2.0.0.0/8 is directly connected, Serial1/0
L        2.2.2.1/32 is directly connected, Serial1/0
O     3.0.0.0/8 [110/128] via 2.2.2.2, 04:23:05, Serial1/0
O     4.0.0.0/8 [110/128] via 1.1.1.1, 04:23:15, Serial2/0
O     10.0.0.0/8 [110/74] via 1.1.1.1, 04:23:15, Serial2/0
      11.0.0.0/32 is subnetted, 1 subnets
O        11.11.11.11 [110/65] via 1.1.1.1, 04:19:22, Serial2/0
      20.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        20.0.0.0/8 is directly connected, Ethernet0/0
L        20.1.1.1/32 is directly connected, Ethernet0/0
      22.0.0.0/32 is subnetted, 1 subnets
C        22.22.22.22 is directly connected, Loopback0
O     30.0.0.0/8 [110/74] via 2.2.2.2, 04:23:05, Serial1/0
      33.0.0.0/32 is subnetted, 1 subnets
O        33.33.33.33 [110/65] via 2.2.2.2, 04:17:56, Serial1/0
O     40.0.0.0/8 [110/138] via 2.2.2.2, 04:23:05, Serial1/0
                 [110/138] via 1.1.1.1, 04:23:05, Serial2/0
      44.0.0.0/32 is subnetted, 1 subnets
O        44.44.44.44 [110/129] via 2.2.2.2, 04:17:03, Serial1/0
                     [110/129] via 1.1.1.1, 04:17:03, Serial2/0
B     50.0.0.0/8 [200/0] via 33.33.33.33, 01:55:25
R2#

R3:

R3#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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

O     1.0.0.0/8 [110/128] via 2.2.2.1, 04:23:46, Serial1/0
      2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        2.0.0.0/8 is directly connected, Serial1/0
L        2.2.2.2/32 is directly connected, Serial1/0
      3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        3.0.0.0/8 is directly connected, Serial2/0
L        3.3.3.1/32 is directly connected, Serial2/0
O     4.0.0.0/8 [110/128] via 3.3.3.2, 04:23:36, Serial2/0
      5.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        5.0.0.0/8 is directly connected, Serial3/0
L        5.5.5.1/32 is directly connected, Serial3/0
      6.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        6.6.6.0/24 is directly connected, Serial4/0
L        6.6.6.1/32 is directly connected, Serial4/0
O     10.0.0.0/8 [110/138] via 3.3.3.2, 04:23:36, Serial2/0
                 [110/138] via 2.2.2.1, 04:23:46, Serial1/0
      11.0.0.0/32 is subnetted, 1 subnets
O        11.11.11.11 [110/129] via 3.3.3.2, 04:19:54, Serial2/0
                     [110/129] via 2.2.2.1, 04:19:54, Serial1/0
O     20.0.0.0/8 [110/74] via 2.2.2.1, 04:23:46, Serial1/0
      22.0.0.0/32 is subnetted, 1 subnets
O        22.22.22.22 [110/65] via 2.2.2.1, 04:19:10, Serial1/0
      30.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        30.0.0.0/8 is directly connected, Ethernet0/0
L        30.1.1.1/32 is directly connected, Ethernet0/0
      33.0.0.0/32 is subnetted, 1 subnets
C        33.33.33.33 is directly connected, Loopback0
O     40.0.0.0/8 [110/74] via 3.3.3.2, 04:23:36, Serial2/0
      44.0.0.0/32 is subnetted, 1 subnets
O        44.44.44.44 [110/65] via 3.3.3.2, 04:17:35, Serial2/0
B     50.0.0.0/8 [20/0] via 55.55.55.55, 01:56:03
      55.0.0.0/32 is subnetted, 1 subnets
S        55.55.55.55 [1/0] via 5.5.5.2
R3#

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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

O     1.0.0.0/8 [110/128] via 4.4.4.2, 04:24:36, Serial2/0
O     2.0.0.0/8 [110/128] via 3.3.3.1, 04:24:46, Serial1/0
      3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        3.0.0.0/8 is directly connected, Serial1/0
L        3.3.3.2/32 is directly connected, Serial1/0
      4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        4.0.0.0/8 is directly connected, Serial2/0
L        4.4.4.1/32 is directly connected, Serial2/0
O     10.0.0.0/8 [110/74] via 4.4.4.2, 04:24:36, Serial2/0
      11.0.0.0/32 is subnetted, 1 subnets
O        11.11.11.11 [110/65] via 4.4.4.2, 04:20:55, Serial2/0
O     20.0.0.0/8 [110/138] via 4.4.4.2, 04:24:36, Serial2/0
                 [110/138] via 3.3.3.1, 04:24:46, Serial1/0
      22.0.0.0/32 is subnetted, 1 subnets
O        22.22.22.22 [110/129] via 4.4.4.2, 04:20:11, Serial2/0
                     [110/129] via 3.3.3.1, 04:20:11, Serial1/0
O     30.0.0.0/8 [110/74] via 3.3.3.1, 04:24:46, Serial1/0
      33.0.0.0/32 is subnetted, 1 subnets
O        33.33.33.33 [110/65] via 3.3.3.1, 04:19:29, Serial1/0
      40.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        40.0.0.0/8 is directly connected, Ethernet0/0
L        40.1.1.1/32 is directly connected, Ethernet0/0
      44.0.0.0/32 is subnetted, 1 subnets
C        44.44.44.44 is directly connected, Loopback0
B     50.0.0.0/8 [200/0] via 33.33.33.33, 01:56:58
R4# 

R5:

R5#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
       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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      5.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        5.0.0.0/8 is directly connected, Serial1/0
L        5.5.5.2/32 is directly connected, Serial1/0
      6.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        6.6.6.0/24 is directly connected, Serial2/0
L        6.6.6.2/32 is directly connected, Serial2/0
B     10.0.0.0/8 [20/0] via 33.33.33.33, 01:54:11
B     20.0.0.0/8 [20/0] via 33.33.33.33, 01:54:11
B     30.0.0.0/8 [20/0] via 33.33.33.33, 01:54:42
      33.0.0.0/32 is subnetted, 1 subnets
S        33.33.33.33 [1/0] via 5.5.5.1
B     40.0.0.0/8 [20/0] via 33.33.33.33, 01:54:11
      50.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        50.0.0.0/8 is directly connected, Ethernet0/0
L        50.1.1.1/32 is directly connected, Ethernet0/0
      55.0.0.0/32 is subnetted, 1 subnets
C        55.55.55.55 is directly connected, Loopback0
R5#

Some highlights:

  • For R1, R2, R3, R4, with BGP in place, BGP adds a new route for 50.0.0.0/8 network on top of OSPF routes.
  • The next hop of 50.0.0.0 is 33.33.33.33, which is R3 loopback 0 IP, which is very important, as we don’t need to know WAN IP of R5, which is usually not available as it belongs to another AS/organization.
  • When we try to ping 50.1.1.1 from R1, it fails without specify soure IP. This is because the default source IP of packet will be R1 WAN IP which is eith 1.1.1.1 or 4.4.4.2, which are not advetized to R5 (outsider), so it couldn’t reply ping packet. Howerver if we specify source IP as LAN (10.0.0.0) of R1, ping works, because R5 has route to 10.0.0.0, the next hop is 33.33.33.33, which R3. From R3, it surely knows how to get to R1 through OSPF route. Very nice!

BGP is kind of simple but very powerful. It was started for ipv4 only, then later it gets extended to support mutiple protocol like ipv6, L2VPN, L3VPN, called as MP-BGP. It is backward compatible though. One of very popular use is in MPLS VPN network. MP-BGP is configured in PE routers to form iBGP, support vpnv4/vpnv6 address, so that PEs can exchange prefixes info needed by MPLS VPN, e.g. RD, labels etc. A good example can be found here.

Reference: BGP youtube video: BGP Video By Sikandar Shaik