0% found this document useful (0 votes)
128 views

Pract RIP, OSPF, BGP Mikrotik

This document describes a lab experiment combining OSPF, BGP, and RIPv2 routing protocols on MikroTik routers. OSPF is configured between routers R1-R2-R3. RIPv2 is configured between routers R4-R5-R6. BGP is configured between routers R3 and R4. Redistribution of routes is then configured between the routing protocols to advertise all connected networks.

Uploaded by

jluisluis728
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)
128 views

Pract RIP, OSPF, BGP Mikrotik

This document describes a lab experiment combining OSPF, BGP, and RIPv2 routing protocols on MikroTik routers. OSPF is configured between routers R1-R2-R3. RIPv2 is configured between routers R4-R5-R6. BGP is configured between routers R3 and R4. Redistribution of routes is then configured between the routing protocols to advertise all connected networks.

Uploaded by

jluisluis728
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/ 8

OSPF - BGP - RIPv2 MikroTik

Esta vez vamos a probar el laboratorio mediante la combinación de OSPF, BGP y RIPv2.
La topología es más o menos como sigue:

R1-R2-R3 conectados mediante OSPF


R4-R5-R6 conectados mediante RIPv2
R3-R4 conectados mediante BGP
A partir de la primera Área OSPF
Configuraremos el R1

[admin@MikroTik] > system identity set name=R1


[admin@R1] > int br add name=lo1
[admin@R1] > ip add add add=1.1.1.1/32 interface=lo1
[admin@R1] > ip add add add=13.13.13.1/24 int=ether1
[admin@R1] > routing ospf instance set default router-id=1.1.1.1
[admin@R1] > routing ospf network add network=1.1.1.1/32 area=backbone
[admin@R1] > routing ospf network add network=13.13.13.0/24 area=backbone

Configuraremos el R2

[admin@MikroTik] > system identity set name=R2


[admin@R2] > int br add name=lo1
[admin@R2] > ip add add add=2.2.2.2/32 interface=lo1
[admin@R2] > ip add add add=23.23.23.2/24 int=ether1
[admin@R2] > routing ospf instance set default router-id=2.2.2.2
[admin@R2] > routing ospf network add network=2.2.2.2/32 area=backbone
[admin@R2] > routing ospf network add network=23.23.23.0/24 area=backbone

Configuraremos R3

[admin@MikroTik] > system identity set name=R3


[admin@R3] > int br add name=lo1
[admin@R3] > ip add add add=3.3.3.3/32 int=lo1
[admin@R3] > ip add add add=13.13.13.3/24 int=ether1
[admin@R3] > ip add add add=23.23.23.3/24 int=ether2
[admin@R3] > ip add add add=34.34.34.3/24 interface=ether3
[admin@R3] > routing ospf instance set default router-id=3.3.3.3
[admin@R3] > routing ospf network add network=3.3.3.3/32 area=backbone
[admin@R3] > routing ospf network add network=13.13.13.0/24 area=backbone
[admin@R3] > routing ospf network add net=23.23.23.0/24 area=backbone
[admin@R3] > routing ospf network add network=34.34.34.0/24 area=backbone

Verificaremos en R1

[admin@R1] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADC 1.1.1.1/32 1.1.1.1 lo1 0
1 ADo 3.3.3.3/32 13.13.13.3 110
2 ADC 13.13.13.0/24 13.13.13.1 ether1 0
3 ADo 23.23.23.0/24 13.13.13.3 110
4 ADo 34.34.34.0/24 13.13.13.3 110

Verificaremos en R2

[admin@R2] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADo 1.1.1.1/32 23.23.23.3 110
1 ADC 2.2.2.2/32 2.2.2.2 lo1 0
2 ADo 3.3.3.3/32 23.23.23.3 110
3 ADo 13.13.13.0/24 23.23.23.3 110
4 ADC 23.23.23.0/24 23.23.23.2 ether1 0
5 ADo 34.34.34.0/24 23.23.23.3 110

Verificación en R3

