LAB BPG 1

 Topología

 

Descripción: La idea es establecer las conexiones entre los diferentes  AS por lo cual debemos configurar las interfaces entre las diferentes fronteras.

Debemos configurar el direccionemiento IP y los protocolos correspondientes para que funcione.

Objetivo: Poder alcanzar la red 8.8.8.8 que simula ser internet y se encuentra publicada hacia el ROUTER A desde ROUTER B, C y D.

 

 

 

 

Configuraciones: 

Router-A (AS 65000)

INTERFACES:

set interfaces ge-0/0/0 unit 0 family inet address 10.1.2.1/30
set interfaces ge-0/0/1 unit 0 family inet address 10.1.3.1/30
set interfaces ge-0/0/5 unit 0 family inet address 10.1.4.1/30
set interfaces lo0 unit 0 family inet address 192.168.10.1/32 

 

POLÍTICAS:

set policy-options policy-statement EXPORT-MI-RED term 1 from protocol direct
set policy-options policy-statement EXPORT-MI-RED term 1 from route-filter 192.168.10.1/32 exact
set policy-options policy-statement EXPORT-MI-RED term 1 then accept 

 # Esta politica sirve para asignar un local preference mas alto para preferir una salida sobre otra#

set policy-options policy-statement PREFERIR-C term 1 then local-preference 200
set policy-options policy-statement PREFERIR-C term 1 then accept 

 

BGP: 

# Definir el Sistema Autónomo local
set routing-options autonomous-system 65000

# Configurar el grupo de vecinos eBGP
set protocols bgp group EBGP-ISPS type external
set protocols bgp group EBGP-ISPS export EXPORT-MI-RED


# Vecino ISP-B
set protocols bgp group EBGP-ISPS neighbor 10.1.2.2 peer-as 65001

# Vecino ISP-C (El preferido)
set protocols bgp group EBGP-ISPS neighbor 10.1.3.2 import PREFERIR-C
set protocols bgp group EBGP-ISPS neighbor 10.1.3.2 peer-as 65002


# Vecino ISP-D
set protocols bgp group EBGP-ISPS neighbor 10.1.4.2 peer-as 65001 

 

Local Preference: Explica que aunque tienes tres salidas, el comando local-preference 200 obliga a que el tráfico de salida elija siempre al Router-C (10.1.3.2) mientras esa ruta esté disponible.

Filtrado de Anuncios: Con EXPORT-MI-RED, te aseguras de que ROUTER-A solo anuncie su IP pública/local y no se convierta en un "tránsito" accidental entre ISPs.

Redundancia: Destaca que si el enlace ge-0/0/1 cae, BGP automáticamente bajará la preferencia y usará los vecinos con Local-Pref 100 (B o D). 

 

 

  

 

Router-B (AS 65001)

 

 INTERFACES:

set interfaces ge-0/0/0 unit 0 family inet address 10.1.2.2/30
set interfaces ge-0/0/1 unit 0 family inet address 10.1.6.2/30
set interfaces ge-0/0/9 unit 0 family inet address 10.1.9.1/30
set interfaces ge-0/0/9 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 2.2.2.2/32 

# Activamos MPLS en la ge-0/0/9 ya que es en ese AS hay 2 routers que se comunican entre ellos.# 

 

IGP y MPLS (El Transporte Interno)

Para que el iBGP funcione entre el Router-B y el Router-D (usando sus Loopbacks), primero necesitamos que se conozcan por OSPF. Además, habilitamos MPLS para un transporte eficiente.

# OSPF para alcanzar las Loopbacks internas
set protocols ospf traffic-engineering shortcuts
set protocols ospf area 0.0.0.0 interface ge-0/0/9.0
set protocols ospf area 0.0.0.0 interface lo0.0


# MPLS y RSVP (Requerido para el core del ISP)
set protocols mpls interface ge-0/0/9.0
set protocols mpls interface lo0.0
set protocols rsvp interface ge-0/0/9.0
set protocols rsvp interface lo0.0 

 

Políticas: 

 

# Política para anunciar solo la Loopback al cliente
set policy-options policy-statement SEND-LO0 term 1 from protocol direct
set policy-options policy-statement SEND-LO0 term 1 from route-filter 2.2.2.2/32 exact
set policy-options policy-statement SEND-LO0 term 1 then accept

set policy-options policy-statement SEND-LO0 term 2 from protocol bgp set policy-options policy-statement SEND-LO0 term 2 from route-filter 8.8.8.8/32 exact set policy-options policy-statement SEND-LO0 term 2 then accept 

set policy-options policy-statement SEND-LO0 then reject  

# Regla de Oro de iBGP: Mantenerse a sí mismo como Next-Hop
set policy-options policy-statement NEXT-HOP-SELF term 1 then next-hop self
set policy-options policy-statement NEXT-HOP-SELF term 1 then accept 

 

BGP:

set routing-options autonomous-system 65001

# Grupo 1: Cliente A (eBGP)
set protocols bgp group CLIENTE-A type external
set protocols bgp group CLIENTE-A neighbor 10.1.2.1 export SEND-LO0
set protocols bgp group CLIENTE-A neighbor 10.1.2.1 peer-as 65000

