Sesion BGP ipv4 con carrier, Realizando el Prepend

Objetivo
Configurar y verificar políticas de enrutamiento BGP , utilizando los atributos de AS-PATH prepend, con el fin de establecer una preferencia de ruta de salida y controlar la ruta de entrada para el tráfico de Internet, priorizando el proveedor Liberty y utilizando a Cirion como respaldo automático.

PASO 1 Crear el Laboratorio en EVE-NG

Nombre:  Topologia.png
Visitas: 5
Tamaño: 360.0 KB

Nota

Scripts


/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing bgp instance
set default as=15169 redistribute-connected=yes
/ip address
add address=2.2.2.2/24 comment="PTP RB-LIBERTY" interface=ether2 network=\
2.2.2.0
add address=8.8.8.1/24 comment="PTP SERVER GOOGLE" interface=ether1 network=\
8.8.8.0
add address=3.3.3.2/24 comment="PTP FESOGO" interface=ether3 network=3.3.3.0
/ip dhcp-client
add disabled=no interface=ether1
/routing bgp peer
add name=peer-to-liberty remote-address=2.2.2.1 remote-as=6830
add name=peer-to-cirion remote-address=3.3.3.1 remote-as=272314
/system identity
set name=RB-GOOGLE
/tool romon
set enabled=yes




/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing bgp instance
set default as=272314 redistribute-connected=yes
/ip address
add address=3.3.3.1/24 comment="PTP GOOGLE" interface=ether3 network=3.3.3.0
add address=204.199.201.97/30 comment="PTP BORDE ARISTA" interface=ether4 \
network=204.199.201.96
/ip dhcp-client
add disabled=no interface=ether1
/routing bgp peer
add name=peer-to-google remote-address=3.3.3.2 remote-as=15169
add multihop=yes name=peer-to-borde remote-address=204.199.201.98 remote-as=\
270200
/system identity
set name=RB-FESOGO
/tool romon
set enabled=yes


/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing bgp instance
set default as=6830 redistribute-connected=yes
/ip address
add address=181.191.190.54/28 comment="PTP-BORDE ARISTA" interface=ether4 \
network=181.191.190.48
add address=2.2.2.1/24 comment="PTP GOOGLE" interface=ether2 network=2.2.2.0
/ip dhcp-client
add disabled=no interface=ether1
/routing bgp peer
add name=peer-togoogle remote-address=2.2.2.2 remote-as=15169
add name=peer-to-Borde-Arista remote-address=181.191.190.55 remote-as=270200
/system identity
set name=RB-LIBERTY
/tool romon
set enabled=yes



/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing bgp instance
set default as=270200 redistribute-connected=yes
/ip address
add address=181.191.190.55/29 comment=PTP-LIBERTY interface=ether4 network=\
181.191.190.48
add address=204.199.201.98/30 comment="PTP FESOGO" interface=ether5 network=\
204.199.201.96
add address=190.9.108.1/24 comment="IP PUBLICA" interface=ether3 network=\
190.9.108.0
/ip dhcp-client
add disabled=no interface=ether1
/ip route
add comment="RUTA SALIDA INTERNET 1" distance=1 gateway=181.191.190.54
add comment="RUTA SALIDA INTERNET" distance=2 gateway=204.199.201.97
/routing bgp network
add network=190.9.108.0/22 synchronize=no
/routing bgp peer
add in-filter=ruta_larga name=peer-to-liberty out-filter=ruta_out \
remote-address=181.191.190.54 remote-as=6830
add name=peer-to-fesogo remote-address=204.199.201.97 remote-as=272314
/routing filter
add action=accept chain=cirion-in prefix=0.0.0.0/0
add action=accept bgp-local-pref=200 chain=cirion-out prefix=190.9.108.0/22 \
set-bgp-prepend=3
add action=accept bgp-local-pref=100 chain=liberty-out prefix=190.9.108.0/22
add action=accept chain=ruta_larga set-bgp-prepend=2
add action=accept chain=ruta_out set-bgp-prepend=2
/system identity
set name=RB-BORDE-ARISTA
/tool romon
set enabled=yes


/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip address
add address=190.9.108.2/24 comment="IP PUBLICA" interface=ether3 network=\
190.9.108.0
add address=192.168.20.1/24 comment="LAN CLIENTE" interface=ether5 network=\
192.168.20.0
/ip dhcp-client
add disabled=no interface=ether1
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether3
/ip route
add comment=INTERNET distance=1 gateway=190.9.108.1
/tool romon
set enabled=yes




Archivos descargables
Aqui puedes decargar el laboratorio

_Exports_unetlab_export-20250718-182914.zip


Basado en el siguiente manual :
REFERENCIAS

Basado en el siguiente manual :
Escenario full routing BGP y ruta por defecto BGP
https://foroisp.com/threads/2011-Esc...or-defecto-BGP


Sesion BGP ipv4 con ruta por defecto y NAT clientes residenciales
https://foroisp.com/threads/2053-BGP-en-Microtik-con-2-ASN?p=2866#post2866

Sesion BGP ipv4 con carrier, entregando IP publicas a cliente comercial Con 3 opciones
https://foroisp.com/threads/2061-Lab...=2888#post2888