[admin@R3] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADo 1.1.1.1/32 13.13.13.1 110
1 ADC 3.3.3.3/32 3.3.3.3 lo1 0
2 ADC 13.13.13.0/24 13.13.13.3 ether1 0
3 ADC 23.23.23.0/24 23.23.23.3 ether2 0
4 ADC 34.34.34.0/24 34.34.34.3 ether3 0

Continuaremos con RIPv2 en R4-R5-R6


Configuramos R4

[admin@MikroTik] > system identity set name=R4


[admin@R4] > interface bridge add name=lo1
[admin@R4] > ip add add add=4.4.4.4/32 interface=lo1
[admin@R4] > ip add add add=45.45.45.4/24 interface=ether1
[admin@R4] > ip add add add=46.46.46.4/24 interface=ether2
[admin@R4] > ip add add add=34.34.34.4/24 interface=ether3
[admin@R4] > routing rip interface add interface=ether1 send=v2 receive=v2
[admin@R4] > routing rip network add network=46.46.46.0/24
[admin@R4] > routing rip net add net=45.45.45.0/24

Configuramos R5

[admin@MikroTik] > system identity set name=R5


[admin@R5] > interface bridge add name=lo1
[admin@R5] > ip add add add=5.5.5.5/32 int=lo1
[admin@R5] > ip add add add=45.45.45.5/24 interface=ether1
[admin@R5] > routing rip interface add interface=ether1 receive=v2 send=v2
[admin@R5] > routing rip network add network=5.5.5.5/32
[admin@R5] > routing rip network add network=45.45.45.0/24
Configuramos R6

[admin@MikroTik] > system identity set name=R6


[admin@R6] > interface bridge add name=lo1
[admin@R6] > ip add add add=6.6.6.6/32 interface=lo1
[admin@R6] > ip add add add=46.46.46.6/24 interface=ether1
[admin@R6] > routing rip interface add interface=ether1 send=v2 receive=v2
[admin@R6] > routing rip network add network=6.6.6.6/32
[admin@R6] > routing rip network add network=46.46.46.0/24

Verificamos R4

[admin@R4] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADC 4.4.4.4/32 4.4.4.4 lo1 0
1 ADr 5.5.5.5/32 45.45.45.5 120
2 ADr 6.6.6.6/32 46.46.46.6 120
3 ADC 34.34.34.0/24 34.34.34.4 ether3 0
4 ADC 45.45.45.0/24 45.45.45.4 ether1 0
5 ADC 46.46.46.0/24 46.46.46.4 ether2 0

Verificamos R5

[admin@R5] > ip route pr


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADC 5.5.5.5/32 5.5.5.5 lo1 0
1 ADr 6.6.6.6/32 45.45.45.4 120
2 ADC 45.45.45.0/24 45.45.45.5 ether1 0
3 ADr 46.46.46.0/24 45.45.45.4 120
Verificación en R6

[admin@R6] > ip route pr


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADr 5.5.5.5/32 46.46.46.4 120
1 ADC 6.6.6.6/32 6.6.6.6 lo1 0

2 ADr 45.45.45.0/24 46.46.46.4 120


3 ADC 46.46.46.0/24 46.46.46.6 ether1 0

Ahora configuraremos BGP entre R3-R4


Configuramos R3 para BGP

[admin@R3] > routing bgp instance set default as=300


[admin@R3] > routing bgp peer add name=peer-to-R4 remote-address=34.34.34.4 r
emote-as=400
[admin@R3] > routing bgp network add network=3.3.3.3/32
[admin@R3] > routing bgp network add network=13.13.13.0/24
[admin@R3] > routing bgp network add network=23.23.23.0/24

Configuramos el R4 para BGP

[admin@R4] > routing bgp instance set default as=400


[admin@R4] > routing bgp peer add name=peer-to-R3 remote-address=34.34.34.3 r
emote-as=300
[admin@R4] > routing bgp network add network=4.4.4.4/32
[admin@R4] > routing bgp network add network=45.45.45.0/24
[admin@R4] > routing bgp network add network=46.46.46.0/24
Verificamos R3 con BGP

