0% found this document useful (0 votes)
6 views7 pages

LinkedIn BGP Local Preference

El documento detalla un laboratorio sobre la configuración de BGP y la modificación del atributo Local Preference para dirigir el tráfico saliente del AS1 a través de R2. Se presentan configuraciones específicas para los routers R1, R2 y R3, así como pasos para verificar la conectividad y el enrutamiento. Finalmente, se muestra cómo aplicar un Route Map para incrementar el Local Preference y asegurar que R1 elija la ruta a través de R2.

Uploaded by

Carlos Machado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views7 pages

LinkedIn BGP Local Preference

El documento detalla un laboratorio sobre la configuración de BGP y la modificación del atributo Local Preference para dirigir el tráfico saliente del AS1 a través de R2. Se presentan configuraciones específicas para los routers R1, R2 y R3, así como pasos para verificar la conectividad y el enrutamiento. Finalmente, se muestra cómo aplicar un Route Map para incrementar el Local Preference y asegurar que R1 elija la ruta a través de R2.

Uploaded by

Carlos Machado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Aprende Configurando

Influenciar Tráfico Saliente


con Local Preference

Pedro Lino Cáceres


Topología a configurar
192.168.12.0/24
192.168.23.0/24

192.168.13.0/24
1.1.1.1/32 3.3.3.3/32

BGP

Objetivo de laboratorio:

Configurar BGP
Modificar el Atributo Local Preference para que todo el tráifco saliente del

AS1, salga por R2 (AS 2), se usará Route Map.


Configuración de los Routers
Configuración de R1 Configuración de R2
! !
hostname R1 hostname R2
! !
interface Loopback0 interface Loopback0
ip address 1.1.1.1 255.255.255.255 ip address 2.2.2.2 255.255.255.255
! !
interface GigabitEthernet0/0 interface GigabitEthernet0/0
ip address 192.168.12.1 255.255.255.0 ip address 192.168.12.2 255.255.255.0
! interface GigabitEthernet2/0
interface GigabitEthernet1/0 ip address 192.168.23.2 255.255.255.0
ip address 192.168.13.1 255.255.255.0 !
! router bgp 2
router bgp 1 bgp log-neighbor-changes
bgp log-neighbor-changes network 2.2.2.2 mask 255.255.255.255
network 1.1.1.1 mask 255.255.255.255 neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.2 remote-as 2 neighbor 192.168.23.3 remote-as 3
neighbor 192.168.13.3 remote-as 3 !
!

Configuración de R3

!
hostname R3
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet1/0
ip address 192.168.13.3 255.255.255.0
negotiation auto
!
interface GigabitEthernet2/0
ip address 192.168.23.3 255.255.255.0
negotiation auto
!
router bgp 3
bgp log-neighbor-changes
network 3.3.3.3 mask 255.255.255.255
neighbor 192.168.13.1 remote-as 1
neighbor 192.168.23.2 remote-as 2
!
Verificación:

R1#show ip route bgp


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

2.0.0.0/32 is subnetted, 1 subnets


B 2.2.2.2 [20/0] via 192.168.12.2, 00:08:48
3.0.0.0/32 is subnetted, 1 subnets
B 3.3.3.3 [20/0] via 192.168.13.3, 00:08:48

Se observa que R1 aprende como alcanzar la red 3.3.3.3 vía R3 (AS 3).

R1#show ip bgp 3.3.3.3


BGP routing table entry for 3.3.3.3/32, version 7
Paths: (2 available, best #2, table default)
Advertised to update-groups:
1
Refresh Epoch 3
23
192.168.12.2 from 192.168.12.2 (2.2.2.2)
Origin IGP, localpref 100, valid, external
Refresh Epoch 2
3
192.168.13.3 from 192.168.13.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, external, best
También podemos comprobar realizando el Traceroute desde R1.

R1#traceroute 3.3.3.3 source 1.1.1.1


Type escape sequence to abort.
Tracing the route to 3.3.3.3
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.13.3 24 msec 16 msec 12 msec

Ahora apliquemos un Route Map en R1 e incrementemos el Local Preference a 150 para las Rutas
aprendidas de R2, el valor por default es 100.

R1(config)#route-map FROM_R2 permit 10


R1(config-route-map)#set local-preference 150
R1(config-route-map)#exit
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 route-map FROM_R2 in
R1(config-router)#^Z
R1#clear ip bgp * in

Verificamos:

R1#show ip route bgp


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

2.0.0.0/32 is subnetted, 1 subnets


B 2.2.2.2 [20/0] via 192.168.12.2, 00:00:29
3.0.0.0/32 is subnetted, 1 subnets
B 3.3.3.3 [20/0] via 192.168.12.2, 00:00:29
R1#show ip bgp 3.3.3.3
BGP routing table entry for 3.3.3.3/32, version 9
Paths: (2 available, best #1, table default)
Advertised to update-groups:
1
Refresh Epoch 4
23
192.168.12.2 from 192.168.12.2 (2.2.2.2)
Origin IGP, localpref 150, valid, external, best
Refresh Epoch 3
3
192.168.13.3 from 192.168.13.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, external
R1#
R1#trace
R1#traceroute 3.3.3.3 sou
R1#traceroute 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 3.3.3.3
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.12.2 16 msec 16 msec 20 msec
2 192.168.23.3 16 msec 16 msec 20 msec

Ahora podemos ver que la mejor ruta es vía R2 (AS 2), ya que tiene un valor de Local Preference de
150 vs 100, y este atributo se toma en cuenta primero que el AS Path.
Si te gustó la guía por favor darle like y compartirlo con todos los que
consideres le puede servir.

Sígueme para más contenido de este tipo. Y si aún no estás suscrito a mi


canal de Youtube te invito a que lo hagas, escaneando el siguiente
código QR:

Aprende Configurando

Pedro Lino Cáceres

You might also like