MPLS Prtica com Linux Edgard Jamhour. 2010, Edgard Jamhour Instala§£o yum update yum...

download MPLS Prtica com Linux Edgard Jamhour. 2010, Edgard Jamhour Instala§£o yum update yum install udev.i386 071-0.FC4.3 yum install hardlink yum install bridge-utils

of 18

  • date post

    17-Apr-2015
  • Category

    Documents

  • view

    116
  • download

    5

Embed Size (px)

Transcript of MPLS Prtica com Linux Edgard Jamhour. 2010, Edgard Jamhour Instala§£o yum update yum...

  • Slide 1
  • MPLS Prtica com Linux Edgard Jamhour
  • Slide 2
  • 2010, Edgard Jamhour Instalao 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
  • Slide 3
  • 2010, Edgard Jamhour ip 1 mpls nhlfe add key 0 instructions push gen LABEL nexthop ETHO ipv4 NEXTHOP Configurao LER de Ingresso LER LSR eth0 label1 eth1 label2 ip 2 ip route add SUBREDE via NEXTHOP mpls KEY FTN = FEC X NHLFE FEC (destino) subrede1 subrede2 subrede1 subrede2 ChaveAoNHLFE 0x2push label1 e envia por eth0 para ip1 0x3push label2 e envia por eth1 para ip2
  • Slide 4
  • 2010, Edgard Jamhour Configurao LER de Egresso LSR LER eth0 label1 eth1 label2 mpls labelspace set dev ETHI labelspace 0 mpls ilm add label gen LABEL labelspace 0 subrede1 labelspaceInterfaceLabelILM 0eth0label1 1eth1label2 LSR
  • Slide 5
  • 2010, Edgard Jamhour ip 1 Configurao do LSR LSR LER LSR eth2 label11 eth3 label21ip 2 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 ChaveaoNHLFE 0x2push label11 e enviar por eth2 para ip1 0x3push label21 e enviar por eth3 para ip2 LER LSR eth0 eth1 label10 label20 ILMlabelspaceIfLabel 0eth0label10 1eth1label20 XC
  • Slide 6
  • 2010, Edgard Jamhour Exerccio 1 a LABEL 1000 LER 1 LER 2 Host A Host B a b HOST Aaeth1192.168.0.2 LER 1aeth1:1192.168.0.1 beth110.0.0.1/30 LER 2aeth110.0.0.2/30 beth1:1192.168.1.1 HOST Baeth1192.168.1.2 a b a LABEL 2000
  • Slide 7
  • 2010, Edgard Jamhour Configurao 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
  • Slide 8
  • 2010, Edgard Jamhour 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
  • Slide 9
  • 2010, Edgard Jamhour 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
  • Slide 10
  • 2010, Edgard Jamhour Cenrio 2 Host A Host B a LER 1 192.168.0.0/24 LER 2 L:2000 Host C 192.168.1.0/25 192.168.1.128/25 L:2001 b c d a a LER 1aeth1192.168.0.1 beth1:110.0.0.1/30 ceth1:210.1.0.1/30 LER 2aeth110.2.0.2/30 beth1:110.0.0.2/30 ceth1:2192.168.0.129 deth1:3192.168.1.1 LSRaeth110.1.0.2/30 beth1:110.2.0.1/30 HOST Aaeth1192.168.0.2 HOST Baeth1192.168.1.2 HOST Caeth1192.168.1.130 LSR c L:1000 b a ab
  • Slide 11
  • 2010, Edgard Jamhour Configurao 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
  • Slide 12
  • 2010, Edgard Jamhour Configurao 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
  • Slide 13
  • 2010, Edgard Jamhour Configurao 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
  • Slide 14
  • 2010, Edgard Jamhour Configurao 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
  • Slide 15
  • 2010, Edgard Jamhour 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
  • Slide 16
  • 2010, Edgard Jamhour Exerccio 2 Implemente o cenrio 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 configurao de um dos caminhos Capture os quadros mpls em LSR1 ou LER2, conforme o caminho.
  • Slide 17
  • 2010, Edgard Jamhour Cenrio 3 LER 1aeth166.0.0.1/24 beth1:110.0.0.1/30 LER 2aeth177.0.0.1/24 beth1:110.0.0.13/30 LER 3aeth110.0.0.10/30 beth1:110.0.0.22/30 ceth1:288.0.0.1/24 FEC A FEC C a L:2000 L:1000 L:1001 LSR 1aeth110.0.0.2/30 beth1:110.0.0.5/30 ceth1:210.0.0.14/30 deth1:310.0.0.17/30 LSR 2aeth110.0.0.6/30 beth1:110.0.0.9/30 LSR 3aeth110.0.0.18/30 beth1:110.0.0.21/30 FEC B 192.168.0.0/24 LSR1 LSR2 LSR3 LER3 LER2 LER1 b L:1002 L:2001 L:2002 a b a b c d a b a b a b c
  • Slide 18
  • 2010, Edgard Jamhour Exerccio 3 Implemente o cenrio 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 simtricos e utilizar os mesmos Labels.