Pruebas con anuncios BGP inter-AS e intra-AS

Fecha: 4 y 5 de mayo del 2023

 

Escenario

 

Este laboratorio es una continuación del escenario anterior y se centra en las actualizaciones entre peers BGP.

Por un lado, peers en diferentes AS (sistemas autónomos), y por otro, peers dentro de un mismo AS que reciben

actualizaciones externas y cómo se comporta el atributo next-hop.

También se analiza la búsqueda recursiva en la tabla de enrutamiento para poder alcanzar un destino determinado.

 

 

 

Los mensajes UPDATE los generamos agregando el vecino BGP-3 dentro del AS 65531 con las redes 181.0.4.0 a 181.0.9.0/24,

este publicará hacia BGP-1 dichas redes, y BGP-1 las publicará hacia BGP-2 fuera del AS.

También BGP-1 informará a BGP-3 sobre las redes 181.0.1.0 a 181.0.3.0/24 publicadas por el mismo, y las redes publicadas por

BGP-2 que pertenecen al AS 65530, que son 200.0.1.0 a 200.0.3.0/24.

 

 

1.- Verificación inicial:

 

1.1.- De peer BGP en BGP-1:

 

BGP-1#sh ip bgp neighbors

 

BGP neighbor is 190.0.0.2,  remote AS 65530, external link

  BGP version 4, remote router ID 190.0.0.2

  BGP state = Established, up for 00:10:16

  Last read 00:00:19, last write 00:00:18, hold time is 180, keepalive interval is 60 seconds

  Neighbor capabilities:

    Route refresh: advertised and received(old & new)

    Address family IPv4 Unicast: advertised and received

---resumido/omitido---

 

BGP-1#

 

 

1.2.- De rutas en BGP-1:

 

BGP-1#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

 

B    200.0.1.0/24 [20/0] via 190.0.0.2, 00:03:25 (ruta aprendida desde BGP-2)

     190.0.0.0/24 is subnetted, 1 subnets

C       190.0.0.0 is directly connected, FastEthernet0/0

B    200.0.2.0/24 [20/0] via 190.0.0.2, 00:03:25 (ruta aprendida desde BGP-2)

B    200.0.3.0/24 [20/0] via 190.0.0.2, 00:03:25 (ruta aprendida desde BGP-2)

     181.0.0.0/24 is subnetted, 3 subnets

C       181.0.1.0 is directly connected, FastEthernet0/1.1811

C       181.0.3.0 is directly connected, FastEthernet0/1.1813

C       181.0.2.0 is directly connected, FastEthernet0/1.1812

BGP-1#

 

 

1.3.- De rutas en BGP-2:

 

[admin@BGP-2] > ip route print

Flags: X - disabled, A - active, D - dynamic,

C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,

B - blackhole, U - unreachable, P - prohibit

 #      DST-ADDRESS   PREF-SRC        GATEWAY            DISTANCE

 0 ADb  181.0.1.0/24                               190.0.0.1                20 (ruta aprendida desde BGP-1)

 1 ADb  181.0.2.0/24                               190.0.0.1                20 (ruta aprendida desde BGP-1)

 2 ADb  181.0.3.0/24                               190.0.0.1                20 (ruta aprendida desde BGP-1)

 3 ADC  190.0.0.0/24       190.0.0.2         ether1                      0

 4 ADC  200.0.1.0/24       200.0.1.1         vlan201                   0

 5 ADC  200.0.2.0/24       200.0.2.1         vlan202                   0

 6 ADC  200.0.3.0/24       200.0.3.1         vlan203                   0

[admin@BGP-2] >

 

 

2.- Se conecta el segmento iBGP 181.0.0.0/24:

 

Este segmento actuará como backbone entre ambos peers del AS 65531

 

                          

 

2.1.- Declaramos el peer en BGP-1:

 

BGP-1#conf t

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

BGP-1(config)#router bgp 65531

BGP-1(config-router)#neighbor 181.0.0.2 remote-as 65531

BGP-1(config-router)#end

BGP-1#

 

2.2.- Declaramos el peer en BGP-2:

 

BGP-3#conf t

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

BGP-3(config)#router bgp 65531

BGP-3(config-router)#neighbor 181.0.0.1 remote-as 65531

BGP-3(config-router)#end

BGP-3#

