1 / 16

MPLS Prática com Linux

MPLS Prática com Linux. Edgard Jamhour. Instalação. yum update yum install udev.i386 071-0.FC4.3 yum install hardlink yum install bridge-utils rpm -ivh kernel-2.6.15-1.1831_FC4mpls_1.950.i686.rpm rpm -ivh iproute-2.6.11-1_mpls_1.950d.i386.rpm

pembroke
Download Presentation

MPLS Prática com Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MPLSPrática com Linux Edgard Jamhour

  2. Instalação • yum update • yum install udev.i386 071-0.FC4.3 • yum install hardlink • yum install bridge-utils • rpm -ivh kernel-2.6.15-1.1831_FC4mpls_1.950.i686.rpm • rpm -ivh iproute-2.6.11-1_mpls_1.950d.i386.rpm • rpm -ivh --force iproute-2.6.11-1_mpls_1.950d.i386.rpm • rpm -ivh ebtables-2.0.6-7_mpls_1.950d.i386.rpm • rpm -ivh iptables-ipv6-1.3.0-2_mpls_1.950d.i386.rpm • rpm -ivh --force iptables-1.3.0-2_mpls_1.950d.i386.rpm • rpm -ivh kernel-devel-2.6.15-1.1831_FC4mpls_1.950.i686.rpm • rpm -e iptables-1.3.0-2 • rpm -e iproute-2.6.11-1

  3. Princípio FEC = Forwarding Equivalency Classes NHLFE = Next Hop Label Forwarding Entry No LER origem Ação sobre label e encaminhamento FTN= FEC X NHLFE FEC (destino) Key 0x2: push label1 e nexthop para ip1 NHLFE Se subrede1 Key 0x3: push label2 e nexthop para ip2 Se subrede 2 Key 0x4: push label3 e nexthop para ipn ILM - Incomming Label Map No LER saída ou no LSR No LSR Label entrada – Label saída ILM XC Interface X Label Label Space por Interface Se label4 então label 0 Se eth0 X label4 Se label 5 então label 0 Se eth0 X label5 Se label 6 então label 0 Se não houver entrada na XC, então é o LSR de saída

  4. Comandos Cria uma entrada nhlfe que adiciona o label 1000 e encaminha os pacotes para 10.0.0.3 pela interface eth1.

  5. Comandos Mapeia uma FEC para uma NHLFE

  6. Comandos O labelspace define que o roteador irá esperar pacotes marcados como mpls em sua interface

  7. Comandos A tabela ILM diz quais labels serão esperados

  8. Comandos Este comando implementa encaminha um pacote rotulado para uma nhlfe

  9. Seqüência para o Egress Router • Se for necesário encaminhar o pacote e fazer o pop do label • mpls labelspace set dev ethIN labelspace 0 • mpls ilm add label gen 1000 labelspace 0 • mpls nhlfe add key 0 instructions nexthop ethOUT ipv4 ipGateway • (returns key 0x2) • mpls xc add ilm_label gen 1000 ilm_labelspace 0 nhlfe_key 0x2 • Se for necessário fazer apenas o pop do label • mpls labelspace set dev ethIN labelspace 0 • mpls ilm add label gen 1000 labelspace 0

  10. Cenário 1 • LER: Label Edge router LABEL 1000 192.168.0.2/24 192.168.0.1/24 10.26.128.A 10.26.128.B eth1:1 eth0 eth0 eth1:1 Host A Host B LERB LERA eth1 eth1 192.168.1.2/24 192.168.1.1/24

  11. Configuração • # HOST A • ip route add 192.168.1.0/24 via 192.168.0.2 src 192.168.0.1 • # LERA • mpls nhlfe add key 0 instructions push gen 1000 nexthop eth1 ipv4 10.26.128.B • ip route add 192.168.1.0/24 via 10.26.128.B mpls 0x2 • echo 1 > /proc/sys/net/ipv4/ip_forward • # LER2 • mpls labelspace set dev eth1 labelspace 0 • mpls ilm add label gen 1000 labelspace 0

  12. Script MPLS para LER 1 #!/bin/bash -x # Carrega o módulo de mpls modprobe mpls4 key_value=`mpls nhlfe add key 0 instructions push gen 1000 nexthop eth1 ipv4 10.26.128.B `; key=`echo $key_value|awk '{print $4}'`; ip route add 192.168.1.0/24 via 10.26.128.B mpls $key echo 1 > /proc/sys/net/ipv4/ip_forward

  13. Comandos para Evitar Redirecionamento • sysctl net.ipv4.conf.eth1.send_redirects=0 • sysctl net.ipv4.conf.eth1.accept_redirects=0 • sysctl net.ipv4.conf.all.send_redirects=0 • sysctl net.ipv4.conf.all.accept_redirects=0

  14. Cenário 2 • LSR: Label Switching Router 192.168.0.0/24 10.26.128.0/17 192.168.1.0/24 .1 .2 .2 .2 .1 .1 Host A Host B LERB LERA eth0 eth0 eth1:1 eth1 eth1:1 eth1 eth1:2 eth1:2 .5 .10 10.0.0.4/30 10.0.0.8/30 .9 .6 eth1:2 eth1:1 LSRC LABEL 2001 LABEL 2000

  15. Configuração • # HOST A • ip route add 192.168.1.0/24 via 192.168.0.2 src 192.168.0.1 • # LER1 • mpls nhlfe add key 0 instructions push gen 2000 nexthop eth1:2 ipv4 10.0.0.6 • ip route add 192.168.1.0/24 via 10.0.0.6 mpls 0x3 • echo 1 > /proc/sys/net/ipv4/ip_forward • # LSR • mpls labelspace set dev eth1 labelspace 0 • mpls ilm add label gen 2000 labelspace 0 • mpls nhlfe add key 0 instructions push gen 2001 nexthop eth1:2 ipv4 10.0.0.10 • mpls xc add ilm_label gen 2000 ilm_labelspace 0 nhlfe_key 0x2 • echo 1 > /proc/sys/net/ipv4/ip_forward • # LER2 • mpls labelspace set dev eth1:2 labelspace 0 • mpls ilm add label gen 2001 labelspace 0

  16. Script para o LSR #!/bin/bash -x # Carrega o módulo de mpls modprobe mpls4 mpls labelspace set dev eth1:1 labelspace 0 mpls ilm add label gen 2000 labelspace 0 key_value=`mpls nhlfe add key 0 instructions push 2001 nexthop eth1:2 ipv4 10.0.0.10`; key=`echo $key_value|awk '{print $4}'`; mpls xc add ilm_label gen 2000 ilm_labelspace 0 nhlfe_key $key echo 1 > /proc/sys/net/ipv4/ip_forward

More Related