[admin@R3] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADo 1.1.1.1/32 13.13.13.1 110
1 ADo 2.2.2.2/32 23.23.23.2 110
2 ADC 3.3.3.3/32 3.3.3.3 lo1 0
3 ADb 4.4.4.4/32 34.34.34.4 20
4 ADC 13.13.13.0/24 13.13.13.3 ether1 0
5 ADC 23.23.23.0/24 23.23.23.3 ether2 0
6 ADC 34.34.34.0/24 34.34.34.3 ether3 0
7 ADb 45.45.45.0/24 34.34.34.4 20
8 ADb 46.46.46.0/24 34.34.34.4 20

Verificamos R4 con BGP

[admin@R4] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADb 3.3.3.3/32 34.34.34.3 20
1 ADC 4.4.4.4/32 4.4.4.4 lo1 0
2 ADr 5.5.5.5/32 45.45.45.5 120
3 ADr 6.6.6.6/32 46.46.46.6 120
4 ADb 13.13.13.0/24 34.34.34.3 20
5 ADb 23.23.23.0/24 34.34.34.3 20
6 ADC 34.34.34.0/24 34.34.34.4 ether3 0
7 ADC 45.45.45.0/24 45.45.45.4 ether1 0
8 ADC 46.46.46.0/24 46.46.46.4 ether2 0

Ahora la pregunta es cómo hacer publicidad de las redes OSPF, BGP y RIPv2 a los router R1,
R2, R5 y R6 ?
Para hacer posible la redistribución BGP, OSPF y rip en R3 y R4 tenemos que hacer las
siguientes configuraciones
Configuramos R3

[admin@R3] > routing bgp instance set default redistribute-ospf=yes


[admin@R3] > routing ospf instance set default redistribute-bgp=as-type-1

config R4

[admin@R4] > routing bgp instance set default redistribute-rip=yes


[admin@R4] > routing rip set redistribute-bgp=yes

Verificamos R3

[admin@R3] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADo 1.1.1.1/32 13.13.13.1 110
1 ADo 2.2.2.2/32 23.23.23.2 110
2 ADC 3.3.3.3/32 3.3.3.3 lo1 0
3 ADb 4.4.4.4/32 34.34.34.4 20
4 ADb 5.5.5.5/32 34.34.34.4 20
5 ADb 6.6.6.6/32 34.34.34.4 20
6 ADC 13.13.13.0/24 13.13.13.3 ether1 0
7 ADC 23.23.23.0/24 23.23.23.3 ether2 0

8 ADC 34.34.34.0/24 34.34.34.3 ether3 0


9 ADb 45.45.45.0/24 34.34.34.4 20
10 ADb 46.46.46.0/24 34.34.34.4 20
Verificamos R4

[admin@R4] > ip route print


Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - ri
p, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADb 1.1.1.1/32 34.34.34.3 20
1 ADb 2.2.2.2/32 34.34.34.3 20
2 ADb 3.3.3.3/32 34.34.34.3 20
3 ADC 4.4.4.4/32 4.4.4.4 lo1 0
4 ADr 5.5.5.5/32 45.45.45.5 120
5 ADr 6.6.6.6/32 46.46.46.6 120
6 ADb 13.13.13.0/24 34.34.34.3 20
7 ADb 23.23.23.0/24 34.34.34.3 20
8 ADC 34.34.34.0/24 34.34.34.4 ether3 0
9 ADC 45.45.45.0/24 45.45.45.4 ether1 0
10 ADC 46.46.46.0/24 46.46.46.4 ether2 0

Y finalmente para tener completas todas las tablas de enrutamiento, comprobar también R1,
R2, R5 y R6.
Una vez comprobado tratar de ping desde R1 a R6 o desde cualquier Router

[admin@R1] > ping 6.6.6.6


SEQ HOST SIZE TTL TIME STATUS
0 6.6.6.6 56 62 98ms
1 6.6.6.6 56 62 208ms
2 6.6.6.6 56 62 375ms
3 6.6.6.6 56 62 238ms
4 6.6.6.6 56 62 308ms
5 6.6.6.6 56 62 215ms
6 6.6.6.6 56 62 409ms
7 6.6.6.6 56 62 351ms
8 6.6.6.6 56 62 377ms
9 6.6.6.6 56 62 360ms
sent=10 received=10 packet-loss=0% min-rtt=98ms avg-rtt=297ms max-rtt=409ms

You might also like