*May  4 18:00:41.784: %BGP-5-ADJCHANGE: neighbor 181.0.0.1 Up

BGP-3#

 

 

2.3.- Verificamos vecindad en BGP-3:

 

BGP-3#sh ip bgp neighbors

BGP neighbor is 181.0.0.1,  remote AS 65531, internal link (router BGP-1)

  BGP version 4, remote router ID 190.0.0.1

  BGP state = Established, up for 00:06:08

  Last read 00:00:08, last write 00:00:23, hold time is 180, keepalive interval is 60 seconds

  Neighbor sessions:

    1 active, is not multisession capable (disabled)

  Neighbor capabilities:

    Route refresh: advertised and received(new)

    Four-octets ASN Capability: advertised

    Address family IPv4 Unicast: advertised and received

    Enhanced Refresh Capability: advertised

---resumido/omitido---

BGP-3#

 

 

2.4.- Verificamos vecindad en BGP-1:

 

BGP-1#sh ip bgp neighbors

BGP neighbor is 181.0.0.2,  remote AS 65531, internal link (router BGP-3)

  BGP version 4, remote router ID 181.0.0.2

  BGP state = Established, up for 00:07:17

  Last read 00:00:41, last write 00:00:17, hold time is 180, keepalive interval is 60 seconds

  Neighbor capabilities:

    Route refresh: advertised and received(old & new)

    Address family IPv4 Unicast: advertised and received

---resumido/omitido---

 

BGP neighbor is 190.0.0.2,  remote AS 65530, external link (router BGP-2)

  BGP version 4, remote router ID 190.0.0.2

  BGP state = Established, up for 00:20:19

  Last read 00:00:29, last write 00:00:18, hold time is 180, keepalive interval is 60 seconds

  Neighbor capabilities:

    Route refresh: advertised and received(old & new)

    Address family IPv4 Unicast: advertised and received

---resumido/omitido---

 

BGP-1#

 

 

3.- Se agregan nuevas redes en el AS 65531:

 

BGP-3#conf t

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

BGP-3(config)#router bgp 65531

BGP-3(config-router)#network 181.0.4.0 mask 255.255.255.0

BGP-3(config-router)#network 181.0.5.0 mask 255.255.255.0

BGP-3(config-router)#network 181.0.6.0 mask 255.255.255.0

BGP-3(config-router)#network 181.0.7.0 mask 255.255.255.0

BGP-3(config-router)#network 181.0.8.0 mask 255.255.255.0

BGP-3(config-router)#network 181.0.9.0 mask 255.255.255.0

BGP-3(config-router)#end

BGP-3#

 

 

4.- Verificamos:

 

4.1.- En BGP-1:

 

BGP-1#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

 

B    200.0.1.0/24 [20/0] via 190.0.0.2, 00:22:11 (ruta aprendida desde BGP-2)

     190.0.0.0/24 is subnetted, 1 subnets

C       190.0.0.0 is directly connected, FastEthernet0/0

B    200.0.2.0/24 [20/0] via 190.0.0.2, 00:22:11 (ruta aprendida desde BGP-2)

B    200.0.3.0/24 [20/0] via 190.0.0.2, 00:22:11 (ruta aprendida desde BGP-2)

     181.0.0.0/24 is subnetted, 10 subnets

B       181.0.5.0 [200/0] via 181.0.0.2, 00:01:31 (ruta aprendida desde BGP-3)

B       181.0.4.0 [200/0] via 181.0.0.2, 00:01:31 (ruta aprendida desde BGP-3)

B       181.0.7.0 [200/0] via 181.0.0.2, 00:01:31 (ruta aprendida desde BGP-3)

B       181.0.6.0 [200/0] via 181.0.0.2, 00:01:31 (ruta aprendida desde BGP-3)

C       181.0.1.0 is directly connected, FastEthernet0/1.1811

C       181.0.0.0 is directly connected, FastEthernet0/1.1810

C       181.0.3.0 is directly connected, FastEthernet0/1.1813

C       181.0.2.0 is directly connected, FastEthernet0/1.1812

B       181.0.9.0 [200/0] via 181.0.0.2, 00:01:33 (ruta aprendida desde BGP-3)

B       181.0.8.0 [200/0] via 181.0.0.2, 00:01:33 (ruta aprendida desde BGP-3)

BGP-1#

 

 

