Idea: Intercambiar rutas entre dos PE usando un core de P MPLS. Es decir, sin usar VPN (i.e. VRF) lograr que un enlace en un PE (R2 en el esquema siguiente) se vea por iBGP en el otro PE (R3) y viceversa. De esta forma dos CE conectados a RE2 y RE3 podrían hacerse ping a través de la red MPLS.
Los caminos los voy a construir estáticos, es decir sin usar ningún protocolo dinámico de distribución de etiquetas MPLS (LDP o RSVP). Los caminos estáticos no son útiles en la realidad, pero en este caso sirven para aprender el funcionamiento básico de MPLS.
Esquema
El esquema de red que uso es el siguiente (con los nombres de las interfaces):
- R1 hace de CE con dos routing-instance de tipo virtual router: HostA y HostB. De esta forma puedo hacer Ping de la IP de em0 (10.10.10.1) a la de em1 (10.20.10.2) sin que vaya internamente por el mismo router.
- R2 y R3 hacen de PE.
- R4,R5 y R6 hacen de P.
- Como protocolo IGP (para distribución de IP de enlaces y de loopbacks) entre los P y los PE uso OSPF, un sólo area 0.
- Se configuran todos los enlaces, pero el enlace entre R3 y R4 (a traves de em0) no se va a configurar para MPLS. Por tanto el path LSP será: R3-R5-R6-R4-R2 y en sentido contrario (los LSP son unidireccionales y por tanto hay que construir dos): R2-R4-R6-R5-R3.
- Las etiquetas en sentido R3 hacia R2 serán 1000001 1000002 1000003 y 3 (implicit null)
- Las etiquetas en sentido R2 hacia R3 serán 1000011 1000012 1000013 y 3
Configuración CEs
La configuración de R1 haciendo de CE es la siguiente. En amarillo la parte especifica que actúa de CE1 y en verde la parte que actúa de CE2:
system {
host-name R1;
root-authentication {
encrypted-password "$1$oPJYnaoh$ZyJ/ieC.lgVLoAoA3.zPD."; ## SECRET-DATA
}
services {
telnet;
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
vlan-tagging;
unit 1 {
vlan-id 1001;
family inet {
address 10.10.10.1/24;
}
}
}
em1 {
vlan-tagging;
unit 3 {
vlan-id 3;
family inet {
address 10.20.10.1/24;
}
}
}
}
routing-instances {
hostA {
instance-type virtual-router;
interface em0.1;
routing-options {
static {
route 10.20.10.0/24 next-hop 10.10.10.2;
}
}
}
hostB {
instance-type virtual-router;
interface em1.3;
routing-options {
static {
route 10.10.10.0/24 next-hop 10.20.10.2;
}
}
}
}
Configuración PEs
A continuación se incluye la configuración de los dos equipos que hacen de PE: R2 y R3:
system {
host-name R2;
root-authentication {
encrypted-password "$1$Jw.0VZSP$sxkITUBlphlWJTq3pdRTP."; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
vlan-tagging;
unit 1 {
vlan-id 1001;
family inet {
address 10.10.10.2/24;
}
}
unit 2 {
vlan-id 1002;
family inet {
address 10.10.20.2/24;
}
}
}
em1 {
vlan-tagging;
unit 4 {
vlan-id 4;
family inet {
address 10.30.10.1/24;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.2/32;
}
}
}
}
routing-options {
router-id 10.0.0.2;
autonomous-system 65000;
}
protocols {
mpls {
static-label-switched-path vuelta {
ingress {
next-hop 10.30.10.2;
to 10.0.0.3;
push 1000011;
}
}
interface em1.4;
}
bgp {
family inet {
unicast;
}
group core {
type internal;
local-address 10.0.0.2;
export [ next-hop-self exporta-enlace ];
neighbor 10.0.0.3;
neighbor 10.0.0.4;
neighbor 10.0.0.5;
neighbor 10.0.0.6;
}
}
ospf {
area 0.0.0.0 {
interface lo0.0;
interface em1.4;
}
}
}
policy-options {
prefix-list enlace {
10.10.10.0/24;
}
policy-statement exporta-enlace {
from {
protocol direct;
prefix-list enlace;
}
then accept;
}
policy-statement next-hop-self {
then {
next-hop self;
}
}
}
En R2 se puede ver que en el protocolo MPLS se configura el inicio (ingress) del LSP estático asignando al tráfico destinado a 10.0.0.3 (loopback de R3) la etiqueta 1000011.
system {
host-name R3;
root-authentication {
encrypted-password "$1$OoS84Uxm$GWMoPyU1oZjfAmj3i4n1O0"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
vlan-tagging;
unit 5 {
vlan-id 5;
family inet {
address 10.50.10.1/24;
}
}
}
em1 {
vlan-tagging;
unit 3 {
vlan-id 3;
family inet {
address 10.20.10.2/24;
}
}
}
em3 {
vlan-tagging;
unit 6 {
vlan-id 6;
family inet {
address 10.60.10.1/24;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.3/32;
}
}
}
}
routing-options {
router-id 10.0.0.3;
autonomous-system 65000;
}
protocols {
mpls {
static-label-switched-path ida {
ingress {
next-hop 10.60.10.2;
to 10.0.0.2;
push 1000001;
}
}
interface em3.6;
}
bgp {
family inet {
unicast;
}
group core {
type internal;
local-address 10.0.0.3;
export [ next-hop-self exporta-enlace ];
neighbor 10.0.0.4;
neighbor 10.0.0.5;
neighbor 10.0.0.6;
neighbor 10.0.0.2;
}
}
ospf {
area 0.0.0.0 {
interface em3.6;
interface lo0.0;
}
}
}
policy-options {
prefix-list enlace {
10.20.10.0/24;
}
policy-statement exporta-enlace {
from {
protocol direct;
prefix-list enlace;
}
then accept;
}
policy-statement next-hop-self {
then {
next-hop self;
}
}
}
En R3 se puede ver que en el protocolo MPLS se configura el inicio (ingress) del LSP estático asignando al tráfico destinado a 10.0.0.2 (loopback de R2) la etiqueta 1000001.
Configuración Ps
A continuación se muestra las configuraciones de los P intermedios: R4, R5 y R6. El punto interesante es ver su configuración MPLS con los dos LSP de tránsito estáticos en ambos sentidos.
R4:
system {
host-name R4;
root-authentication {
encrypted-password "$1$JKwti2ON$snLuu43gBIzZH.vyxRyzD/"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
vlan-tagging;
unit 5 {
vlan-id 5;
family inet {
address 10.50.10.2/24;
}
}
}
em1 {
vlan-tagging;
unit 4 {
vlan-id 4;
family inet {
address 10.30.10.2/24;
}
family mpls;
}
}
em3 {
vlan-tagging;
unit 8 {
vlan-id 8;
family inet {
address 10.80.10.1/24;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.4/32;
}
}
}
}
routing-options {
router-id 10.0.0.4;
autonomous-system 65000;
}
protocols {
mpls {
static-label-switched-path vuelta {
transit 1000011 {
next-hop 10.80.10.2;
swap 1000012;
}
}
static-label-switched-path ida {
transit 1000003 {
next-hop 10.30.10.1;
pop;
}
}
interface em3.8;
interface em1.4;
}
bgp {
family inet {
unicast;
}
group core {
type internal;
inactive: traceoptions {
file debug-bgp;
flag all;
}
local-address 10.0.0.4;
export next-hop-self;
neighbor 10.0.0.2;
neighbor 10.0.0.3;
neighbor 10.0.0.5;
neighbor 10.0.0.6;
}
}
ospf {
area 0.0.0.0 {
interface em3.8;
interface lo0.0;
interface em1.4;
}
}
}
policy-options {
policy-statement next-hop-self {
then {
next-hop self;
}
}
}
R5:
system {
host-name R5;
root-authentication {
encrypted-password "$1$4rV9KNix$PEJ57sdvRJaDYO68Q3fwY/"; ## SECRET-DATA
}
login {
user admin {
uid 2001;
class super-user;
authentication {
encrypted-password "$1$bOmy6GLa$/OVBkd3768bHuSfXXb1/K1"; ## SECRET-DATA
}
}
}
services {
ftp;
ssh;
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
vlan-tagging;
unit 7 {
vlan-id 7;
family inet {
address 10.70.10.1/24;
}
family mpls;
}
}
em1 {
vlan-tagging;
unit 6 {
vlan-id 6;
family inet {
address 10.60.10.2/24;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.5/32;
}
}
}
}
routing-options {
router-id 10.0.0.5;
autonomous-system 65000;
}
protocols {
mpls {
static-label-switched-path ida {
transit 1000001 {
next-hop 10.70.10.2;
swap 1000002;
}
}
static-label-switched-path vuelta {
transit 1000013 {
next-hop 10.60.10.1;
pop;
}
}
interface em1.6;
interface em0.7;
}
bgp {
traceoptions {
file debugbgp size 10000000 files 10;
flag open;
flag all;
}
family inet {
unicast;
}
group core {
type internal;
local-address 10.0.0.5;
export next-hop-self;
neighbor 10.0.0.2;
neighbor 10.0.0.3;
neighbor 10.0.0.4;
neighbor 10.0.0.6;
}
}
ospf {
area 0.0.0.0 {
interface em1.6;
interface em0.7;
interface lo0.0;
}
}
}
policy-options {
policy-statement next-hop-self {
then {
next-hop self;
}
}
}
R6:
system {
host-name R6;
root-authentication {
encrypted-password "$1$JQvXoNBw$J745YCkT0YjAGM5nbTQQD0"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
vlan-tagging;
unit 7 {
vlan-id 7;
family inet {
address 10.70.10.2/24;
}
family mpls;
}
}
em1 {
vlan-tagging;
unit 8 {
vlan-id 8;
family inet {
address 10.80.10.2/24;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.6/32;
}
}
}
}
routing-options {
router-id 10.0.0.6;
autonomous-system 65000;
}
protocols {
mpls {
static-label-switched-path ida {
transit 1000002 {
next-hop 10.80.10.1;
swap 1000003;
}
}
static-label-switched-path vuelta {
transit 1000012 {
next-hop 10.70.10.1;
swap 1000013;
}
}
interface em1.8;
interface em0.7;
}
bgp {
family inet {
unicast;
}
group core {
type internal;
local-address 10.0.0.6;
export next-hop-self;
neighbor 10.0.0.2;
neighbor 10.0.0.3;
neighbor 10.0.0.4;
neighbor 10.0.0.5;
}
}
ospf {
area 0.0.0.0 {
interface em0.7;
interface em1.8;
interface lo0.0;
}
}
}
policy-options {
policy-statement next-hop-self {
then {
next-hop self;
}
}
}
LSP de R2 a R3
El LSP estático de R2 a R3 se construye añadiendo el protocolo MPLS a las interfaces que se usan y con la instrucción static-label-switched-path dentro del protocolo MPLS. A continuación se muestra la configuración correspondiente en los cinco routers. Se observa que en R3 no se define conmutación de etiqueta estática ya que al usar PHP, en R5 se quita la etiqueta del paquete que llega como IP a R3.
interfaces {
em1 {
vlan-tagging;
unit 4 {
family mpls;
}
}
...
protocols {
mpls {
static-label-switched-path vuelta {
ingress {
next-hop 10.30.10.2;
to 10.0.0.3;
push 1000011;
}
}
interface em1.4;
}
interfaces {
em0 {
vlan-tagging;
unit 5 {
vlan-id 5;
family inet {
address 10.50.10.2/24;
}
}
}
em1 {
vlan-tagging;
unit 4 {
vlan-id 4;
family mpls;
}
}
em3 {
vlan-tagging;
unit 8 {
vlan-id 8;
family mpls;
}
}
...
protocols {
mpls {
static-label-switched-path vuelta {
transit 1000011 {
next-hop 10.80.10.2;
swap 1000012;
}
}
interface em3.8;
interface em1.4;
}
interfaces {
em0 {
vlan-tagging;
unit 7 {
vlan-id 7;
family mpls;
}
}
em1 {
vlan-tagging;
unit 8 {
vlan-id 8;
family mpls;
}
}
}
...
protocols {
mpls {
static-label-switched-path vuelta {
transit 1000012 {
next-hop 10.70.10.1;
swap 1000013;
}
}
interface em1.8;
interface em0.7;
}
interfaces {
em0 {
vlan-tagging;
unit 7 {
vlan-id 7;
family mpls;
}
}
em1 {
vlan-tagging;
unit 6 {
vlan-id 6;
family mpls;
}
}
}
...
protocols {
mpls {
static-label-switched-path vuelta {
transit 1000013 {
next-hop 10.60.10.1;
pop;
}
}
interface em1.6;
interface em0.7;
}
interfaces {
em3 {
vlan-tagging;
unit 6 {
vlan-id 6;
family mpls;
}
}
}
...
protocols {
mpls {
interface em3.6;
}
LSP de R3 a R2
La construcción de este LSP, llamado ida, es muy similar al anterior y la configuración de los interfaces es la misma, por lo que aquí sólo se muestra la creación del LSP estático asumiendo que los interfaces están configurados. En este caso se empieza desde R3:
protocols {
mpls {
static-label-switched-path ida {
ingress {
next-hop 10.60.10.2;
to 10.0.0.2;
push 1000001;
}
}
protocols {
mpls {
static-label-switched-path ida {
transit 1000001 {
next-hop 10.70.10.2;
swap 1000002;
}
}
protocols {
mpls {
static-label-switched-path ida {
transit 1000002 {
next-hop 10.80.10.1;
swap 1000003;
}
}
protocols {
mpls {
static-label-switched-path ida {
transit 1000003 {
next-hop 10.30.10.1;
pop;
}
}
No hay comentarios:
Publicar un comentario