Sunday, 26 April 2020

BGP CHAPTER 5- UNDERSTANDING NETWORK ADVERTISEMENT IN BGP

IN BGP we need to manually advertised network/s.
Methods by which we can advertise Network/s in BGP -

>Using Network Command
>Redistribution


1) Using Network Command.


In IGP like OSPF , EIGRP we have seen that once we use network command then all the interfaces falling in the range of network command will get active in IGP.
But in BGP that is not the case .
BGP refers the Routing table (not the interfaces) to install the route in its BGP table.


Network Advertisement in BGP



R1#sh int des

Interface                      Status         Protocol Description

Fa0                            admin down     down

Lo0                            up             up

Se0                            up             up

Se1                            admin down     down

Se2                            admin down     down sh int des

Interface                      Status         Protocol Description

Fa0                            admin down     down

Lo0                            up             up

Se0                            up             up

Se1                            admin down     down

Se2                            admin down     down

R1#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              unassigned      YES NVRAM  administratively down down

Loopback0                  1.1.1.1         YES NVRAM  up                    up

Serial0                    12.1.1.1        YES NVRAM  up                    up

Serial1                    unassigned      YES NVRAM  administratively down down

Serial2                    unassigned      YES NVRAM  administratively down down

R1#sh ip bgp sum

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.2           4   200       3       3                     1            0    0             00:00:34        0

R1#

R1#sh ip bgp



R1#


R2#sh int des

Interface                      Status         Protocol Description

Fa0                            admin down     down

Se0                            admin down     down

Se1                            up             up

Se2                            admin down     down

R2#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              unassigned      YES NVRAM  administratively down down

Serial0                    unassigned      YES NVRAM  administratively down down

Serial1                    12.1.1.2        YES NVRAM  up                    up

Serial2                    unassigned      YES NVRAM  administratively down down

R2#

R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 1, main routing table version 1


Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1          4     100       6       6                      1         0    0             00:03:45        0


R2#

!!! Creating a loopback interface on R1
R1(config)#int loopback 0

R1(config-if)#ip address 1.1.1.1 255.255.255.255

R1(config-if)#^Z


R1#sh ip route

Codes: 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



Gateway of last resort is not set



     1.0.0.0/32 is subnetted, 1 subnets

C       1.1.1.1 is directly connected, Loopback0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial0

R1#



R1(config)#router bgp 100

R1(config-router)#network 1.1.1.0 mask 255.255.255.0



R1#sh ip bgp   <----------------------- Nothing in BGP table .



R2#sh ip bgp <---------------------------Nothing in BGP table



R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 3, main routing table version 3



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1               4   100      25      23                  3            0    0         00:20:43        0

R2#

No prefixes received from R1



Lets configure exact network



R1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router bgp 100

R1(config-router)#no network 1.1.1.0 mask 255.255.255.0

R1(config-router)#network 1.1.1.1 mask 255.255.255.255

R1(config-router)#^Z



R1#sh ip bgp

BGP table version is 4, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete



   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32           0.0.0.0                  0         32768 i

R1#



R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 4, main routing table version 4

1 network entries using 117 bytes of memory

1 path entries using 52 bytes of memory

2/1 BGP path/bestpath attribute entries using 248 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 441 total bytes of memory

BGP activity 2/1 prefixes, 2/1 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1        4        100      33      30                 4          0    0             00:27:13        1

R2#

R2#sh ip bgp

BGP table version is 4, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete



   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       12.1.1.1                 0             0       100      i



Lets prove -" BGP refers the Routing table (not the interfaces) to install the route in its BGP table."

UNDERSTANDING NETWORK ADVERTISEMENT IN BGP


R3#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              13.1.1.3        YES  manual up                    up

Loopback3                  3.3.3.3         YES   manual up                    up





R1#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              13.1.1.1        YES manual up                    up

Loopback0                  1.1.1.1         YES NVRAM  up                    up

Serial0                       12.1.1.1         YES NVRAM  up                    up





R1(config)#ip route 3.3.3.3 255.255.255.255 13.1.1.3

R1(config)#^Z

R1#p

Dec 13 01:44:30.495: %SYS-5-CONFIG_I: Configured from console by console

R1#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/4 ms

R1#sh ip route

Codes: 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



Gateway of last resort is not set



     1.0.0.0/32 is subnetted, 1 subnets

C       1.1.1.1 is directly connected, Loopback0

     3.0.0.0/32 is subnetted, 1 subnets

S       3.3.3.3 [1/0] via 13.1.1.3

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial0

     13.0.0.0/24 is subnetted, 1 subnets

C       13.1.1.0 is directly connected, FastEthernet0

R1#



3.3.3.3/32 is not an interface of R1 but it a route in routing table of R1.



Let's us advertise the same in BGP and check whether its gets installed in BGP table -



R1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router bgp 100

R1(config-router)#network 3.3.3.3 mask 255.255.255.255

R1(config-router)#^Z

R1#

R1#sh i

Dec 13 01:47:27.687: %SYS-5-CONFIG_I: Configured from console by console

R1#sh ip bgp

BGP table version is 5, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete



   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       0.0.0.0                  0         32768 i

*> 3.3.3.3/32       13.1.1.3                 0         32768 i

R1#



R2#sh ip bg

BGP table version is 5, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete



   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       12.1.1.1                 0             0       100      i

*> 3.3.3.3/32       12.1.1.1                 0             0       100      i

R2#



It's getting successfully installed in BGP TABLE.

==============================================================

2) Redistribution


•The routes from other Routing Protocols can be redistributed into BGP.

•Using redistribution command .

•These routers are represented by origin code – “?”



R1(config)#int loopback 100

R1(config-if)#ip add 100.100.100.1 255.255.255.0



R1(config)#router eigrp 10

R1(config-router)#network 100.100.100.0 255.255.255.0

R1(config-router)#^Z

R1#

Dec 13 02:02:35.235: %SYS-5-CONFIG_I: Configured from console by console

R1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router bgp 100

R1(config-router)#red

R1(config-router)#redistribute ei

R1(config-router)#redistribute eigrp ?

  <1-65535>  Autonomous system number



R1(config-router)#redistribute eigrp 10

R1(config-router)#^Z

R1#

Dec 13 02:02:53.767: %SYS-5-CONFIG_I: Configured from console by console

R1#



R1#sh ip bgp

BGP table version is 6, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete



   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       0.0.0.0                  0         32768 i

*> 3.3.3.3/32       13.1.1.3                 0         32768 i

*> 100.100.100.0/24 0.0.0.0                  0         32768 ?


R2#sh ip bgp

BGP table version is 6, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete


   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       12.1.1.1                 0             0 100 i

*> 3.3.3.3/32       12.1.1.1                 0             0 100 i

*> 100.100.100.0/24 12.1.1.1                 0             0 100 ?


Thanks for Reading !!!!

No comments:

Post a Comment