4.2.- En BGP-2:

 

[admin@BGP-2] > ip route print

Flags: X - disabled, A - active, D - dynamic,

C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,

B - blackhole, U - unreachable, P - prohibit

 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE

 0 ADb  181.0.1.0/24                                    190.0.0.1                20 (ruta publicada por BGP-1)

 1 ADb  181.0.2.0/24                                    190.0.0.1                20 (ruta publicada por BGP-1)

 2 ADb  181.0.3.0/24                                    190.0.0.1                20 (ruta publicada por BGP-1)

 3 ADb  181.0.4.0/24                                    190.0.0.1                20 (ruta ruta publicada por BGP-3 pero aprendida desde BGP-1)

 4 ADb  181.0.5.0/24                                    190.0.0.1                20 (ruta ruta publicada por BGP-3 pero aprendida desde BGP-1)

 5 ADb  181.0.6.0/24                                    190.0.0.1                20 (ruta ruta publicada por BGP-3 pero aprendida desde BGP-1)

 6 ADb  181.0.7.0/24                                    190.0.0.1                20 (ruta ruta publicada por BGP-3 pero aprendida desde BGP-1)

 7 ADb  181.0.8.0/24                                    190.0.0.1                20 (ruta ruta publicada por BGP-3 pero aprendida desde BGP-1)

 8 ADb  181.0.9.0/24                                    190.0.0.1                20 (ruta ruta publicada por BGP-3 pero aprendida desde BGP-1)

 9 ADC  190.0.0.0/24       190.0.0.2              ether1                       0

10 ADC  200.0.1.0/24       200.0.1.1             vlan201                    0

11 ADC  200.0.2.0/24       200.0.2.1             vlan202                    0

12 ADC  200.0.3.0/24       200.0.3.1             vlan203                    0

[admin@BGP-2] >

 

 

4.3.- En BGP-3:

 

Nos encontramos con que no “aparecen” en la tabla las rutas publicadas por BGP-2 (AS 65530).

 

BGP-3#sh 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

       a - application route

       + - replicated route, % - next hop override

 

Gateway of last resort is not set

 

      181.0.0.0/16 is variably subnetted, 17 subnets, 2 masks

C        181.0.0.0/24 is directly connected, Vlan1810

L        181.0.0.2/32 is directly connected, Vlan1810

B        181.0.1.0/24 [200/0] via 181.0.0.1, 00:14:59 (ruta publicada por BGP-1)

B        181.0.2.0/24 [200/0] via 181.0.0.1, 00:14:59 (ruta publicada por BGP-1)

B        181.0.3.0/24 [200/0] via 181.0.0.1, 00:14:59 (ruta publicada por BGP-1)

C        181.0.4.0/24 is directly connected, Vlan1814

L        181.0.4.1/32 is directly connected, Vlan1814

C        181.0.5.0/24 is directly connected, Vlan1815

L        181.0.5.1/32 is directly connected, Vlan1815

C        181.0.6.0/24 is directly connected, Vlan1816

L        181.0.6.1/32 is directly connected, Vlan1816

C        181.0.7.0/24 is directly connected, Vlan1817

L        181.0.7.1/32 is directly connected, Vlan1817

C        181.0.8.0/24 is directly connected, Vlan1818

L        181.0.8.1/32 is directly connected, Vlan1818

C        181.0.9.0/24 is directly connected, Vlan1819

L        181.0.9.1/32 is directly connected, Vlan1819

BGP-3#

 

 

5.- Verificamos en la tabla de BGP-3:

 

Podemos ver que las rutas efectivamente se encuentran en la tabla BGP, pero con el next-hop real del router BGP-2,

que no es vecino de BGP-3 sino que está a un salto de distancia, vía el router BGP-1.

 

BGP-3#sh ip bgp

