1 / 18

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

wolfe
Télécharger la présentation

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. Configuração LER de Ingresso mpls nhlfe add key 0 instructions push gen LABEL nexthop ETHO ipv4 NEXTHOP ip route add SUBREDE via NEXTHOP mpls KEY ip1 LSR label1 eth0 subrede1 LER LSR subrede2 ip2 label2 eth1

  4. Configuração LER de Egresso mpls labelspace set dev ETHI labelspace 0 mpls ilm add label gen LABEL labelspace 0 LSR label1 eth0 LER subrede1 eth1 label2 LSR

  5. Configuração do LSR • mpls labelspace set dev ETHI labelspace 0 • mpls ilm add label gen LABEL labelspace 0 • mpls xc add ilm_label gen LABEL ilm_labelspace 0 nhlfe_key KEY XC eth2 label11 LER LSR ip1 eth0 label10 LSR eth3 LSR LER label20 label21 ip2 eth1

  6. Exercício 1 LABEL 1000 LER2 LER1 Host B Host A a b b a a a LABEL 2000

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

  8. Script MPLS para LER 1 #!/bin/bash -x ip_ler2a=10.0.0.2 if_ler1b=eth1 feca=192.168.1.0/24 modprobe mpls4 key_value=`mpls nhlfe add key 0 instructions push gen 1000 nexthop $if_ler1b ipv4 $ip_ler2a `; key=`echo $key_value|awk '{print $4}'`; ip route add $feca via $ip_ler2a mpls $key sysctl -w net.ipv4.ip_forward=1

  9. 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

  10. Cenário 2 192.168.1.0/25 192.168.0.0/24 b a Host B b d L:1000 a Host A LER 1 LER 2 c c a b a Host C L:2000 L:2001 LSR a 192.168.1.128/25

  11. Configuração LER 1 • LER1 (Rota Vermelha) • mpls nhlfe add key 0 instructions push gen 1000 nexthop eth1:1 ipv4 10.0.0.2 • ip route add 192.168.1.0/25 via 10.0.0.2 mpls 0x2 • LER1 (Rota Azul) • mpls nhlfe add key 0 instructions push gen 2000 nexthop eth1:2 ipv4 10.1.0.2 • ip route add 192.168.1.128/24 via 10.1.0.2 mpls 0x3 • Roteamento • echo 1 > /proc/sys/net/ipv4/ip_forward

  12. Configuração LSR • # LSR (Rota Azul) • 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:1 ipv4 10.2.0.2 • mpls xc add ilm_label gen 2000 ilm_labelspace 0 nhlfe_key 0x2 • echo 1 > /proc/sys/net/ipv4/ip_forward

  13. Configuração LER 2 • LER2 (Rota Vermelha) • mpls labelspace set dev eth1 labelspace 0 • mpls ilm add label gen 1000 labelspace 0 • LER2 (Rota Azul) • mpls labelspace set dev eth1:1 labelspace 0 • mpls ilm add label gen 2001 labelspace 0

  14. Configuração Hosts • HOST A • ip route add 192.168.1.0/24 via 192.168.0.2 src 192.168.0.1 • HOST B • ip route add 192.168.0.0/24 via 192.168.1.2 src 192.168.1.2 • HOST C • ip route add 192.168.0.0/24 via 192.168.1.129 src 192.168.1.130

  15. Exemplo: Script para o LSR #!/bin/bash -x if_lsra=eth1 if_lsrb=eth1:1 ip_ler2a=10.2.0.2 modprobe mpls4 mpls labelspace set dev $if_lsra labelspace 0 mpls ilm add label gen 2000 labelspace 0 key_value=`mpls nhlfe add key 0 instructions push 2001 nexthop $if_lsrb ipv4 $ip_ler2a `; 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

  16. Exercício 2 • Implemente o cenário 2 de forma que os pacotes enviados pelo host A para a subrede: • 192.168.0.0/25 sigam o caminho vermelho • 192.168.0.128/25 sigam o caminho vermelho • Escreva o script de configuração de um dos caminhos • Capture os quadros mpls em LSR1 ou LER2, conforme o caminho.

  17. Cenário 3 L:1001 L:1002 L:1000 a b a b FEC A LER1 LSR2 a b a LER3 LSR1 FEC C c c d b b b a a LSR3 LER2 FEC B L:2000 L:2002 L:2001 192.168.0.0/24

  18. Exercício 3 • Implemente o cenário 3 de forma que os pacotes enviados: • Pela FEC A: sigam o caminho vermelho • Pela FEC B: sigam o caminho azul • Os caminhos de volta a partir da FEC C devem ser simétricos e utilizar os mesmos Labels.

More Related