Tuesday, August 4, 2020

BGP Network Statement




As of now, there are a number of Loopback interfaces in R8's configuration.


These loopback subnets have different mask length to illustrate an important point: BGP can only advertise the networks/subnets with exact mask found in the routing table. Also, if the network/mask pair of the interface being advertised is not a classful network, the keyword 'mask' mast be present as shown below BGP configuration. All below interfaces are subnets of class A network.


interface Loopback0
 ip address 10.8.8.8 255.255.255.255
!
interface Loopback10
 ip address 10.8.0.1 255.255.255.240
!
interface Loopback11
 ip address 10.8.0.17 255.255.255.240
!
interface Loopback12
 ip address 10.8.0.33 255.255.255.240
!
interface Loopback13
 ip address 10.8.0.49 255.255.255.240
!
interface Loopback14
 ip address 10.8.80.1 255.255.255.0
!
interface Loopback15
 ip address 10.8.81.1 255.255.255.0
!
interface Loopback16
 ip address 10.8.82.1 255.255.255.0
!
interface Loopback17
 ip address 10.8.83.1 255.255.255.0

 Here's the R8 Configuration that advertises those prefixes:

R8(config)#router bgp 65089
R8(config-router)#network 10.8.8.8 mask 255.255.255.255
R8(config-router)#network 10.8.0.0 mask 255.255.255.240
R8(config-router)#network 10.8.0.16 mask 255.255.255.240
R8(config-router)#network 10.8.0.32 mask 255.255.255.240
R8(config-router)#network 10.8.0.48 mask 255.255.255.240
R8(config-router)#network 10.8.80.0 mask 255.255.255.0  
R8(config-router)#network 10.8.81.0 mask 255.255.255.0
R8(config-router)#network 10.8.82.0 mask 255.255.255.0
R8(config-router)#network 10.8.83.0 mask 255.255.255.0
R8(config-router)#

First a quick check in the BGP routing table of R8 reveals the following:



There are three things that are important to notice. They all indicate that the prefixes have been advertised into BGP on the local router:
  1. Next Hop is 0.0.0.0.
  2. In the 'Path', there is no AS numbers.
  3. The 'Weight' attribute takes default 32768 value.
R2 shows the AS 65089 originating prefixes. The local AS number is 65100. 

 Let's add one more loopback on R8 with a class C network and advertise this one into BGP as well. Notice, there is no 'mask' keyword as the network/mask pair are both class C.

interface Loopback18
 ip address 198.51.100.1 255.255.255.0

BGP prefix advertisement is going to be this:


R8(config)#router bgp 65089
R8(config-router)#network 198.51.100.0 

The alternative way of advertising subnets/networks would be to redistribute them into BGP. I will practice that a bit later.

Cisco Is Easy - Main

  Cisco Basics (CCNA level)  Lessons: Watch Video Tutorials on Youtube 01 - Connecting to Cisco Console Port with MINICOM 02 - Navigatin...