BGP table version is 16, local router ID is 181.0.0.2

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

 *>i 181.0.1.0/24     181.0.0.1                0    100                 0 I (ruta publicada por BGP-1)

 *>i 181.0.2.0/24     181.0.0.1                0    100                 0 i (ruta publicada por BGP-1)

 *>i 181.0.3.0/24     181.0.0.1                0    100                 0 i (ruta publicada por BGP-1)

 *>  181.0.4.0/24     0.0.0.0                    0                   32768 i

 *>  181.0.5.0/24     0.0.0.0                    0                   32768 i

 *>  181.0.6.0/24     0.0.0.0                    0                   32768 i

 *>  181.0.7.0/24     0.0.0.0                    0                   32768 i

 *>  181.0.8.0/24     0.0.0.0                    0                   32768 i

 *>  181.0.9.0/24     0.0.0.0                    0                   32768 i

 * i 200.0.1.0         190.0.0.2                  0    100      0 65530 i (ruta publicada por BGP-2)

 * i 200.0.2.0         190.0.0.2                  0    100      0 65530 I (ruta publicada por BGP-2)

 * i 200.0.3.0         190.0.0.2                  0    100      0 65530 I (ruta publicada por BGP-2)

BGP-3#

 

 

 

BGP-3#sh ip route 200.0.1.0

% Network not in table

BGP-3#

 

Si el router “no sabe” cómo llegar al siguiente salto de una ruta, la búsqueda recursiva fallará y la ruta BGP no se podrá agregar a la tabla.

BGP-3 recibe las rutas con un atributo NEXT_HOP de 190.0.0.2, pero como no tiene una entrada en su tabla de enrutamiento para una

subred que incluya 190.0.0.2, la ruta BGP no se podrá agregar a la tabla.

 

Si hipotéticamente las rutas se instalaran en la tabla de enrutamiento sucedería lo siguiente:

 

 

 

6.- Esto se solucionaría de dos maneras:

 

6.1.- Implementando una ruta estática, BGP (tanto iBGP o eBGP), o vía IGP (EIGRP, OSPF, etc…) pero no es el caso en este lab.

 

6.2.- Implementando el atributo next-hop-self en el router BGP-1 para reemplazar el next-hop 190.0.0.2 por la dirección IP

alcanzable por el peer (que esté en su tabla de enrutamiento), en este caso 181.0.0.1 que es alcanzable ya que es el peer BGP.

 

 

7.- Solución:

 

Si no se va a declarar la red 190.0.0.0/24 en el BGP, o con algún IGP o ruta estática, se deberá especificar el atributo NEXT_HOP en el peer BGP.

 

7.1.- Configuramos el atributo NEXT-HOP:

 

BGP-1#conf t

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

BGP-1(config)#router bgp 65531

BGP-1(config-router)#neighbor 181.0.0.2 next-hop-self

BGP-1(config-router)#end

BGP-1#

 

7.2.- Verificamos:

 

7.2.1.- En la tabla BGP de BGP-3:

 

BGP-3#sh ip bgp

BGP table version is 31, local router ID is 181.0.0.2

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

 *>i 181.0.1.0/24     181.0.0.1                0    100      0 i

 *>i 181.0.2.0/24     181.0.0.1                0    100      0 i

 *>i 181.0.3.0/24     181.0.0.1                0    100      0 i

 *>  181.0.4.0/24     0.0.0.0                  0         32768 i

 *>  181.0.5.0/24     0.0.0.0                  0         32768 i

 *>  181.0.6.0/24     0.0.0.0                  0         32768 i

 *>  181.0.7.0/24     0.0.0.0                  0         32768 i

 *>  181.0.8.0/24     0.0.0.0                  0         32768 i

 *>  181.0.9.0/24     0.0.0.0                  0         32768 i

 *>i 200.0.1.0        181.0.0.1                0    100      0 65530 I (ahora el next-hop es el segmento de backbone entre BGP-1 y BGP-3)

 *>i 200.0.2.0        181.0.0.1                0    100      0 65530 i

 *>i 200.0.3.0        181.0.0.1                0    100      0 65530 i

BGP-3#

 

7.2.1.- En la tabla de enrutamiento de BGP-3:

 

BGP-3#sh 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

       a - application route

       + - replicated route, % - next hop override

 

Gateway of last resort is not set

 

      181.0.0.0/16 is variably subnetted, 17 subnets, 2 masks

C        181.0.0.0/24 is directly connected, Vlan1810

L        181.0.0.2/32 is directly connected, Vlan1810

B        181.0.1.0/24 [200/0] via 181.0.0.1, 00:04:08 (ruta publicada por BGP-1)

B        181.0.2.0/24 [200/0] via 181.0.0.1, 00:04:08 (ruta publicada por BGP-1)