# Grupo 2: Interno hacia Router-D (iBGP)
set protocols bgp group IBGP-INTERNO type internal
set protocols bgp group IBGP-INTERNO local-address 2.2.2.2
set protocols bgp group IBGP-INTERNO neighbor 4.4.4.4 export NEXT-HOP-SELF

# Grupo 3: Salida a Internet con Google (eBGP)
set protocols bgp group HACIA-GOOGLE type external
set protocols bgp group HACIA-GOOGLE neighbor 10.1.6.1 peer-as 15169 

 

Router-C (AS 65002) 

 INTERFACES: 

set interfaces ge-0/0/1 unit 0 family inet address 10.1.3.2/30
set interfaces ge-0/0/2 unit 0 family inet address 10.1.7.2/30
set interfaces lo0 unit 0 family inet address 3.3.3.3/32 

POLÍTICAS:

# Término 1: Permitir la red propia (Loopback)
set policy-options policy-statement SEND-LO0 term 1 from protocol direct
set policy-options policy-statement SEND-LO0 term 1 from route-filter 3.3.3.3/32 exact
set policy-options policy-statement SEND-LO0 term 1 then accept


# Término 2: Permitir la ruta específica de Google
set policy-options policy-statement SEND-LO0 term 2 from protocol bgp
set policy-options policy-statement SEND-LO0 term 2 from route-filter 8.8.8.8/32 exact
set policy-options policy-statement SEND-LO0 term 2 then accept


# Bloqueo total: No anunciar nada que no esté arriba
set policy-options policy-statement SEND-LO0 then reject

 

BGP:

set routing-options autonomous-system 65002

# Grupo hacia el Cliente A
set protocols bgp group CLIENTE-A type external
set protocols bgp group CLIENTE-A neighbor 10.1.3.1 export SEND-LO0
set protocols bgp group CLIENTE-A neighbor 10.1.3.1 peer-as 65000

# Grupo hacia Google (Peering)
set protocols bgp group HACIA-GOOGLE type external
set protocols bgp group HACIA-GOOGLE neighbor 10.1.7.1 peer-as 15169 

 

Router-D (AS 65001) 

INTERFACES:

set interfaces ge-0/0/0 unit 0 family inet address 10.1.5.2/30
set interfaces ge-0/0/5 unit 0 family inet address 10.1.4.2/30
set interfaces ge-0/0/9 unit 0 family inet address 10.1.9.2/30
set interfaces ge-0/0/9 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 4.4.4.4/32 

IGP y MPLS 

set protocols ospf traffic-engineering shortcuts
set protocols ospf area 0.0.0.0 interface ge-0/0/9.0
set protocols ospf area 0.0.0.0 interface lo0.0

set protocols mpls interface ge-0/0/9.0
set protocols mpls interface lo0.0
set protocols rsvp interface ge-0/0/9.0
set protocols rsvp interface lo0.0

 

POLÍTICA: 

# Política para aceptar SOLO la red del cliente (Seguridad de entrada)
set policy-options policy-statement RECIBIR-CLIENTE-A term 1 from route-filter 192.168.10.1/32 exact
set policy-options policy-statement RECIBIR-CLIENTE-A term 1 then accept
set policy-options policy-statement RECIBIR-CLIENTE-A then reject

# Regla de iBGP para el Router-B
set policy-options policy-statement NEXT-HOP-SELF term 1 then next-hop self
set policy-options policy-statement NEXT-HOP-SELF term 1 then accept 

 

 BGP:

set routing-options autonomous-system 65001

# iBGP hacia el Router-B
set protocols bgp group IBGP-INTERNO type internal
set protocols bgp group IBGP-INTERNO local-address 4.4.4.4
set protocols bgp group IBGP-INTERNO neighbor 2.2.2.2 export NEXT-HOP-SELF


# eBGP hacia Cliente A
set protocols bgp group CLIENTE-A type external
set protocols bgp group CLIENTE-A neighbor 10.1.4.1 peer-as 65000
set protocols bgp group CLIENTE-A neighbor 10.1.4.1 import RECIBIR-CLIENTE-A


# eBGP hacia Google
set protocols bgp group HACIA-GOOGLE type external
set protocols bgp group HACIA-GOOGLE neighbor 10.1.5.1 peer-as 15169 

 

 

Google (AS 15169) - Cisco IOS 

 

interface Loopback0
 ip address 8.8.8.8 255.255.255.255
 exit

interface GigabitEthernet0/0
 description HACIA-ROUTER-D-65001
 ip address 10.1.5.1 255.255.255.252
 no shutdown

interface GigabitEthernet0/1
 description HACIA-ROUTER-B-65001
 ip address 10.1.6.1 255.255.255.252
 no shutdown

interface GigabitEthernet0/2
 description HACIA-ROUTER-C-65002
 ip address 10.1.7.1 255.255.255.252
 no shutdown 

router bgp 15169
 bgp log-neighbor-changes
 
 # Anunciar la red de Google al mundo
 network 8.8.8.8 mask 255.255.255.255
 
 # Vecinos eBGP
 neighbor 10.1.5.2 remote-as 65001
 neighbor 10.1.6.2 remote-as 65001
 neighbor 10.1.7.2 remote-as 65002 

  

 

 

No hay comentarios:

Publicar un comentario

  ¡Bienvenido/a Si estás aquí, es porque las redes, los cables, los routers y las configuraciones ya no son un misterio… o quizá justo lo ...