B        181.0.3.0/24 [200/0] via 181.0.0.1, 00:04:08 (ruta publicada por BGP-1)

C        181.0.4.0/24 is directly connected, Vlan1814

L        181.0.4.1/32 is directly connected, Vlan1814

C        181.0.5.0/24 is directly connected, Vlan1815

L        181.0.5.1/32 is directly connected, Vlan1815

C        181.0.6.0/24 is directly connected, Vlan1816

L        181.0.6.1/32 is directly connected, Vlan1816

C        181.0.7.0/24 is directly connected, Vlan1817

L        181.0.7.1/32 is directly connected, Vlan1817

C        181.0.8.0/24 is directly connected, Vlan1818

L        181.0.8.1/32 is directly connected, Vlan1818

C        181.0.9.0/24 is directly connected, Vlan1819

L        181.0.9.1/32 is directly connected, Vlan1819

B     200.0.1.0/24 [200/0] via 181.0.0.1, 00:00:46 (ruta ruta publicada por BGP-2 pero aprendida desde BGP-1)

B     200.0.2.0/24 [200/0] via 181.0.0.1, 00:00:46 (ruta ruta publicada por BGP-2 pero aprendida desde BGP-1)

B     200.0.3.0/24 [200/0] via 181.0.0.1, 00:00:46 (ruta ruta publicada por BGP-2 pero aprendida desde BGP-1)

BGP-3#

 

8.- Análisis del atributo NEXT-HOP en los anuncios BGP:

 

8.1.- Anuncio eBGP (external BGP o entre diferentes AS):

 

Breve descripción del asunto (obtenido del RFC 4271 que define el BGP):

 

The NEXT_HOP is a well-known mandatory attribute that defines the IP address of the router that SHOULD be used as the next hop to the

destinations listed in the UPDATE message.  The NEXT_HOP attribute is calculated as follows:

 

       2) When sending a message to an external peer, X, and the peer is one IP hop away from the speaker:

 

         - If the route being announced was learned from an internal peer or is locally originated, the BGP speaker can use an

           interface address of the internal peer router (or the internal router) through which the announced network is reachable

           for the speaker for the NEXT_HOP attribute, provided that peer X shares a common subnet with this address. 

           This is a form of "third party" NEXT_HOP attribute. (o sea BGP-2 y BGP-3 deberían compartir la misma red/subred)(no aplica)

 

         - Otherwise, if the route being announced was learned from an external peer, the speaker can use an IP address of any

           adjacent router (known from the received NEXT_HOP attribute) that the speaker itself uses for local route calculation in

           the NEXT_HOP attribute, provided that peer X shares a common subnet with this address.  This is a second form of "third

           party" NEXT_HOP attribute. (no aplica)

 

         - Otherwise, if the external peer to which the route is being advertised shares a common subnet with one of the interfaces

           of the announcing BGP speaker, the speaker MAY use the IP address associated with such an interface in the NEXT_HOP

           attribute.  This is known as a "first party" NEXT_HOP attribute. (sí aplica)

 

         - By default (if none of the above conditions apply), the BGP speaker SHOULD use the IP address of the interface that the

           speaker uses to establish the BGP connection to peer X in the NEXT_HOP attribute. (también aplica)

 

 

Este es el anuncio (UPDATE) entre BGP-1 y BGP-2 para las redes que publica BGP-3, se puede ver que el next-hop no es el

del router BGP-3 sino que es el mismo BGP-1 que se declara next-hop:

 

 

Frame 1: 99 bytes on wire (792 bits), 99 bytes captured (792 bits)

Ethernet II, Src: 00:17:95:c0:ac:a2, Dst: d4:ca:6d:a4:2e:22

Internet Protocol Version 4, Src: 190.0.0.1, Dst: 190.0.0.2

Transmission Control Protocol, Src Port: 15525, Dst Port: 179, Seq: 1, Ack: 1, Len: 45

Border Gateway Protocol - UPDATE Message

    Marker: ffffffffffffffffffffffffffffffff

    Length: 45

    Type: UPDATE Message (2)

    Withdrawn Routes Length: 0

    Total Path Attribute Length: 18

    Path attributes

        Path Attribute - ORIGIN: IGP

        Path Attribute - AS_PATH: 65531

        Path Attribute - NEXT_HOP: 190.0.0.1

    Network Layer Reachability Information (NLRI)

        181.0.4.0/24

        181.0.5.0/24

        181.0.6.0/24

 

8.2.- Anuncios iBGP (internal BGP o dentro del mismo AS):

 

Breve descripción del asunto (obtenido del RFC 4271 que define el BGP):

 

The NEXT_HOP is a well-known mandatory attribute that defines the IP address of the router that SHOULD be used as the next hop to the

destinations listed in the UPDATE message.  The NEXT_HOP attribute is calculated as follows:

 

      1) When sending a message to an internal peer, if the route is not locally originated, the BGP speaker SHOULD NOT modify the

         NEXT_HOP attribute unless it has been explicitly configured to announce its own IP address as the NEXT_HOP. 

         When announcing a locally-originated route to an internal peer, the BGP speaker SHOULD use the interface address of the router

         through which the announced network is reachable for the speaker as the NEXT_HOP. 

         If the route is directly connected to the speaker, or if the interface address of the router through which the announced network is

         reachable for the speaker is the internal peer's address, then the BGP speaker SHOULD use its own IP address for the NEXT_HOP

         attribute (the address of the interface that is used to reach the peer).

 

8.2.1.- Captura del update sin next-hop-self declarado:

 

Frame 1: 113 bytes on wire (904 bits), 113 bytes captured (904 bits)

Ethernet II, Src: 00:17:95:c0:ac:a3, Dst: cc:46:d6:2b:5a:54

Internet Protocol Version 4, Src: 181.0.0.1, Dst: 181.0.0.2

Transmission Control Protocol, Src Port: 179, Dst Port: 31055, Seq: 1, Ack: 1, Len: 59

Border Gateway Protocol - UPDATE Message

    Marker: ffffffffffffffffffffffffffffffff

    Length: 59

    Type: UPDATE Message (2)

    Withdrawn Routes Length: 0

    Total Path Attribute Length: 32

    Path attributes

        Path Attribute - ORIGIN: IGP

        Path Attribute - AS_PATH: 65530

        Path Attribute - NEXT_HOP: 190.0.0.2

        Path Attribute - MULTI_EXIT_DISC: 0

        Path Attribute - LOCAL_PREF: 100

    Network Layer Reachability Information (NLRI)

        200.0.3.0/24

 

En el caso de que la red 190.0.0.0/24 estuviese publicada o alcanzable:

 

En el caso de que la red 190.0.0.0/24 no estuviese publicada o fuese inalcanzable:

 

 

8.2.2.- Captura del update con next-hop-self:

 

 

Frame 1: 113 bytes on wire (904 bits), 113 bytes captured (904 bits)

Ethernet II, Src: 00:17:95:c0:ac:a3, Dst: cc:46:d6:2b:5a:54

Internet Protocol Version 4, Src: 181.0.0.1, Dst: 181.0.0.2

Transmission Control Protocol, Src Port: 179, Dst Port: 31055, Seq: 236, Ack: 39, Len: 59

Border Gateway Protocol - UPDATE Message

    Marker: ffffffffffffffffffffffffffffffff

    Length: 59

    Type: UPDATE Message (2)

    Withdrawn Routes Length: 0

    Total Path Attribute Length: 32

    Path attributes

        Path Attribute - ORIGIN: IGP

        Path Attribute - AS_PATH: 65530

        Path Attribute - NEXT_HOP: 181.0.0.1

        Path Attribute - MULTI_EXIT_DISC: 0

        Path Attribute - LOCAL_PREF: 100

    Network Layer Reachability Information (NLRI)

        200.0.3.0/24

 

 

Recordemos que en este escenario la red/subred 190.0.0.0/24 no está publicada en el BGP, y por lo tanto utilizaremos 181.0.0.1 como next-hop.

 

BGP-1#sh runn | sec bgp (no esta declarada la red/subred 190.0.0.0/24)

router bgp 65531

 no synchronization

 bgp log-neighbor-changes

 network 181.0.1.0 mask 255.255.255.0

 network 181.0.2.0 mask 255.255.255.0

 network 181.0.3.0 mask 255.255.255.0

 neighbor 181.0.0.2 remote-as 65531

 neighbor 181.0.0.2 next-hop-self

 neighbor 190.0.0.2 remote-as 65530

 no auto-summary

BGP-1#

 

 

(2023) Who need information ?

Rosario, Argentina