Topologia:
EVE
Packet Tracer:
BGP Advanced:
Pessoal, para conseguir utilizar o workbook por completo serão necessários 4 switches com
função de L2 e L3 (2960S, 3560, 3750 etc) e 8 roteadores Cisco (quase todos os modelos
atendem, precisando apenas uma conexão serial entre 2 roteadores), recomendo a utilização
do dos emuladores EVE (Emulated Virtual Enviroment - [Link] ) ou o GNS3
([Link] que possuem versões muito estáveis para emulação de switches e
roteadores Cisco, dimuindo o custo dos estudos para a certificação.
IOUs recomendadas EVE:
Para utilização no EVE, recomendo as IOUs abaixo:
[Link]
[Link]
IOSs recomendadas GNS3:
No GNS3 podemos utilizar as mesmas acima, porém podemos também utilizar a IOS do
roteador 7200 que irá atender muito bem:
Formato do Workbook
Vamos separar o workbook em alguns tópicos, e cada tópico terão alguns laboratórios para o
auxílio na preparação para prova do CCNA R&S 200-125.
Cada laboratório seguirá o seguinte formato:
- Objetivo proposto – Em cada cenário, o candidato deverá atingir certas expectativas como
por exemplo (configurar o AS 100 com OSPF como protocolo de roteamento e realizar
comunicação com o AS 200 e AS 300 via eBGP), em alguns casos poderão ser adicionados sub
tarefas (exemplo: o OSPF deverá utilizar a senha XPTO, etc) ou até resultados esperados
(exemplo: o comando traceroute do roteador R1 até o roteador R8).
- Configuração – a configuração completa do laboratório com todos os comandos necessários
para atingir o objetivo proposto.
- Verificação – Passo a passo de como chegamos ao objetivo proposto com uma breve
explicação e alguns troubleshootings em cima das configurações realizadas.
Indice
1 - Layer 2 Lab 1 – Portas de acesso, trunk e Vlans
2 - Layer 2 Lab 2 – Trunk, DTP, Voice Vlan, Pruning e configurações básicas de portas
3 - Layer 2 Lab 3 - VTP
4 - Layer 2 Lab 4- Etherchannel com PaGP e LACP
5 - Layer 2 Lab 5 – Spanning Tree
6 - Layer 2 Lab 6 – Port Security, BPDU guard e STP Portfast
7 - Layer 2 Lab 7 – VACL
8 - Layer 3 Lab 8 – Rotas estáticas + IPsla
9 - Layer 3 Lab 9 – Router on a stick e SVI
10 - Layer 3 Lab 10 – RIP
11 - Layer 3 Lab 11 – EIGRP
12 - Layer 3 Lab 12 – EIGRP Named Mode
13 - Layer 3 Lab 13 – OSPFv2
14 - WAN Lab 14 – BGP
15 - WAN Lab 15 - HDLC e PPP
16 - WAN Lab 16 – MPLS
17 - WAN Lab 17 - Tunel GRE
18 - Infraestructure Services Lab 19 – DHCP
19 - Infraestructure Services - Lab 20 - NAT
20 - Infraestructure Services – Lab 21 - FHRP (HRSP, VRRP e GLBP)
21 - Security – ACL
22- BGP advanced - eBGP
Layer 2 Lab 1 – Portas de acesso, trunk e Vlans
(configuração inicial em Layer 2 Básico)
Objetivo Proposto
- Crie as vlans 100,200,301,302 e 999 em todos os switches da topologia, renomeie as vlans da
seguinte forma:
-Vlan 100 = AS100
-Vlan 200 = AS200
-Vlan 301 = AS300_R1
-Vlan 302 = AS300_R2
-Vlan 999 = Blackhole
- Habilite e configure a porta que se comunica com o R1 na vlan 301 em modo de acesso;
- Habilite e configure a porta que se comunica com o R2 na vlan 302 em modo de acesso;
- Habilite e configure a porta que se comunica com o R3 na vlan 100 em modo de acesso;
- Configure todas as portas de comunicação entre os swtiches em modo trunk permitindo
todas as vlans entre eles;
- Configure as portas que não estão sendo utilizadas na vlan 999 em modo de acesso e
desabilitadas;
- Identifique cada porta com uma descrição do equipamento que está conectado nela;
Passo-a-Passo
Pessoal, esse é um típico cenário de configuração de portas e criação de vlans, o primeiro
passo é a criação das vlans solicitadas no laboratório:
SW1#configure terminal
SW1 (config) #vlan 100
SW1 (config-vlan) #name AS100
SW1 (config-vlan) #vlan 200
SW1 (config-vlan) #name AS200
SW1 (config-vlan) #vlan 301
SW1 (config-vlan) #name AS300_R1
SW1 (config-vlan) #vlan 302
SW1 (config-vlan) #name AS300_R2
SW1 (config-vlan) #vlan 999
SW1 (config-vlan) #name Blackhole
Replique as configurações nos outros switches, para verificar se foram configuradas
corretamente, utilize o comando:
SW1#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et0/0, Et0/1, Et0/2, Et0/3
Et1/0, Et1/1, Et1/2, Et1/3
100 AS100 active
200 AS200 active
301 AS300_R1 active
302 AS300_R2 active
999 Blackhole active
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
100 enet 100100 1500 - - - - - 0 0
200 enet 100200 1500 - - - - - 0 0
301 enet 100301 1500 - - - - - 0 0
302 enet 100302 1500 - - - - - 0 0
999 enet 100999 1500 - - - - - 0 0
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary Type Ports
------------------------------------------------------------------------------
Você pode verificar que além das vlans que acabamos de criar, as vlans 1 (vlan default) e o
range de 1001 a 1005 também aparecem pois são as vlans criadas por padrão para as redes
fddi, token-ring, fddinet, e trnet não podendo serem utilizadas.
O range padrão de vlans é de 1 à 1005, o range extendido vai de 1006 à 4096.
A seguir vamos configurar as portas em modo trunk (pode passar mais de uma vlan), nesse
laboratório vamos utilizar o comando abaixo para descobrir quais portas estão conectadas
entre os switches:
SW1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW4 Eth 1/0 132 R S I Linux Uni Eth 1/0
SW4 Eth 1/1 179 R S I Linux Uni Eth 1/1
SW2 Eth 0/0 164 R S I Linux Uni Eth 0/0
SW2 Eth 0/1 137 R S I Linux Uni Eth 0/1
SW3 Eth 0/3 128 R S I Linux Uni Eth 0/3
SW3 Eth 0/2 142 R S I Linux Uni Eth 0/2
R1 Eth 1/2 179 R B Linux Uni Eth 0/0
Para configurar as interfaces, você pode realizar uma por vez:
SW1(config-if)#interface Ethernet0/0
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport mode trunk
SW1(config-if)#description Switches
Ou utilizar o comando interface range para configurar diversas interfaces ao mesmo tempo:
SW1(config)#interface range Ethernet 0/0-3
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport mode trunk
SW1(config-if)#description Switches
SW1(config)#interface range Ethernet 1/0-2
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport mode trunk
SW1(config-if)#description Switches
Repita o procedimento nos outros switches, para verificar se as configurações estão certas,
utilize o comando:
SW1#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 1
Et0/1 on 802.1q trunking 1
Et0/2 on 802.1q trunking 1
Et0/3 on 802.1q trunking 1
Et1/0 on 802.1q trunking 1
Et1/1 on 802.1q trunking 1
Et1/2 on 802.1q trunking 1
Port Vlans allowed on trunk
Et0/0 1-4094
Et0/1 1-4094
Et0/2 1-4094
Et0/3 1-4094
Et1/0 1-4094
Et1/1 1-4094
Et1/2 1-4094
Port Vlans allowed and active in management domain
Et0/0 1,100,200,301-302,999
Et0/1 1,100,200,301-302,999
Et0/2 1,100,200,301-302,999
Port Vlans allowed and active in management domain
Et0/3 1,100,200,301-302,999
Et1/0 1,100,200,301-302,999
Et1/1 1,100,200,301-302,999
Et1/2 1,100,200,301-302,999
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 1,100,200,301-302,999
Et0/1 1,100,200,301-302,999
Et0/2 1,100,200,301-302,999
Et0/3 1,100,200,301-302,999
Et1/0 1,100,200,301-302,999
Et1/1 1,100,200,301-302,999
Et1/2 1,100,200,301-302,999
Agora utilize o comando “#show cdp neighbors” novamente e identifiquei as portas em que os
roteadores estão conectados e configure as portas conforme o objetivo proposto:
SW1#sh cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW4 Eth 1/0 150 R S I Linux Uni Eth 1/0
SW4 Eth 1/1 141 R S I Linux Uni Eth 1/1
SW2 Eth 0/1 174 R S I Linux Uni Eth 0/1
SW2 Eth 0/0 157 R S I Linux Uni Eth 0/0
SW3 Eth 0/3 179 R S I Linux Uni Eth 0/3
SW3 Eth 0/2 164 R S I Linux Uni Eth 0/2
R1 Eth 1/2 154 R B Linux Uni Eth 0/0
Total cdp entries displayed : 7
SW1(config)#interface Ethernet 1/2
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 301
SW1(config-if)#description R1
SW1(config-if)#no shutdown
Agora por último verifique a interface que não está sendo utilizada (#show run) e configure ela
com a vlan Blackhole e em modo shutdown:
SW1(config)#interface Ethernet 1/3
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 999
SW1(config-if)#description Sem_Uso
SW1(config-if)#shutdown
Configuração:
Para os 4 switches:
SWs (config) #vlan 100
SWs (config-vlan) #name AS100
SWs (config-vlan) #vlan 200
SWs (config-vlan) #name AS200
SWs (config-vlan) #vlan 301
SWs (config-vlan) #name AS300_R1
SWs (config-vlan) #vlan 302
SWs (config-vlan) #name AS300_R2
SWs (config-vlan) #vlan 999
SWs (config-vlan) #name Blackhole
SWs(config)#interface range Ethernet 0/0-3
SWs(config-if)# switchport trunk encapsulation dot1q
SWs(config-if)# switchport mode trunk
SWs(config-if)#description Switches
SWs(config)#interface range Ethernet 1/0-2
SWs(config-if)# switchport trunk encapsulation dot1q
SWs(config-if)# switchport mode trunk
SWs(config-if)#description Switches
SW1:
SW1(config)#interface Ethernet 1/2
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 301
SW1(config-if)#description R1
SW1(config-if)#no shutdown
SW1(config)#interface Ethernet 1/3
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 999
SW1(config-if)#description Sem_Uso
SW1(config-if)#shutdown
SW2:
SW2(config)#interface Ethernet 1/2
SW2(config-if)# switchport mode access
SW2(config-if)# switchport access vlan 302
SW2(config-if)#description R2
SW2(config-if)#no shutdown
SW2(config)#interface Ethernet 1/3
SW2(config-if)# switchport mode access
SW2(config-if)# switchport access vlan 999
SW2(config-if)#description Sem_Uso
SW2(config-if)#shutdown
SW3:
SW3(config)#interface Ethernet 1/2
SW3(config-if)# switchport mode access
SW3(config-if)# switchport access vlan 999
SW3(config-if)#description Sem_Uso
SW3(config-if)#shutdown
SW3(config)#interface Ethernet 1/3
SW3(config-if)# switchport mode access
SW3(config-if)# switchport access vlan 999
SW3(config-if)#description Sem_Uso
SW3(config-if)#shutdown
SW4:
SW4(config)#interface Ethernet 1/2
SW4(config-if)# switchport mode access
SW4(config-if)# switchport access vlan 100
SW4(config-if)#description R3
SW4(config-if)#no shutdown
SW4(config)#interface Ethernet 1/3
SW4(config-if)# switchport mode access
SW4(config-if)# switchport access vlan 999
SW4(config-if)#description Sem_Uso
SW4(config-if)#shutdown
Layer 2 Lab 2 – Trunk, CDP, LLDP, DTP, Voice Vlan e Vlan
Pruning
(configuração inicial em Layer 2 Básico)
Objetivo Proposto
Parte 1 (Packet Tracer)
- Configure as interfaces fastethernet 0/1 entre o SW1 e o SW2 forçando o full-duplex;
-Configure as interfaces fastethernet 0/1 com a velocidade em 100MBs;
- Configure a a interface fastethernet 0/1 com controle de broadcast em 10% do valor total do
link;
-Desabilite o CDP nas interfaces fastethernet 0/1 porta dos switches 1 e 2 e utilize o protocolo
LLDP entre os 2 switches;
- Configure o link entre o SW1 e o SW2 em que o SW1 inicie a negociação do DTP e o SW2 em
modo trunk.
Parte 2 (EVE ou GNS3)
- Configure o link entre o SW1 e o SW2 permitindo apenas as vlans 1,100,200 e 300 entre os
trunks, posteriormente adicione a vlan 400 na lista de vlans permitidas.
- Configure a vlan 999 como vlan nativa no trunk entre os equipamentos;
- Configure a porta Ethertnet 1/3 do SW1 para utilizar a vlan de dados (vlan10) e vlan de voz
(vlan 20).
Verificação
Bom pessoal, vamos começar com as configurações básicas de porta, mas primeiro vamos a
algumas explicações do motivo de utilização de cada feature:
Storm-Control , com esse comando você está configurando um threshold para a quantidade
máxima de broadcast recebida na porta, em ambientes reais você pode configurar ele com
uma porcentagem (level) do total do link ou então uma quantidade de pacotes/bits por
segundo que estão trafegando na interface, também pode ser configurado para multicast.
Quando esse threshold é atingido, a porta entra em modo “err-disable” sendo necessário
reiniciar a mesma, para evitar esse tipo de trabalho, você pode configurar um período de
recuperação automático de portas em “err-disable” (errdisable recovery interval 30) em
segundos;
Speed – As portas dos switches por default veem configuradas como auto, ou seja, ele
negocia a velocidade da porta conforme o end-device conectado nela, porém com
alguns equipamentos essa configuração não funciona muito bem (impressoras,
catracas, câmeras etc, então você tem a opção de forçar a porta a se comunicar a uma
determinada velocidade (10MB, 100MB ou 1 GB) dependendo da capacidade do
switch, a configuração de speed deve bater nos 2 equipamentos ou a porta ficara
indisponível.
Duplex – configuração que determina se a comunicação será full-duplex (bidirecional -
recebe e envia dados ao mesmo tempo) ou half-duplex (ou envia, ou recebe dados),
essa configuração segue o mesmo padrão do Speed (Auto como default e negocia
conforme o end-device conectado).
CDP e LLDP – Cisco Discovery Protocol – Protocolo de descoberta de equipamentos
Cisco, trabalha na camada 2 e auxilia no entendimento da topologia e a saber em qual
equipamento/porta o switch/roteador está conectad, já o LLDP – Link Layer Discovery
Protocol é o protocolo aberto que permite as mesmas funções do CDP porém
multivendor.
Obs. Dependendo da plataforma utilizada para criar o lab, alguns comandos/features
podem não funcionar, se for necessário, complemente os estudos com o Packet Tracer
que terá grande parte dos comandos usados nesse lab.
Configure os Switches 1 e 2 para utilizar as features citadas acima:
SW1(config)#lldp run
SW1(config)#interface FastEthernet 0/1
SW1(config-if)#storm-control broadcast level 10
SW1(config-if)#speed 100
SW1(config-if)#duplex full
SW1(config-if)#no cdp enable
SW1(config-if)#lldp receive
SW1(config-if)#lldp trasnmit
Após configurar o SW1 você perceberá que o link entre os switches não irá subir
devido ao mismatch de speed e duplex entre eles, após configurar no SW2 a
comunicação deverá ser estabelecida:
SW2(config)#lldp run
SW2(config)#interface FastEthernet 0/1
SW2(config-if)#storm-control broadcast level 10
SW2(config-if)#speed 100
SW2(config-if)#duplex full
SW2(config-if)#no cdp enable
SW2(config-if)#lldp receive
SW2(config-if)#lldp trasnmit
SW1#sh interfaces fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up (connected)
Hardware is Lance, address is 0000.0c7d.bc01 (bia 0000.0c7d.bc01)
MTU 1500 bytes, BW 100000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s
input flow-control is off, output flow-control is off
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:08, output 00:00:05, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
956 packets input, 193351 bytes, 0 no buffer
Received 956 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 watchdog, 0 multicast, 0 pause input
0 input packets with dribble condition detected
2357 packets output, 263570 bytes, 0 underruns
0 output errors, 0 collisions, 10 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
SW2#sh lldp neighbors
Capability codes:
(R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
(W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
Device ID Local Intf Hold-time Capability Port ID
SW1 Fa0/1 120 R Fa0/1
SW1 Fa0/2 120 R Fa0/2
Total entries displayed: 2
DTP – Dynamic Trunk Protocol– O DTP é um protocolo criado pela Cisco para auxiliar
as interconexões entre dois switches e realizar uma negociação automática entre as
portas conectadas (Trunk, acesso, 802.1Q ou ISL), possuí 2 modos:
- Dynamic desirable – a porta irá ativamente realizar a tentativa de negociação do
trunk com portas conectas em modo dynamic auto ou dynamic disareble.
- Dynamic auto- a porta somente irá se tornar trunk se receber uma tentativa de
negociação de uma porta em modo dynamic desireble, ela atua passivamente
esperando o outro lado iniciar o trunk.
- No-Negotiate – Desabilita o protocolo DTP da porta informada.
Resultados:
dynamic auto + dynamic auto = access
dynamic auto + dynamic desirable = trunk
dynamic desirable + dynamic desirable = trunk
dynamic auto or dynamic desirable + trunk = trunk
dynamic auto or dynamic desirable + access = access
Agora vamos configurar a segunda porta que se comunica com o SW2, porém vamos
configurar o SW1 no modo trunk e o SW2 no modo dynamic para analisar o trunk:
SW1(config)#interface fastEthernet 0/2
SW1(config-if)#switchport mode trunk
SW2(config)#interface fastEthernet 0/2
SW2(config-if)# switchport mode dynamic auto
SW1#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Fa0/2 on 802.1q trunking 1
SW2#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Fa0/2 auto n-802.1q trunking 1
Como podemos ver, o SW2 está em modo auto e com um “n” antes do 802-1q que
significa que o encapsulamento do trunk foi negociado, para efeito de testes, vamos
alterar negociação do DTP do SW1 para auto e verificar o output dos 2 switches:
SW1(config)#interface fastEthernet 0/2
SW1(config-if)# switchport mode dynamic auto
SW1#sh interfaces trunk
Como vemos acima, quando colocamos os 2 switches para dynamic auto, os switches
não iniciam a negociação DTP entre eles e o trunk não é estabelecido, as portas
acabam virando uma porta de acesso normal, agora altere para “mode dynamic
disarable” e verifique o resultado:
SW1(config)#interface fastEthernet 0/2
SW1(config-if)# switchport mode dynamic desirable
SW1#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Fa0/2 desirable n-802.1q trunking 1
Parte 2 (EVE)
Agora vamos configurar o trunk entre os switches permitindo as vlans 100,200 e 300 e
utilizando a vlan nativa 999 no SW1 e a vlan 1 no SW2:
SW1(config)#vlan 100,200,300,999
SW1(config)#interface ethernet 0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport trunk allowed vlan 1,100,200,300
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk native vlan 999
SW2(config)#vlan 100,200,300,999
SW2(config)#interface ethernet 0/0
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#switchport trunk allowed vlan 1,100,200,300
SW2(config-if)#switchport trunk native vlan 1
SW1#
*Nov 9 02:39:40.950: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on Ethernet0/0 (999),
with SW2 Ethernet0/0 (1).
Agora coloque a vlan nativa no SW2 e veja o resultado:
SW2(config-if)#switchport trunk native vlan 999
SW2#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 999
Port Vlans allowed on trunk
Et0/0 1,100,200,300
Port Vlans allowed and active in management domain
Et0/0 1,100,200,300
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 1
Para terminar o lab, vamos simular uma manutenção nas vlans do trunk, crie a vlan
400 nos switches e propague nos trunks:
SW1(config)#vlan 400
SW1(config-if)#switchport trunk allowed vlan 400
Verifique que as vlans permitidas no trunk do SW1 não estão mais lá:
SW1#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 999
Port Vlans allowed on trunk
Et0/0 400
Port Vlans allowed and active in management domain
Et0/0 400
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 none
Simulei esse erro para mostrar como devem ser adicionadas ou removidas as vlans de
um trunk em ambiente de produção, a lista allowed permite alguns sub-comandos:
SW1(config-if)#switchport trunk allowed vlan ?
WORD VLAN IDs of the allowed VLANs when this port is in trunking mode
add add VLANs to the current list
all all VLANs
except all VLANs except the following
none no VLANs
remove remove VLANs from the current list
SW1(config-if)#switchport trunk allowed vlan add 1,100,200,300
SW2(config-if)#switchport trunk allowed vlan add 400
Agora vamos realizar a configuração da porta em acesso na vlan de dados + vlan de
voz:
SW1(config)#interface ethernet 1/3
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#switchport voice vlan 20
Configuração
Parte 1
SW1(config)#lldp run
SW1(config)#interface FastEthernet 0/1
SW1(config-if)#storm-control broadcast level 10
SW1(config-if)#speed 100
SW1(config-if)#duplex full
SW1(config-if)#no cdp enable
SW1(config-if)#lldp receive
SW1(config-if)#lldp trasnmit
SW1(config)#interface fastEthernet 0/2
SW1(config-if)#switchport mode dynamic desirable
SW2(config)#lldp run
SW2(config)#interface FastEthernet 0/1
SW2(config-if)#storm-control broadcast level 10
SW2(config-if)#speed 100
SW2(config-if)#duplex full
SW2(config-if)#no cdp enable
SW2(config-if)#lldp receive
SW2(config-if)#lldp trasnmit
SW2(config)#interface fastEthernet 0/2
SW2(config-if)# switchport mode dynamic auto
Parte 2
SW1(config)#vlan 10,20,100,200,300,999
SW1(config)#interface ethernet 0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport trunk allowed vlan 1,100,200,300,400
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk native vlan 999
SW1(config)#interface ethernet 1/3
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#switchport voice vlan 20
SW2(config)#vlan 100,200,300,999
SW2(config)#interface ethernet 0/0
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#switchport trunk allowed vlan 1,100,200,300,400
SW2(config-if)#switchport trunk native vlan 999
Layer 2 Lab 3 - VTP
(configuração inicial em Layer 2 Básico – Lab 3)
Objetivo Proposto
- Configurar o domínio de VTP como “CAFE” em todos os switches;
- Configurar o domínio de VTP com a senha “cafecomredes” em todos os switches;
- Utilize a versão 2 do VTP;
- Configurar o SW1 como VTP Master, os switches SW2 e SW3 como VTP Clients, e o switch
SW4 como VTP Transparent;
- Criar as vlans 100,200 e 300 no switch SW1 e verificar a replicação nos switches SW2 e SW3;
- Criar a vlan 400 no switch SW4 e certifique-se que a vlan está criada apenas nesse switch;
- Configure o SW3 para que ele só possa trafegar dados da vlan 300 para o SW1 utilizando o
VTP;
Passo-a-Passo:
O VTP (Virtual Trunk Protocol) é um protocolo que auxilia a criação/propagação de vlans em
uma rede Cisco (protocolo proprietário Cisco), ele se divide em 3 versões (v1, v2 e v3) e em 3
modos de operação:
Server : switch responsável por propagar/alterar/suprimir as vlans para os switches restantes;
Clientes: apenas recebem vlans dos switches Servers (não é possível criar ou alterar vlans);
Transparent: O switch propaga as informações VTP para outros switches, porém não participa
ativamente no domínio VTP sendo possível criar/modificar as vlans locais;
Primeiro vamos verificar como um switch trabalha o VTP em modo default:
SW1#show vtp status
VTP Version capable : 1 to 3
VTP version running :1
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP Traps Generation : Disabled
Device ID : aabb.cc80.2000
Configuration last modified by [Link] at 0-0-00 00:00:00
Local updater ID is [Link] (no valid interface found)
Feature VLAN:
--------------
VTP Operating Mode : Server
Maximum VLANs supported locally : 1005
Number of existing VLANs :5
Configuration Revision :0
MD5 digest : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD
0x56 0x9D 0x4A 0x3E 0xA5 0x69
Por default os switches entram na rede em modo Server, na versão 1 e 2 e sem um domínio
configurado, uma boa prática é sempre adicionar switches na rede existente em modo
transparent para evitar problemas.
Configure o SW1 conforme abaixo:
SW1(config)#vtp domain CAFE
SW1(config)#vtp mode server
SW1(config)#vtp version 2
SW1(config)#vtp password cafecomredes
Agora verifique as alterações realizadas com o comando abaixo:
SW1#sh vtp status
VTP Version capable : 1 to 3
VTP version running :2
VTP Domain Name : CAFE
VTP Pruning Mode : Disabled
VTP Traps Generation : Disabled
Device ID : aabb.cc80.1000
Configuration last modified by [Link] at 10-29-17 20:30:01
Local updater ID is [Link] (no valid interface found)
Feature VLAN:
--------------
VTP Operating Mode : Server
Maximum VLANs supported locally : 1005
Number of existing VLANs :5
Configuration Revision :1
MD5 digest : 0xF5 0x33 0x80 0x3B 0x34 0xB5 0x75 0x79
0x31 0x7C 0x0A 0x38 0x1B 0x7F 0x53 0xD8
SW1#sh vtp password
VTP Password: cafecomredes
Observer que o Domain Name , o Revison number e o MD5 foram alterados;
O Revision number é um número de 32 bits utilizado para manter os updates atualizados entre
os clients e o server, se o cliente receber um anuncio VTO com o domínio diferente do seu, ele
ignora o pacote, já se receber um igual, ele verifica o valor do revision number se igual ou
menor que o seu próprio= discarte do pacote, se for maior ele solicita uma atualização do
server.
No SW2 vamos configurar uma password errada para simular uma rede VTP discontigua:
SW2(config)#vtp domain CAFE
SW2(config)#vtp mode client
SW2(config)#vtp password cafesemredes
Agora habilite o debug abaixo no SW2:
SW2#debug sw-vlan vtp events
Crie uma vlan qualquer no SW1 ou espere o tempo de propagação do protocolo (5 minutos) e
você receberá o seguinte alerta no SW2:
*Oct 29 22:42:51.677: VTP LOG RUNTIME: MD5 digest failing
calculated = 28 55 19 E4 16 19 AB D6 6D A4 14 B1 43 E5 BA 0F
transmitted = 05 12 F9 50 0D 21 05 E6 37 83 E9 08 39 B6 20 74
Além disso você irá perceber que a vlan não estará no database do SW2:
SW2#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/3
Configure o password correto no SW2 e verifique que mesmo assim a vlan ainda não será
propagada devido ao tempo de propagação do protocolo, para ajustar esse tipo de situação,
basta criar uma vlan qualquer no SW1 e ele irá propagar a atualização para o SW2:
SW2#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/3
2 VLAN0002 active
888 VLAN0888 active
SW2#sh vtp status
VTP Version capable : 1 to 3
VTP version running :2
VTP Domain Name : CAFE
VTP Pruning Mode : Disabled
VTP Traps Generation : Disabled
Device ID : aabb.cc80.2000
Configuration last modified by [Link] at 10-29-17 22:49:08
Feature VLAN:
--------------
VTP Operating Mode : Client
Maximum VLANs supported locally : 1005
Number of existing VLANs :7
Configuration Revision :5
MD5 digest : 0x6D 0x0B 0x1D 0x4B 0x9F 0x7E 0xD6 0xE6
0xF6 0x28 0xEF 0x5B 0x16 0x53 0x6D 0x6A
Agora vamos simular um erro muito comum em redes com VTP, a adição de um switch na rede
em modo Server com um revision number maior que o SW1, vamos adicionar o SW3 sem
coloca-lo em modo transparente e vamos criar uma vlan nesse switch:
SW3(config)#vtp domain CAFE
SW3(config)#vtp version 2
SW3(config)#vlan 5
SW3(config)#vlan 6
SW3(config)#vlan 7
SW3(config)#vlan 8
SW3(config)#vlan 9
SW3(config)#vlan 10
SW3(config)#vtp password cafecomredes
O importante é que ao ser adicionado no domínio CAFE ele tenha o revision number maior que
o SW1, após o tempo de propagação verifique as vlans do SW1 e do SW2:
SW1#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/3
5 VLAN0005 active
6 VLAN0006 active
7 VLAN0007 active
8 VLAN0008 active
9 VLAN0009 active
10 VLAN0010 active
SW2#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/3
5 VLAN0005 active
6 VLAN0006 active
7 VLAN0007 active
8 VLAN0008 active
9 VLAN0009 active
10 VLAN0010 active
Delete as vlans criadas nos switches e retire o SW3 do domínio VTP, agora configure
conforme o que é solicitado no laboratório o SW3 e o SW4, além de criar as vlans solicitadas
no SW1 e SW4:
SW3(config)#vtp mode client
SW3(config)#vtp domain CAFE
SW3(config)#vtp password cafecomredes
SW4(config)#vtp mode transparent
SW4(config)#vtp domain CAFE
SW4(config)#vtp password cafecomredes
SW4(config)#vlan 400
SW1(config)#vlan 100
SW1(config)#vlan 200
SW1(config)#vlan 300
Compare os resultados nos switches Server, clients e transparente:
SW1#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/2, Et1/3
100 VLAN0100 active
200 VLAN0200 active
300 VLAN0300 active
SW2#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/2, Et1/3
100 VLAN0100 active
200 VLAN0200 active
300 VLAN0300 active
SW3#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/2, Et1/3
100 VLAN0100 active
200 VLAN0200 active
300 VLAN0300 active
SW4#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et1/2, Et1/3
400 VLAN0400 active
Bomgalera agora para realizar a última task do laboratório você deverá realizar um pruning nas
vlans que poderão ser permitidas na propagação do VTP, para isso primeiro vamos habilitar o
vtp pruning no SW1 e analisar os resultados:
SW1(config)#vtp pruning
SW1#sh interfaces pruning
Port Vlans pruned for lack of request by neighbor
Et0/0 none
Et0/1 100,200,300
Et0/2 none
Et0/3 100,200,300
Et1/0 none
Et1/1 none
Port Vlan traffic requested of neighbor
Et0/0 1,100,200,300
Et0/1 1,100,200,300
Et0/2 1,100,200,300
Et0/3 1,100,200,300
Et1/0 1,100,200,300
Et1/1 1,100,200,300
Podemos verificar que temos as vlans 100,200 e 300 com o status de pruned devido à falta de
requisição do neighbor (switch vizinho), vamos investigar o motivo desse comportamento mais
a fundo pois esse caso só ocorre se o switch não tiver a vlan no seu database:
SW1#sh cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW4 Eth 1/0 144 R S I Linux Uni Eth 1/0
SW4 Eth 1/1 156 R S I Linux Uni Eth 1/1
SW2 Eth 0/1 125 R S I Linux Uni Eth 0/1
SW2 Eth 0/0 140 R S I Linux Uni Eth 0/0
SW3 Eth 0/2 147 R S I Linux Uni Eth 0/2
SW3 Eth 0/3 173 R S I Linux Uni Eth 0/3
Como sabemos que os 2 switches tem as vlans solicitados, vamos analisar as portas conectadas
neles:
SW2#sh cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW4 Eth 0/2 158 R S I Linux Uni Eth 0/2
SW4 Eth 0/3 145 R S I Linux Uni Eth 0/3
SW1 Eth 0/1 140 R S I Linux Uni Eth 0/1
SW1 Eth 0/0 167 R S I Linux Uni Eth 0/0
SW3 Eth 1/0 154 R S I Linux Uni Eth 1/0
SW3 Eth 1/1 158 R S I Linux Uni Eth 1/1
Total cdp entries displayed : 6
Analisando as configurações da porta:
SW2#sh interfaces ethernet 0/1
Ethernet0/1 is up, line protocol is up (connected)
SW2#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 1
Et0/1 on 802.1q trunking 1
Et0/2 on 802.1q trunking 1
Et0/3 on 802.1q trunking 1
Et1/0 on 802.1q trunking 1
Et1/1 on 802.1q trunking 1
SW2# sh spanning-tree interface ethernet 0/1
Vlan Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Altn BLK 100 128.2 Shr
VLAN0100 Altn BLK 100 128.2 Shr
VLAN0200 Altn BLK 100 128.2 Shr
VLAN0300 Altn BLK 100 128.2 Shr
Como vemos acima, a porta está sendo bloqueada pelo spanning-tree impedindo a solicitação
de comunicação nas vlans informadas no pruning do SW1.
Para confirmar, vamos desabilitar a porta Ethernet 0/0 do SW2 e forçar o recalculo do STP no
ambiente e verificar as alterações:
SW2(config)#interface ethernet 0/0
SW2(config-if)#shutdown
SW2#sh spanning-tree blockedports
Name Blocked Interfaces List
-------------------- ------------------------------------
Number of blocked ports (segments) in the system : 0
SW1#sh interfaces pruning
Port Vlans pruned for lack of request by neighbor
Et0/0 100,200,300
Et0/1 none
Et0/2 none
Et0/3 100,200,300
Et1/0 none
Et1/1 none
Para alcançar o objetivo proposto, teremos que realizar o pruning utilizando listas de Prune-
elegible com o comando abaixo:
SW1(config)#interface range ethernet 0/2-3
SW1(config-if-range)#switchport trunk pruning vlan 2-299,301-1001
Obs. O comando é exatamente o oposto do allowed-list utilizado nos trunks.
SW1#sh interfaces pruning
Port Vlans pruned for lack of request by neighbor
Et0/0 100,200
Et0/1 none
Et0/2 100,200
Et0/3 none
Et1/0 none
Configuração
SW1(config)#vtp domain CAFE
SW1(config)#vtp mode server
SW1(config)#vtp version 2
SW1(config)#vtp password cafecomredes
SW1(config)#vlan 100
SW1(config)#vlan 200
SW1(config)#vlan 300
SW2(config)#vtp domain CAFE
SW2(config)#vtp mode client
SW2(config)#vtp password cafecomredes
SW3(config)#vtp domain CAFE
SW3(config)#vtp mode client
SW3(config)#vtp password cafecomredes
SW4(config)#vtp mode transparent
SW4(config)#vtp domain CAFE
SW4(config)#vtp password cafecomredes
SW4(config)#vlan 400
SW1(config)#vtp pruning
SW1(config)#interface range ethernet 0/2-3
SW1(config-if-range)#switchport trunk pruning vlan 2-299,301-1001
Layer 2 Lab 4- Etherchannel com PaGP e LACP
(configuração inicial em Layer 2 –Básico)
Objetivo Proposto
- Configure a comunicação entre os switches SW1 e SW4 utilizando um etherchannel com o
protocolo padrão Cisco e configure o SW1 como iniciador da negociação;
- Configure a comunicação entre os switches SW2 e SW3 utilizando um etherchannel com o
protocolo padrão IEEE e configure o SW2 como iniciador da negociação;
- Simule as quedas dos links e verifique as situações dos channels;
Passo-a-Passo
Bom galera, nesse laboratório vamos configurar a comunicação entre o SW1 e o SW4 com
PAgP e a comunicação entre o SW2 e SW3 utilizando o LACP:
Primeiro vamos falar um pouco sobre o protocolo em si, Etherchannel é a tecnologia que
permite “agrupar” diversas interfaces físicas em um “bundle”, ou seja, ela se torna 1 interface
lógica diminuindo assim problemas com interfaces queimadas (alta disponibilidade de portas) ,
agrupando a capacidade das portas e diminuído problemas com o S TP (ele enxerga o channel
como uma interface única), o PAgP (Port aggregation protocol) é o protocolo proprietário Cisco
de configuração de Eterchannel, possuindo 3 modos:
Auto - coloca a interface em modo passivo para negociação, na onde somente irá responder a
negociação PAgp (nunca começa a negociação).
Desirable – coloca a interface em modo ativo de negociação, ela envia pacotes PAgP para
iniciar o channel.
On – Força a interface fechar o channel sem a negociação PAgP .
SW1(config)#interface range ethernet 1/0-1
SW1(config-if-range)#channel-group 1 mode ?
active Enable LACP unconditionally
auto Enable PAgP only if a PAgP device is detected
desirable Enable PAgP unconditionally
on Enable Etherchannel only
passive Enable LACP only if a LACP device is detected
SW1(config-if-range)#channel-group 1 mode desirable
SW4(config)#interface range ethernet 1/0-1
SW4(config-if-range)#channel-group 1 mode auto
SW1#sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) PAgP Et1/0(P) Et1/1(P)
SW4#sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) PAgP Et1/0(P) Et1/1(P)
Na segunda parte do Lab, vamos utilizar o protocolo LACP (802.3ad – Link aggregation control
protocol) para comunicação entre os switches, ele funciona praticamente da mesma forma
que o PAgP, porém com os seguintes modos:
Passive – equivalente ao modo auto do PAgp, somente será formado channel se tivermos na
outra ponta o modo Active.
Active – equivalente ao modo desireble, o channel será formado se na outra ponta tivermos
portas em modo Active ou Passive.
On – equivalente ao modo On do PAgP.
SW2(config)#interface range ethernet 1/0-1
SW2(config-if-range)#channel-group 1 mode active
SW3(config)#interface range ethernet 1/0-1
SW3(config-if-range)#channel-group 1 mode passive
SW2#sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) LACP Et1/0(P) Et1/1(P)
SW3#sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) LACP Et1/0(P) Et1/1(P)
As combinações validas para fechar o channel são:
PAgP
Desirable Desirable
Desirable Auto
LACP
Active Active
Active Passive
Sem negociação
ON ON
Agora vamos realizar o teste de contingência desligando uma porta do SW3 e verificar o
output do channel :
SW3(config)#interface ethernet 1/0
SW3(config-if)#shutdown
SW3#sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) LACP Et1/0(D) Et1/1(P)
Para finalizar vamos simular um erro muito comum em ambientes com etherchannel , vamos
alterar a configuração direto na porta física ao invés de configurar no port-channel:
SW1(config)#interface ethernet 1/0
SW1(config-if)#switchport trunk allowed vlan 1,100,200,300
*Oct 31 16:31:26.945: %EC-5-CANNOT_BUNDLE2: Et1/0 is not compatible with Et1/1 and will be suspended (vlan
mask is different)
SW1#sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) PAgP Et1/0(s) Et1/1(P)
SW4#sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) PAgP Et1/0(I) Et1/1(P)
Dependendo da incompatibilidade de configuração o channel pode cair por completo (depois
de um tempo de uso) e o ambiente ficar fora do ar, o correto na configuração realizada acima
seria utilizar a interface port-channel 1:
SW1(config)#interface port-channel 1
SW1(config-if)#switchport trunk allowed vlan 1,100,200,300
SW1#sh run interface port-channel 1
interface Port-channel1
switchport trunk allowed vlan 1,100,200,300
switchport trunk encapsulation dot1q
switchport mode trunk
Configuração
SW1(config)#interface range ethernet 1/0-1
SW1(config-if-range)#channel-group 1 mode desirable
SW4(config)#interface range ethernet 1/0-1
SW4(config-if-range)#channel-group 1 mode auto
SW2(config)#interface range ethernet 1/0-1
SW2(config-if-range)#channel-group 1 mode active
SW3(config)#interface range ethernet 1/0-1
SW3(config-if-range)#channel-group 1 mode passive
Layer 2 Lab 5 – Spanning Tree
(configuração inicial em Layer 2 – Lab)
Objetivo Proposto
- Garanta que o switch SW1 seja root bridge para as vlan 1,100 e 200
- Garanta que o switch SW2 seja root bridge para as vlan 300 e 999
- Altere o modo de operação de spanning tree dos switches SW1 e SW2 para rapid-pvst
spannig-tree;
- Altere o modo de operação de spanning tree do switch SW3 para per-vlan-spanning-
tree;
- Altere o modo de operação de spanning tree do switch SW4 para Multiple spanning-
tree;
- Altere a configuração da porta blocked do switch SW2 para que a porta se torne root
port ao invés das portas restantes;
- Altere a configuração das portas switch SW1 para que ele influencie a root port do
switch SW3;
- Altere os timers padrão do STP nos switches SW1 e SW 2 para que a troca de BPDU
ocorra de 1 em 1 segundo, o tempo que a porta fica nos estados de listening e learning
para 15 segundos, e o tempo que a porta guarda a informação de BPDU para 10
segundos.
Passo-a-Passo
O spanning tree é um protocolo de camada 2 que atua evitando a criação de loops na
sua rede de switches, atua utilizando o algoritimo spanning tree para determinar o
melhor caminho (custo) até o switch root bridge (switch com o melhor bridge ID
formado pela prioridade + ID da vlan + Mac address do switch).
A troca de informações ocorre de 2 em 2 segundos com o envio e recebimento de
BPDUs (Bridge Protocol Data Units) para determinar/identificar o melhor caminho para
determinada rede (root port), é utilizado também na eleição do switch root bridge.
Possui algumas versões, segue um pouco sobre as principais:
STP padrão 802.1d – primeira versão criada, alguns switches ainda trabalham nessa
versão;
Rapid STP 802.1W– versão criada para acelerar o tempo de convergência (algumas
features como port-fast adicionadas);
PVSTP e PVST+- Peer VLAN Spanning-tree Padrões de STP criado pela Cisco em que
cada vlan vira um domínio de STP próprio além da criação de regiões;
Multiple STP – Parecido com o de cima, porém cria instâncias com 1 ou mais vlans
(bundles) e regiões também, além de ser compatível com os padrões acima.
Port-states no STP e seus timers default:
- Blocking – não trafega dados mas recebe BPDUs (20 segundos);
- Listening – recebe e analisa os BPDUs (15 segundos);
- Learning- Porta começa a processar o trafego e a popular sua tabela MAC (15
segundos);
- Forwarding- A porta começa a encaminhar frames (estado desejado de uma rede
normal);
- Disable – não participa no encaminhamento de frames (porta considerada não
operacional);
Port-Roles no STP:
- Root port – porta escolhida com o menor custo para o root-bridge da rede;
- Designated port- Encaminha tráfego (estado esperado da porta convencional);
- Alternate port- É um caminho alternativo até o root bridge da rede se a root port
falhar, a príncipio se mantem no estado de blocking mas muda para o estado de
forwarding se houver alteração na topologia (se necessário);
- Backup port – Parecida com a role alternate, porém para o caso de houver 2
caminhos para o mesmo segmento;
- Disabled port – Não participa do STP;
A eleição do root bridge da rede ocorre após a troca de BPDUs entre os switches, o
switch com o menor BID (bridge ID) que é uma combinação entre o bridge priority
(valor de 0 a 61440) e o MAC address do switch, é eleito o root bridge da rede, em
caso de empate, é selecionado o menor MAC address do switch.
As 2 primeiras tasks do lab pedem para que você garanta o root bridge para algumas
vlans, desse modo você tem 2 opções de configuração, a primeira é utilizar o comando
SW1(config)#spanning-tree vlan 1,100,200 root primary
SW2(config)#spanning-tree vlan 1,100,200 root secondary
Que na verdade altera o valor do root bridge para um valor menor do que está sendo
utilizado na rede:
SW1#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 24577 aabb.cc00.1000 0 2 20 15
VLAN0100 24676 aabb.cc00.1000 0 2 20 15
VLAN0200 24776 aabb.cc00.1000 0 2 20 15
VLAN0300 33068 aabb.cc00.1000 0 2 20 15
VLAN0999 33767 aabb.cc00.1000 0 2 20 15
SW2#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 24577 aabb.cc00.1000 100 2 20 15 Et0/0
VLAN0100 24676 aabb.cc00.1000 100 2 20 15 Et0/0
VLAN0200 24776 aabb.cc00.1000 100 2 20 15 Et0/0
VLAN0300 33068 aabb.cc00.1000 100 2 20 15 Et0/0
VLAN0999 33767 aabb.cc00.1000 100 2 20 15 Et0/0
Observe a diferença entre os 2 switches na vlan 1:
SW1#sh spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 24577
Address aabb.cc00.1000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24577 (priority 24576 sys-id-ext 1)
Address aabb.cc00.1000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Desg FWD 100 128.2 Shr
Et0/2 Desg FWD 100 128.3 Shr
Et0/3 Desg FWD 100 128.4 Shr
Et1/0 Desg FWD 100 128.5 Shr
Et1/1 Desg FWD 100 128.6 Shr
Et1/2 Desg FWD 100 128.7 Shr
Et1/3 Desg FWD 100 128.8 Shr
SW2#sh spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 24577
Address aabb.cc00.1000
Cost 100
Port 1 (Ethernet0/0)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 28673 (priority 28672 sys-id-ext 1)
Address aabb.cc00.2000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0 Root FWD 100 128.1 Shr
Et0/1 Altn BLK 100 128.2 Shr
Et0/2 Desg FWD 100 128.3 Shr
Et0/3 Desg FWD 100 128.4 Shr
Et1/0 Desg FWD 100 128.5 Shr
Et1/1 Desg FWD 100 128.6 Shr
Et1/2 Desg FWD 100 128.7 Shr
Et1/3 Desg FWD 100 128.8 Shr
Porém essa configuração não garante que o switch SW1 seja eleito o root bridge, pois
se um switch com a prioridade 0 entrar na rede, ele acabará se tornando root
conforme o teste abaixo:
SW3(config)#spanning-tree vlan 1,100,200 priority 0
SW3#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 1 aabb.cc00.3000 0 2 20 15
VLAN0100 100 aabb.cc00.3000 0 2 20 15
VLAN0200 200 aabb.cc00.3000 0 2 20 15
VLAN0300 33068 aabb.cc00.1000 100 2 20 15 Et0/2
VLAN0999 33767 aabb.cc00.1000 100 2 20 15 Et0/2
SW1#sh spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 1
Address aabb.cc00.3000
Cost 100
Port 3 (Ethernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24577 (priority 24576 sys-id-ext 1)
Address aabb.cc00.1000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Desg FWD 100 128.2 Shr
Et0/2 Root FWD 100 128.3 Shr
Et0/3 Altn BLK 100 128.4 Shr
Et1/0 Desg FWD 100 128.5 Shr
Et1/1 Desg FWD 100 128.6 Shr
Et1/2 Desg FWD 100 128.7 Shr
Interface Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
Et1/3 Desg FWD 100 128.8 Shr
Retire a configuração dos switches e configure novamente os switches conforme
solicitado nas tasks:
SW3(config)#no spanning-tree vlan 1,100,200 priority 0
SW2(config)#no spanning-tree vlan 1,100,200 root secondary
SW1(config)#no spanning-tree vlan 1,100,200 root primary
SW1(config)# spanning-tree vlan 1,100,200 priority 0
SW1(config)# spanning-tree vlan 300,999 priority 4096
SW2(config)# spanning-tree vlan 1,100,200 priority 4096
SW2(config)# spanning-tree vlan 300,999 priority 0
Observe que os valores de prioridade são sempre os valores abaixo:
% Bridge Priority must be in increments of 4096.
% Allowed values are:
0 4096 8192 12288 16384 20480 24576 28672
32768 36864 40960 45056 49152 53248 57344 61440
Verifique se as prioridades e os switches root das vlans criadas:
SW1#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 1 aabb.cc00.1000 0 2 20 15
VLAN0100 100 aabb.cc00.1000 0 2 20 15
VLAN0200 200 aabb.cc00.1000 0 2 20 15
VLAN0300 300 aabb.cc00.2000 100 2 20 15 Et0/0
VLAN0999 999 aabb.cc00.2000 100 2 20 15 Et0/0
SW2#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 1 aabb.cc00.1000 100 2 20 15 Et0/0
VLAN0100 100 aabb.cc00.1000 100 2 20 15 Et0/0
VLAN0200 200 aabb.cc00.1000 100 2 20 15 Et0/0
VLAN0300 300 aabb.cc00.2000 0 2 20 15
VLAN0999 999 aabb.cc00.2000 0 2 20 15
Para alterar o modo do spanning-tree dos switches, utilize os comandos abaixo:
SW1(config)#spanning-tree mode rapid-pvst
SW2(config)#spanning-tree mode rapid-pvst
SW3(config)#spanning-tree mode pvst
SW4(config)#spanning-tree mode mst
*Feb 26 19:20:43.846: %SPANTREE-2-PVSTSIM_FAIL: Blocking designated port Et0/2: Inconsitent superior PVST
BPDU received on VLAN 200, claiming root 200:aabb.cc00.1000
*Feb 26 19:20:43.846: %SPANTREE-2-PVSTSIM_FAIL: Blocking designated port Et0/3: Inconsitent superior PVST
BPDU received on VLAN 200, claiming root 200:aabb.cc00.1000
*Feb 26 19:20:43.941: %SPANTREE-2-PVSTSIM_FAIL: Blocking root port Et1/0: Inconsitent inferior PVST BPDU
received on VLAN 100, claiming root 100:aabb.cc00.1000
SW1# sh spanning-tree summary
Switch is in rapid-pvst mode
SW2#sh spanning-tree summary
Switch is in rapid-pvst mode
SW3#sh spanning-tree summary
Switch is in pvst mode
SW4#sh spanning-tree summary
Switch is in mst mode (IEEE Standard)
O spanning-tree utiliza o custo para escolher o melhor caminho até o root bridge da rede, em
caso de empate, ele utiliza o menor BID (Bridge ID) como critério de desempate, se mesmo
assim continuar em empate, o switch utiliza a porta com o menor número (ex. entre ethernet
0/2 e ethernet 0/5 a primeira seria escolhida como root).
O custo pode ser alterado para influenciar essa escolha, sendo o método mais simples para
alterar essa eleição (perspectiva do switch local):
Verifique primeiro a root port e a porta que está em modo blocked no switch SW2:
SW2#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 1 aabb.cc00.1000 100 1 10 5 Et0/0
VLAN0100 100 aabb.cc00.1000 100 1 10 5 Et0/0
VLAN0200 200 aabb.cc00.1000 100 1 10 5 Et0/0
VLAN0300 300 aabb.cc00.2000 0 1 10 5
VLAN0999 999 aabb.cc00.2000 0 1 10 5
SW2#sh spanning-tree blockedports
Name Blocked Interfaces List
-------------------- ------------------------------------
VLAN0001 Et0/1
VLAN0100 Et0/1
VLAN0200 Et0/1
Number of blocked ports (segments) in the system : 3
SW2#sh spanning-tree interface ethernet 0/0
Vlan Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Root FWD 100 128.1 Shr
VLAN0100 Root FWD 100 128.1 Shr
VLAN0200 Root FWD 100 128.1 Shr
VLAN0300 Desg FWD 100 128.1 Shr
VLAN0999 Desg FWD 100 128.1 Shr
SW2#sh spanning-tree interface ethernet 0/1
Vlan Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Altn BLK 100 128.2 Shr
VLAN0100 Altn BLK 100 128.2 Shr
VLAN0200 Altn BLK 100 128.2 Shr
VLAN0300 Desg FWD 100 128.2 Shr
VLAN0999 Desg FWD 100 128.2 Shr
Vamos alterar o custo da porta 0/1 e analisar o resultado:
SW2(config)#interface ether0/1
SW2(config-if)#spanning-tree cost 1
SW2#sh spanning-tree interface ethernet 0/0
Vlan Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Altn BLK 100 128.1 Shr
VLAN0100 Altn BLK 100 128.1 Shr
VLAN0200 Altn BLK 100 128.1 Shr
VLAN0300 Desg FWD 100 128.1 Shr
VLAN0999 Desg FWD 100 128.1 Shr
SW2#sh spanning-tree interface ethernet 0/1
Vlan Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Root FWD 1 128.2 Shr
VLAN0100 Root FWD 1 128.2 Shr
VLAN0200 Root FWD 1 128.2 Shr
VLAN0300 Desg FWD 1 128.2 Shr
VLAN0999 Desg FWD 1 128.2 Shr
Para influenciar a escolha da root port do switch vizinho, devemos utilizar o comando
spanning-tree port-priority direto do switch acima do switch que queremos influenciar,
alterando a prioridare dos switchs downstream.
Verifique qual é a root port do switch SW3:
SW3#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 1 aabb.cc00.1000 100 1 10 5 Et0/2
VLAN0100 100 aabb.cc00.1000 100 1 10 5 Et0/2
VLAN0200 200 aabb.cc00.1000 100 1 10 5 Et0/2
VLAN0300 300 aabb.cc00.2000 100 1 10 5 Et1/0
VLAN0999 999 aabb.cc00.2000 100 1 10 5 Et1/0
SW3#sh spanning-tree blockedports
Name Blocked Interfaces List
-------------------- ------------------------------------
VLAN0001 Et0/3, Et1/0, Et1/1
VLAN0100 Et0/3, Et1/0, Et1/1
VLAN0200 Et0/3, Et1/0, Et1/1
VLAN0300 Et0/2, Et0/3, Et1/1
VLAN0999 Et0/2, Et0/3, Et1/1
Number of blocked ports (segments) in the system : 15
SW3#sh cdp neighbors ethernet 0/2
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW1 Eth 0/2 143 R S I Linux Uni Eth 0/2
Agora no switch SW1 verifique em qual porta vamos configurar a prioridade para influenciar o
switch SW3:
SW1#sh cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW4 Eth 1/1 135 R S I Linux Uni Eth 1/1
SW4 Eth 1/0 169 R S I Linux Uni Eth 1/0
SW2 Eth 0/0 129 R S I Linux Uni Eth 0/0
SW2 Eth 0/1 132 R S I Linux Uni Eth 0/1
SW3 Eth 0/2 128 R S I Linux Uni Eth 0/2
SW3 Eth 0/3 148 R S I Linux Uni Eth 0/3
Total cdp entries displayed : 6
Configure a prioridade na porta do switch SW1, observe que quanto menor a prioridade
melhor na escolha da root port:
SW1(config)#interface ether0/3
SW1(config-if)#spanning-tree port-priority ?
<0-192> port priority in increments of 64
SW1(config-if)#spanning-tree port-priority 0
SW3#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 1 aabb.cc00.1000 100 1 10 5 Et0/3
VLAN0100 100 aabb.cc00.1000 100 1 10 5 Et0/3
VLAN0200 200 aabb.cc00.1000 100 1 10 5 Et0/3
VLAN0300 300 aabb.cc00.2000 100 1 10 5 Et1/0
VLAN0999 999 aabb.cc00.2000 100 1 10 5 Et1/0
SW3#sh spanning-tree blockedports
Name Blocked Interfaces List
-------------------- ------------------------------------
VLAN0001 Et0/2, Et1/0, Et1/1
VLAN0100 Et0/2, Et1/0, Et1/1
VLAN0200 Et0/2, Et1/0, Et1/1
VLAN0300 Et0/2, Et0/3, Et1/1
VLAN0999 Et0/2, Et0/3, Et1/1
Number of blocked ports (segments) in the system : 15
Para alterar os timers default, utilize os comandos abaixo nos switches SW1 e SW2, compare a
configuração dos switches com os switches restantes:
SW1(config)#spanning-tree vlan 1-1005 hello-time 1
SW1(config)#spanning-tree vlan 1-1005 forward-time 5
SW1(config)#spanning-tree vlan 1-1005 max-age 10
SW2(config)#spanning-tree vlan 1-1005 hello-time 1
SW2(config)#spanning-tree vlan 1-1005 forward-time 5
SW2(config)#spanning-tree vlan 1-1005 max-age 10
SW1#sh spanning-tree detail
VLAN0001 is executing the rstp compatible Spanning Tree protocol
Bridge Identifier has priority 0, sysid 1, address aabb.cc00.1000
Configured hello time 1, max age 10, forward delay 5, transmit hold-count 6
We are the root of the spanning tree
Topology change flag not set, detected flag not set
Number of topology changes 92 last change occurred 01:22:15 ago
from Ethernet1/0
Times: hold 1, topology change 15, notification 1
hello 1, max age 10, forward delay 5
Timers: hello 0, topology change 0, notification 0, aging 300
SW4#sh spanning-tree detail
MST0 is executing the mstp compatible Spanning Tree protocol
Bridge Identifier has priority 32768, sysid 0, address aabb.cc00.4000
Configured hello time 2, max age 20, forward delay 15, transmit hold-count 6
Current root has priority 1, address aabb.cc00.1000
Root port is 5 (Ethernet1/0), cost of root path is 2000000
Topology change flag not set, detected flag not set
Number of topology changes 3 last change occurred 01:21:59 ago
from Ethernet1/3
Times: hold 1, topology change 15, notification 1
hello 1, max age 10, forward delay 5
Timers: hello 0, topology change 0, notification 0
Configuração
SW1(config)# spanning-tree vlan 1,100,200 priority 0
SW1(config)# spanning-tree vlan 300,999 priority 4096
SW1(config)#spanning-tree mode rapid-pvst
SW1(config)#spanning-tree vlan 1-1005 hello-time 1
SW1(config)#spanning-tree vlan 1-1005 forward-time 5
SW1(config)#spanning-tree vlan 1-1005 max-age 10
SW1(config)#interface ether0/3
SW1(config-if)#spanning-tree port-priority 0
SW2(config)# spanning-tree vlan 1,100,200 priority 4096
SW2(config)#interface ether0/1
SW2(config-if)#spanning-tree cost 1
SW2(config)# spanning-tree vlan 300,999 priority 0
SW2(config)#spanning-tree mode rapid-pvst
SW2(config)#spanning-tree vlan 1-1005 hello-time 1
SW2(config)#spanning-tree vlan 1-1005 forward-time 5
SW2(config)#spanning-tree vlan 1-1005 max-age 10
SW3(config)#spanning-tree mode pvst
SW4(config)#spanning-tree mode mst
Layer 2 Lab 6 – Port Security, BPDU guard, STP Portfast e BPDU
Filter
(configuração inicial em Layer 2 - Básico)
Objetivo Proposto
- Configure as portas dos switches que os roteadores conectados do AS300 sejam tratados
como end-devices e o tempo de convergência do STP seja menor do que em portas
convencionais.
- Configure as portas dos switches que se conectam nos roteadores do AS300 para que eles
apenas aceitem o MAC-address dos roteadores respectivos.
- Configure as interfaces que conectam os switches 1 e 2 para que as portas sejam
desabilitadas caso recebam algum BPDU nelas.
- Configure com apenas 1 comando nos switches SW3 e SW4 para que todas as portas em
modo de acesso sejam desabilitadas (error-disable) caso recebam algum BPDU nelas.
- Configure com apenas 1 comando nos switches SW3 e SW4 para que todas as portas em
modo de acesso não enviem e nem recebam BPDUs caso recebam algum tipo de BPDU
(disabilite o STP da porta).
- Configure com apenas 1 comando nos switches SW3 e SW4 que todas as portas em modo de
acesso tenham o tempo de convergência reduzido e que seja menor do que em portas
convencionais.
Passo-a-Passo
O port-security é um mecanismo utilizado para ter controle de quais/quantos equipamentos se
conectam por porta do switch, é um recurso muito utilizado no dia-a-dia e permite que você
bloqueie ou restrinja a quantidade de mac-address em cada porta evitando assim a entrada de
HUBs, access-points ou equipamentos diversos na rede.
Ele possui 3 modos de restrição em caso de violação:
- Protect – o tráfego é descartado da interface;
- Restrict- o tráfego é descartado da interface e é enviado mensagens de syslog/SNMP no
sistema;
- Shutdown – Opção default, desabilita a porta e é enviado mensagens de syslog/SNMP no
sistema;
As configurações de port-security são realizadas diretamente na interface com o comando:
SW1(config)#interface ethernet 1/2
SW1(config-if)#switchport port-security ?
aging Port-security aging commands
mac-address Secure mac address
maximum Max secure addresses
violation Security violation mode
Para efeito de teste, vamos alterar o mac-address da interface do roteador R1 e configurar o
port-security para esse mac address específico:
R1(config)#interface ethernet 0/0
R1(config-if)# mac-address aabb.cc00.5001
SW1(config)#interface ethernet 1/2
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security mac-address aabb.cc00.5001
SW1# sh port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
---------------------------------------------------------------------------
Et1/2 1 1 0 Shutdown
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port) :0
Max Addresses limit in System (excluding one mac per port) : 4096
Agora altera o mac-address da interface do R1 para verificar o que ocorre:
R1(config)#interface ethernet 0/0
R1(config-if)# mac-address aabb.cc00.5002
SW1#
*Jan 4 17:41:55.299: %PM-4-ERR_DISABLE: psecure-violation error detected on Et1/2, putting Et1/2 in err-disable
state
*Jan 4 17:41:55.300: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC
address aabb.cc00.5002 on port Ethernet1/2.
*Jan 4 17:41:56.310: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/2, changed state to down
*Jan 4 17:41:57.300: %LINK-3-UPDOWN: Interface Ethernet1/2, changed state to down
SW1# sh port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
---------------------------------------------------------------------------
Et1/2 1 1 1 Shutdown
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port) :0
Max Addresses limit in System (excluding one mac per port) : 4096
Agora altere o modo de violation para modo protect ao invés de shutdown e realize o teste:
SW1(config)#interface ethernet 1/2
SW1(config-if)#switchport port-security violation protect
R1(config)#interface ethernet 0/0
R1(config-if)# mac-address aabb.cc00.5002
SW1# sh port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
---------------------------------------------------------------------------
Et1/2 1 1 0 Protect
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port) :0
Max Addresses limit in System (excluding one mac per port) : 4096
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1(config)#interface ethernet 0/0
R1(config-if)# mac-address aabb.cc00.5001
R1(config-if)#shutdown
R1(config-if)#no shutdown
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Para configurar a quantidade máxima de macs permitidos na porta utilize:
SW1(config)#interface ethernet 1/2
SW1(config-if)#switchport port-security maximum 2
Como visto nos labs anteriores, o protocolo spanning-tree utiliza alguns estados de porta antes
de começar a encaminhar tráfego:
SW1(config)#interface ethernet 1/2
SW1(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on Ethernet1/2 but will only
have effect when the interface is in a non-trunking mode.
Em algumas versões de IOS como no Nexus, o comando portfast deve ser acompanhando do
tipo:
SW1(config-if)#spanning-tree port type edge
Para verificar a configuração utilize o comando:
SW1#sh spanning-tree interface ethernet 1/2
Vlan Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0300 Desg FWD 100 128.7 Shr Edge
Para demonstrar a diferença entre uma porta convencional e uma porta com portfast, habilite
o seguinte debug e realize os testes abaixo:
SW1#debug spanning-tree events
Spanning Tree event debugging is on
SW1(config)#interface ethernet 1/2
SW1(config-if)#shutdown
SW1(config-if)#no shutdown
SW1#
*Jan 4 19:09:03.424: RSTP(300): initializing port Et1/2
*Jan 4 19:09:03.424: RSTP(300): Et1/2 is now designated
*Jan 4 19:09:05.115: %SYS-5-CONFIG_I: Configured from console by console
*Jan 4 19:09:05.421: %LINK-3-UPDOWN: Interface Ethernet1/2, changed state to up
*Jan 4 19:09:06.427: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/2, changed state to up
SW1(config)#interface ethernet 1/1
SW1(config-if)#shutdown
SW1(config-if)#no shutdown
SW1#
*Jan 4 19:12:38.206: RSTP(1): initializing port Et1/1
*Jan 4 19:12:38.206: RSTP(1): Et1/1 is now designated
*Jan 4 19:12:38.211: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:39.032: %SYS-5-CONFIG_I: Configured from console by console
*Jan 4 19:12:39.824: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:40.207: %LINK-3-UPDOWN: Interface Ethernet1/1, changed state to up
*Jan 4 19:12:41.217: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/1, changed state to up
*Jan 4 19:12:41.832: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:43.842: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:45.855: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:47.862: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:49.882: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:51.888: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:53.207: RSTP(1): Et1/1 fdwhile Expired
*Jan 4 19:12:53.906: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:55.916: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:57.929: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:12:59.934: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:13:01.948: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:13:03.957: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:13:05.968: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:13:07.984: RSTP(1): transmitting a proposal on Et1/1
*Jan 4 19:13:08.212: RSTP(1): Et1/1 fdwhile Expired
*Jan 4 19:13:08.212: STP[1]: Generating TC trap for port Ethernet1/1
O comando “bpduguard enable” coloca a porta em modo errdisable assim que ela recebe
qualquer BPDU na interface, evitando assim que switches indesejáveis sejam conectados nas
portas dos switches da rede:
SW1(config)#interface ethernet 0/0
SW1(config-if-range)#spanning-tree bpduguard enable
*Dec 19 11:09:49.636: %SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Et0/0 with BPDU Guard
enabled. Disabling port.
*Dec 19 11:09:49.658: %PM-4-ERR_DISABLE: bpduguard error detected on Et0/0, putting Et0/0 in err-disable state
*Dec 19 11:09:50.661: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
*Dec 19 11:09:51.661: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to down
*Dec 19 11:09:54.220: %SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Et0/1 with BPDU Guard
enabled. Disabling port.
*Dec 19 11:09:54.220: %PM-4-ERR_DISABLE: bpduguard error detected on Et0/1, putting Et0/1 in err-disable state
*Dec 19 11:09:55.225: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to down
*Dec 19 11:09:56.224: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to down
SW1#sh interfaces ether0/0
Ethernet0/0 is down, line protocol is down (err-disabled)
Hardware is AmdP2, address is aabb.cc00.1000 (bia aabb.cc00.1000)
MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
O comando “bpdufilter enable” funciona de forma parecida com o bpduguard, porém a
diferença é que se a porta receber qualquer BPDU ela automaticamente dropa o BPDU
recebidos e desabilita o STP da interface informada (pode causar loop):
SW1(config)#interface ethernet 0/0
SW1(config-if-range)#spanning-tree bpdufilter enable
SW1#sh spanning-tree interface ethernet 0/0 detail
Port 1 (Ethernet0/0) of VLAN0001 is designated forwarding
Port path cost 100, Port priority 128, Port Identifier 128.1.
Designated root has priority 1, address aabb.cc00.2000
Designated bridge has priority 32769, address aabb.cc00.1000
Designated port id is 128.1, designated path cost 100
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 3
Link type is shared by default
Bpdu filter is enabled
BPDU: sent 0, received 0
Agora replique as configurações no SW2 conforme o mac e os paramêtros do R2:
SW2(config)#interface ethernet1/2
SW2(config-if)#switchport port-security
SW2(config-if)#switchport port-security mac-address aabb.cc00.6002
SW2(config-if)# spanning-tree portfast edge
SW2(config-if)#shutdown
SW2(config-if)#no shutdown
Os comandos portfast, portfast bpduguard e portfast bpdufilter, quando habilitados em modo
global, colocam todas as portas que estão configuradas em modo de acesso com as features
habilitadas:
SW3(config)#spanning-tree portfast default
%Warning: this command enables portfast by default on all interfaces. You
should now disable portfast explicitly on switched ports leading to hubs,
switches and bridges as they may create temporary bridging loops.
SW3(config)#spanning-tree portfast bpduguard default
SW3(config)#spanning-tree portfast bpdufilter default
SW4(config)#spanning-tree portfast default
%Warning: this command enables portfast by default on all interfaces. You
should now disable portfast explicitly on switched ports leading to hubs,
switches and bridges as they may create temporary bridging loops.
SW4(config)#spanning-tree portfast bpduguard enable
SW3(config)#spanning-tree portfast bpdufilter default
SW3#sh spanning-tree summary
Switch is in rapid-pvst mode
Root bridge for: VLAN0100, VLAN0200, VLAN0300, VLAN0999
Extended system ID is enabled
Portfast Default is edge
Portfast Edge BPDU Guard Default is enabled
Portfast Edge BPDU Filter Default is enabled
Loopguard Default is disabled
PVST Simulation Default is enabled but inactive in rapid-pvst mode
Bridge Assurance is enabled
EtherChannel misconfig guard is enabled
Configured Pathcost method used is short
UplinkFast is disabled
BackboneFast is disabled
Name Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0001 3 0 0 4 7
VLAN0100 0 0 0 1 1
VLAN0200 0 0 0 1 1
VLAN0300 0 0 0 1 1
VLAN0999 0 0 0 1 1
Name Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
---------------------- -------- --------- -------- ---------- ----------
5 vlans 3 0 0 8 11
Obs. Dependendo da versão do IOU pode haver um bug com relação a configuração não
aparecer na configuração global, pórem os comandos são válidos:
SW3#sh spanning-tree interface ethernet 0/0
Vlan Role Sts Cost [Link] Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg FWD 100 128.1 Shr Edge
SW3#debug spanning-tree events
SW3(config)#interface ethernet 0/0
SW3(config-if)#shutdown
SW3(config-if)#no shutdown
SW3#
*Jan 4 19:58:15.552: RSTP(1): initializing port Et0/0
*Jan 4 19:58:15.552: RSTP(1): Et0/0 is now designated
*Jan 4 19:58:16.203: %SYS-5-CONFIG_I: Configured from console by console
*Jan 4 19:58:17.555: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Jan 4 19:58:18.559: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
Configuração
R1(config)#interface ethernet 0/0
R1(config-if)# mac-address aabb.cc00.5001
SW1(config)#interface ethernet 1/2
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security mac-address aabb.cc00.5001
SW1(config-if)#switchport port-security violation protect
SW1(config-if)#switchport port-security maximum 2
SW1(config-if)#spanning-tree portfast
SW1(config)#interface ethernet 0/0
SW1(config-if-range)#spanning-tree bpduguard enable
SW2(config)#interface ethernet1/2
SW2(config-if)#switchport port-security
SW2(config-if)#switchport port-security mac-address aabb.cc00.6002
SW2(config-if)# spanning-tree portfast edge
SW3(config)#spanning-tree portfast default
SW3(config)#spanning-tree portfast bpduguard enable
SW3(config)#spanning-tree portfast bpdufilter default
SW4(config)#spanning-tree portfast default
SW4(config)#spanning-tree portfast bpduguard enable
SW4(config)#spanning-tree portfast bpdufilter default
Layer 2 Lab 7 – VACL
(configuração inicial em VACL)
Objetivo Proposto
- Configure para que a vlan 300 não se comunique com a interface Eth0/0 na vlan 100 do R1;
- Configure para que o SW2 não receba tráfego dos MAC address das interfaces do switch SW4
diretamente nas interfaces conectadas;
Passo-a-Passo
As VACLs (vlan acess-lists) possuem uma granularidade incrível e podem ser utilizadas para
diversas funções na rede além da segregação normal, podem ser utilizadas para envio de
tráfego para analise (port-mirror, IDS, IPS etc), ou para bloqueios específicos em L2 (ex.
bloquear os MAC address de alguns devices).
A configuração é bem parecida com a de uma ACL comum ou um route-map conforme abaixo:
SW1(config)#ip access-list ext VLAN300
SW1(config-ext-nacl)#10 permit ip [Link] [Link] any
SW1(config-ext-nacl)#20 permit ip any [Link] [Link]
SW1(config)#ip access-list extended Permitany
SW1(config-ext-nacl)#permit ip any any
SW1(config)#vlan access-map CAFE 10
SW1(config-access-map)#match ip address VLAN300
SW1(config-access-map)#action drop log
SW1(config-access-map)#exit
SW1(config)#vlan access-map CAFE 20
SW1(config-access-map)#match ip address Permitany
SW1(config-access-map)#action forward
SW1(config-access-map)#exit
SW1(config)#vlan filter CAFE vlan-list 1,100,200,300,999
SW4#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 5/5/6 ms
SW4#ping [Link] source vlan 300
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
Packet sent with a source address of [Link].....
Success rate is 0 percent (0/5)
SW1#
*Jan 11 11:26:37.301: %VLMAPLOG-6-ICMP: vlan 100 (port Et1/0) denied icmp [Link] ->
[Link] (8/0), 1 packet
SW1# sh vlan access-log statistics
VACL Logging Statistics:
total packets :5
logged :5
dropped :0
buffered :0
Dropped Packets Statistics:
no packet buffer :0
hash queue full :0
flow table full :0
Misc Information:
free packet buffers :8192
log messages sent :1
flow table size :1
A criação de uma mac access-list segue o mesmo padrão de uma acess-list normal (na task
precisamos restringir apenas o MAC address das portas do SW4 por isso vamos colocar o deny
primeiro e depois o permit any any):
SW2(config)#mac access-list extended SW4
SW2(config-ext-macl)#deny host aabb.cc00.4020 any
SW2(config-ext-macl)#deny host aabb.cc00.4030 any
SW2(config-ext-macl)#permit any any
Aplique a access-list nas interfaces que se conectam no SW4:
SW2(config)#interface ethernet 0/2
SW2(config-if)#mac access-group SW4 in
SW2(config-if)#interface ethernet 0/3
SW2(config-if)#mac access-group SW4 in
Verifique que após a aplicação da ACL você não conseguirá encontrar mais o SW4 via CDP,
verifique também os matchs da ACL conforme abaixo (algumas versões possuem bugs e o cdp
pode continuar aparecendo):
SW2#sh cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW1 Eth 0/1 134 R S I Linux Uni Eth 0/1
SW1 Eth 0/0 157 R S I Linux Uni Eth 0/0
SW3 Eth 1/0 136 R S I Linux Uni Eth 1/0
SW3 Eth 1/1 157 R S I Linux Uni Eth 1/1
Total cdp entries displayed : 4
SW2#sh access-lists SW4
Extended MAC access list SW4
deny host aabb.cc00.4030 any (24 matches)
deny host aabb.cc00.4020 any (26 matches)
permit any any (1171 matches)
Agora retire as configurações das interfaces:
SW2(config)#interface ethernet 0/2
SW2(config-if)#no mac access-group SW4 in
SW2(config-if)#interface ethernet 0/3
SW2(config-if)#no mac access-group SW4 in
Vamos alterar a mac access-list para se adequar ao padrão do access-map (ajuda no
entendimento):
SW2(config)#no mac access-list extended SW4
SW2(config)# mac access-list extended SW4
SW2(config-ext-macl)#permit host aabb.cc00.4030 any
SW2(config-ext-macl)#permit host aabb.cc00.4020 any
SW2(config)#mac access-list extended Permitany
SW2(config-ext-macl)#permit any any
SW2(config)#vlan access-map CAFE 10
SW2(config-access-map)#match mac address SW4
SW2(config-access-map)#action drop
SW2(config)#vlan access-map CAFE 20
SW2(config-access-map)#match mac address Permitany
SW2(config-access-map)#action forward
Agora para teste, altere a interface eth0/2 do SW4 para L3 com os comandos abaixo e retire a
configuração da SVI vlan 100 além de dar shutdown nas outras interfaces dele, altere também
a porta q se comunica com essa interface no SW2 para modo acesso na vlan 100:
SW4(config)#no interface vlan 100
SW4(config)#interface ethernet 0/2
SW4(config-if)# no switchport
SW4(config-if)#ip address [Link] [Link]
SW4(config)#interface ethernet 0/0
SW4(config-if)#shutdown
SW4(config)#interface ethernet 0/1
SW4(config-if)#shutdown
SW4(config)#interface ethernet 0/3
SW4(config-if)#shutdown
SW4(config)#interface ethernet 1/0
SW4(config-if)#shutdown
SW4(config)#interface ethernet 1/1
SW4(config-if)#shutdown
SW2(config)#interface ethernet 0/2
SW2(config-if)#switchport access vlan 100
SW2(config-if)# switchport mode access
SW4#ping
*Jan 11 17:57:24.049: %SYS-5-CONFIG_I: Configured from console by console
SW4#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:.....
Success rate is 0 percent (0/5)
SW2#sh access-lists
Extended MAC access list Permitany
permit any any (58 matches)
Extended MAC access list SW4
permit host aabb.cc00.4030 any
permit host aabb.cc00.4020 any (6 matches)
Obs. Talvez seja necessário dar um shut – no shut na interface para o filto funcionar devido a bugs de versão.
Configuração
SW1(config)#ip access-list ext VLAN300
SW1(config-ext-nacl)#10 permit ip [Link] [Link] any
SW1(config-ext-nacl)#20 permit ip any [Link] [Link]
SW1(config)#ip access-list extended Permitany
SW1(config-ext-nacl)#permit ip any any
SW1(config)#vlan access-map CAFE 10
SW1(config-access-map)#match ip address VLAN300
SW1(config-access-map)#action drop log
SW1(config-access-map)#exit
SW1(config)#vlan access-map CAFE 20
SW1(config-access-map)#match ip address Permitany
SW1(config-access-map)#action forward
SW1(config-access-map)#exit
SW1(config)#vlan filter CAFE vlan-list 1,100,200,300,999
1º parte:
SW2(config)#mac access-list extended SW4
SW2(config-ext-macl)#deny host aabb.cc00.4020 any
SW2(config-ext-macl)#deny host aabb.cc00.4030 any
SW2(config-ext-macl)#deny any host aabb.cc00.4030
SW2(config-ext-macl)#deny any host aabb.cc00.4030
SW2(config-ext-macl)#permit any any
SW2(config)#interface ethernet 0/2
SW2(config-if)#mac access-group SW4 in
SW2(config-if)#interface ethernet 0/3
SW2(config-if)#mac access-group SW4 in
2º parte:
SW2(config)# mac access-list extended SW4
SW2(config-ext-macl)#permit host aabb.cc00.4030 any
SW2(config-ext-macl)#permit any host aabb.cc00.4030
SW2(config-ext-macl)#permit host aabb.cc00.4020 any
SW2(config-ext-macl)#permit any host aabb.cc00.4020
SW2(config)#mac access-list extended Permitany
SW2(config-ext-macl)#permit any any
SW2(config)#vlan access-map CAFE 10
SW2(config-access-map)#match mac address SW4
SW2(config-access-map)#action drop
SW2(config)#vlan access-map CAFE 20
SW2(config-access-map)#match mac address Permitany
SW2(config-access-map)#action forward
SW2(config)#interface ethernet 0/2
SW2(config-if)#switchport access vlan 100
SW2(config-if)# switchport mode access
SW4(config)#no interface vlan 100
SW4(config)#interface ethernet 0/2
SW4(config-if)# no switchport
SW4(config-if)# [Link] [Link]
SW4(config)#interface ethernet 0/0
SW4(config-if)#shutdown
SW4(config)#interface ethernet 0/1
SW4(config-if)#shutdown
SW4(config)#interface ethernet 0/3
SW4(config-if)#shutdown
SW4(config)#interface ethernet 1/0
SW4(config-if)#shutdown
SW4(config)#interface ethernet 1/1
SW4(config-if)#shutdown
Layer 3 Lab 8 – Rotas estáticas + IPsla
(configuração inicial em Rotas estáticas + IPsla)
Objetivo Proposto
- Crie uma rota especifica no R3 para a interface loopback do R6 apontando o IP do roteador
R4;
- Crie uma rota especifica no R3 para a interface loopback do R6 apontando a interface
diretamente conectada ao roteador R5;
- Faça com que o tráfego das duas rotas criadas acima, sejam balanceadas pelos 2 caminhos;
- Crie umIPSLA na rota que passa pelo roteador R4 alterando a sua prioridade para que ela seja
tratada como rota principal e com os parâmetros abaixo:
Timeout 2500
Threshold 2500
Frequency 5
E caso o link para o R4 caia, a rota seja chaveada para o roteador R5, realize os testes de
contigência para efeito de documentação.
Passo-a-Passo
Bom pessoal, o laboratório acima trata da configuração de rotas estáticas, rotas flutuantes
(floating static routes) e da configuração do IPSLA + Track, antes de continuar, vamos falar um
pouco sobre cada assunto:
Rotas estáticas - São entradas manuais na tabela de roteamento criadas com a seguinte
sintax de comando:
RX(config)# ip route <destination prefix><destination prefix mask><IP do Next-hop ou
interface de saída>< distance>
Podem ser adicionados rotas para vrfs, tracks, profiles etc nessa configuração.
Um outro caso interessante é a criação de rotas default, segue o exemplo que foi criado no R6
para atender esse lab:
R6#ip route [Link] [Link] Ethernet0/0
R6#ip route [Link] [Link] Ethernet0/1
R6#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is [Link] to network [Link]
S* [Link]/0 is directly connected, Ethernet0/1
is directly connected, Ethernet0/0
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
[Link]/24 is variably subnetted, 6 subnets, 2 masks
R [Link]/30 [120/1] via [Link], 00:00:17, Ethernet0/0
R [Link]/30 [120/1] via [Link], 00:00:10, Ethernet0/1
C [Link]/30 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
C [Link]/30 is directly connected, Ethernet0/1
L [Link]/32 is directly connected, Ethernet0/1
Rotas estáticas flutuantes - trata da alteração da distância administrativa (default 1) para
que uma rota seja escolhida preferencialmente ao invés da outra, assim você consegue
escolher qual rota será a rota principal e qual será a rota backup, exemplo:
R3#sh run | i ip route
ip route [Link] [Link] Ethernet0/2 10
ip route [Link] [Link] [Link] 11
Cisco IP SLA (Service Level Agreements)- ferramenta criada pela Cisco para
mensurar/analisar a qualidade/performance de caminhos de rede (path), rotas, ou analisar o
trafego entre 2 equipamentos Cisco IOS, pode também mensurar a qualidade dos links
utilizando alguns parâmetros como:
- Jitter;
- Tempo de resposta;
- Perda de pacotes;
- Voice Quality Scoring (MOS);
- Conectividade;
- Respostas de Servers ou websites;
- Delay
Para realizar as 3 primeiras tasks utilize os comandos abaixo:
R3(config)# ip route [Link] [Link] Ethernet0/2
R3(config)# ip route [Link] [Link] [Link]
Agora verifique se os caminhos estão sendo balanceados conforme o comando abaixo:
R3#traceroute [Link] probe 2
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 2 msec
[Link] 0 msec
2 [Link] 1 msec
[Link] 1 msec
R3#sh ip route [Link]
Routing entry for [Link]/32
Known via "static", distance 1, metric 0 (connected)
Routing Descriptor Blocks:
[Link]
Route metric is 0, traffic share count is 1
* directly connected, via Ethernet0/2
Route metric is 0, traffic share count is 1
Agora vamos criar o ip sla com os paramêtros solicitados, lembrando que na criação você deve
apontar o icmp-echo para um IP na outra ponta do link (geralmente a interface lan do roteador
de borda do ISP), neste caso vamos apontar para o IP da interface ethernet 0/0 do R6:
R3(config)#ip sla 1
R3(config-ip-sla)#icmp-echo [Link]
R3(config-ip-sla-echo)#threshold 2500
R3(config-ip-sla-echo)#timeout 2500
R3(config-ip-sla-echo)#frequency 30
Verifique que mesmo após a criação do IPsla você ainda não obtem respostas de sucesso:
R3#sh ip sla statistics 1
IPSLAs Latest Operation Statistics
IPSLA operation id: 1
Number of successes: Unknown
Number of failures: Unknown
Operation time to live: 0
Na verdade, após a criação do IP SLA você deve configurar o tempo que a probe será
executada (default 3600s) e quando ela deverá ser iniciada:
R3(config)#ip sla schedule 1 life forever start-time now
Agora você deverá estar recebendo resultados da probe:
R3#sh ip sla statistics 1
IPSLAs Latest Operation Statistics
IPSLA operation id: 1
Latest RTT: 1 milliseconds
Latest operation start time: 21:38:14 EET Wed Dec 20 2017
Latest operation return code: OK
Number of successes: 15
Number of failures: 0
Operation time to live: Forever
O próximo passo é a criação do track que é a ação tomada em caso de falha (error) no
resultado da probe acima, para isso:
R3(config)#track 1 ip sla 1 reachability
Obs. Você consegue criar tracks baseado em rotas, route-maps, interfaces etc.
Agora altere as rotas colocando a distância administrativa da rota para o R4 com um
AD menor que a outra rota, adicione também o comando track na rota:
R3(config)# ip route [Link] [Link] [Link] 10 track 1
R3(config)# ip route [Link] [Link] Ethernet0/2 11
Verifique o status do track:
R3#sh track 1
Track 1
IP SLA 1 reachability
Reachability is Up
1 change, last change 00:02:57
Latest operation return code: OK
Latest RTT (millisecs) 1
Tracked by:
Static IP Routing 0
Para efeito de teste, vamos derrubar a interface Ethernet 0/0 do R6 e verificar se o track
funcionou:
R3#sh track 1
Track 1
IP SLA 1 reachability
Reachability is Down
2 changes, last change 00:00:00
Latest operation return code: Timeout
Tracked by:
Static IP Routing 0
R3#sh track 1
*Dec 20 19:48:40.206: %TRACK-6-STATE: 1 ip sla 1 reachability Up -> Down
R3#traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 1 msec 1 msec 1 msec
2 [Link] 1 msec 1 msec *
Configuração
R3(config)# ip route [Link] [Link] [Link] 10 track 1
R3(config)# ip route [Link] [Link] Ethernet0/2 11
R3(config)#ip sla 1
R3(config-ip-sla)#icmp-echo [Link]
R3(config-ip-sla-echo)#threshold 2500
R3(config-ip-sla-echo)#timeout 2500
R3(config-ip-sla-echo)#frequency 5
R3(config)#ip sla schedule 1 life forever start-time now
R3(config)#track 1 ip sla 1 reachability
Layer 3 Lab 9 – Router on a stick e SVI
(configuração inicial em Router on a stick)
Objetivo Proposto
- Configure a comunicação entre o roteador R1 e o switch SW1 com os IPs abaixo sendo que o
primeiro IP deverá ser utilizado pelo R1 e o segundo pelo SW1:
Vlan 100 – [Link] e [Link] mascara /24
Vlan 200 – [Link] e [Link] mascara /24
Vlan 300 – [Link] e [Link] mascara /24
- Realize testes de conexão entre os IPs para fins de documentação.
Passo a Passo
A configuração de subinterfaces nos roteadores Cisco é uma das features mais utilizadas na
criação de labs e no dia-a-dia do profissional de redes, as configurações são bem simples,
bastando apenas configurar a interface física sem IP e habilitada, e depois configurar a
subinterface + vlan atrelada a porta:
R1(config)#interface Ethernet0/0
R1(config-if)# no ip address
R1(config-if)# no shut
R1(config)#interface Ethernet0/0.100
R1(config-if)# encapsulation dot1Q 100
R1(config-if)# ip address [Link] [Link]
R1(config)#interface Ethernet0/0.200
R1(config-if)# encapsulation dot1Q 200
R1(config-if)# ip address [Link] [Link]
R1(config)#interface Ethernet0/0.300
R1(config-if)# encapsulation dot1Q 300
R1(config-if)# ip address [Link] [Link]
O próximo passo é alterar a configuração do switch, altere a porta para modo trunk e crie as
interfaces vlan do switch:
SW1(config)#interface Ethernet1/2
SW1(config-if)#switchport trunk allowed vlan 100,200,300
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#no shut
SW1(config)#interface Vlan100
SW1(config-if)# ip address [Link] [Link]
SW1(config-if)#no shut
SW1(config)#interface Vlan200
SW1(config-if)# ip address [Link] [Link]
SW1(config-if)#no shut
SW1(config)#interface Vlan300
SW1(config-if)# ip address [Link] [Link]
SW1(config-if)#no shut
Obs. Não se esqueça de habilitar a interface vlan, dependendo da plataforma ela fica em modo
shutdown.
Agora realize os testes de comunicação entre as vlans criadas e as sub-interfaces:
SW1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
SW1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
SW1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
Configuração
R1(config)#interface Ethernet0/0
R1(config-if)# no ip address
R1(config)#interface Ethernet0/0.100
R1(config-if)# encapsulation dot1Q 100
R1(config-if)# ip address [Link] [Link]
R1(config)#interface Ethernet0/0.200
R1(config-if)# encapsulation dot1Q 200
R1(config-if)# ip address [Link] [Link]
R1(config)#interface Ethernet0/0.300
R1(config-if)# encapsulation dot1Q 300
R1(config-if)# ip address [Link] [Link]
SW1(config)#interface Ethernet1/2
SW1(config-if)#switchport trunk allowed vlan 100,200,300
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config)#interface Vlan100
SW1(config-if)# ip address [Link] [Link]
SW1(config)#interface Vlan200
SW1(config-if)# ip address [Link] [Link]
SW1(config)#interface Vlan300
SW1(config-if)# ip address [Link] [Link]
Layer 3 Lab 10 – RIP
(configuração inicial em RIP)
Objetivo Proposto
- Configure os roteadores do AS100 para se comunicarem via RIP versão 2;
- Configure os roteadores do AS100 sem sumarização automatica;
- Propague as interfaces loopback para serem divulgadas pelo RIP;
- Configure a autenticação dos roteadores do AS100 com a senha CAFECOMREDES em MD5;
- Configure para que os roteadores não se comuniquem via RIP com equipamentos fora do
AS100;
- Altere o valor dos timers padrões do protocolo para metade.
Passo a Passo
O protocolo RIP é um protocolo IGP (interior gateway protocol) de vetor de distância que
trabalha propagando as suas rotas para todos os roteadores adjacentes utilizando alguns
timers padrões:
- Route Update Timer: 30 segundos;
- Route Invalid Timer: 180 segundos;
- Route Holddown Timer: 180 segundos;
- Route Flush Timer: 240 segundos;
Possúi 3 versões padrões (versão 1, versão 2 e o RIPng que é projetado para IPV6) e possuí
também a sua distância administrativa de 120 outro detalhe é que o RIP utiliza o endereço
multicast [Link] para troca de mensagens entre os roteadores.
Primeiro vamos configurar os roteadores com as configurações básicas do RIP:
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#network [Link]
R3(config-router)#network [Link]
R3(config-router)#no auto-summary
Agora analise a tabela de roteamento:
R3#sh ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
R [Link] [120/1] via [Link], 00:00:00, Ethernet0/1
[Link]/32 is subnetted, 1 subnets
R [Link] [120/1] via [Link], 00:00:26, Ethernet0/2
[Link]/32 is subnetted, 1 subnets
R [Link] [120/2] via [Link], 00:00:26, Ethernet0/2
[Link]/24 is variably subnetted, 6 subnets, 2 masks
R [Link]/30 [120/1] via [Link], 00:00:00, Ethernet0/1
R [Link]/30 [120/1] via [Link], 00:00:26, Ethernet0/2
A autenticação no protocolo RIP é realizada via key chain, é criada uma chave nos roteadores e
essa chave é trocada assim que ele recebe o pacote do seu neighbor, outro detalhe é que a
configuração do método de autenticação (MD5 ou plain-text) é realizado via interface:
R3(config)#key chain CAFE
R3(config-keychain)#key 1
R3(config-keychain-key)#key-string CAFECOMREDES
R3(config)#interface ethernet 0/1
R3(config-if)#ip rip authentication mode md5
R3(config-if)#ip rip authentication key-chain CAFE
Verifique que após realizar essa configuração o roteador R4 perderá a adjacência com o
roteador R3:
R4#debug ip rip
*Dec 20 21:23:05.727: RIP: ignored v2 packet from [Link] (invalid authentication)
Crie a mesma configuração no R4 e propague ela para os outros roteadores para resolver o
problema:
R4(config)#key chain CAFE
R4(config-keychain)#key 1
R4(config-keychain-key)#key-string CAFECOMREDES
R4(config)#interface ethernet 0/1
R4(config-if)#ip rip authentication mode md5
R4(config-if)#ip rip authentication key-chain CAFE
Para restringir a comunicação via RIP de fora do AS100 vamos utilizar o comando “passive
interface” no modo de configuração do protocolo, porém para exemplificar melhor, vamos
realizar o passive interface convencional no R3 e o passive interface default no R6 que são os
roteadores que se comunicam com outros ASs:
R3(config)#router rip
R3(config-router)#passive-interface ethernet 0/0
R6(config)#router rip
R6(config-router)#passive-interface default
R6(config-router)#no passive-interface ethernet 0/0
R6(config-router)#no passive-interface ethernet 0/1
Os 2 modos tem o mesmo efeito e você deverá escolher qual o método mais se adapta ao seu
ambiente ou ao que está sendo solicitado.
Por último, utilize o comando abaixo para alterar os timers padrões do protocolo 30,180,180 e
240 passarão para 15, 90, 90 e 120, mas primeiro verifique os timers padrões para comparação
no fim do lab:
R3#sh ip protocols | i sec
Sending updates every 0 seconds
Invalid after 0 seconds, hold down 0, flushed after 0
Sending updates every 30 seconds, next due in 21 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
R3(config-router)#timers basic 15 90 90 120
R3#sh ip protocols | i sec
Sending updates every 0 seconds
Invalid after 0 seconds, hold down 0, flushed after 0
Sending updates every 15 seconds, next due in 5 seconds
Invalid after 90 seconds, hold down 90, flushed after 120
Configuração
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#network [Link]
R3(config-router)#network [Link]
R3(config-router)#no auto-summary
R3(config-router)#timers basic 15 90 90 120
R3(config-router)#passive-interface ethernet 0/0
R3(config)#key chain CAFE
R3(config-keychain)#key 1
R3(config-keychain-key)#key-string CAFECOMREDES
R3(config)#interface ethernet 0/1
R3(config-if)#ip rip authentication mode md5
R3(config-if)#ip rip authentication key-chain CAFE
R3(config)#interface ethernet 0/2
R3(config-if)#ip rip authentication mode md5
R3(config-if)#ip rip authentication key-chain CAFE
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#network [Link]
R4(config-router)#network [Link]
R4(config-router)#no auto-summary
R4(config-router)#timers basic 15 90 90 120
R4(config)#key chain CAFE
R4(config-keychain)#key 1
R4(config-keychain-key)#key-string CAFECOMREDES
R4(config)#interface ethernet 0/0
R4(config-if)#ip rip authentication mode md5
R4(config-if)#ip rip authentication key-chain CAFE
R4(config)#interface ethernet 0/1
R4(config-if)#ip rip authentication mode md5
R4(config-if)#ip rip authentication key-chain CAFE
R5(config)#router rip
R5(config-router)#version 2
R5(config-router)#network [Link]
R5(config-router)#network [Link]
R5(config-router)#no auto-summary
R5(config-router)#timers basic 15 90 90 120
R5(config)#key chain CAFE
R5(config-keychain)#key 1
R5(config-keychain-key)#key-string CAFECOMREDES
R5(config)#interface ethernet 0/0
R5(config-if)#ip rip authentication mode md5
R5(config-if)#ip rip authentication key-chain CAFE
R5(config)#interface ethernet 0/1
R5(config-if)#ip rip authentication mode md5
R5(config-if)#ip rip authentication key-chain CAFE
R6(config)#router rip
R6(config-router)#version 2
R6(config-router)#network [Link]
R6(config-router)#network [Link]
R6(config-router)#no auto-summary
R6(config-router)#timers basic 15 90 90 120
R6(config-router)#passive-interface default
R6(config-router)#no passive-interface ethernet 0/0
R6(config-router)#no passive-interface ethernet 0/1
R6(config)#key chain CAFE
R6(config-keychain)#key 1
R6(config-keychain-key)#key-string CAFECOMREDES
R6(config)#interface ethernet 0/0
R6(config-if)#ip rip authentication mode md5
R6(config-if)#ip rip authentication key-chain CAFE
R6(config)#interface ethernet 0/1
R6(config-if)#ip rip authentication mode md5
R6(config-if)#ip rip authentication key-chain CAFE
Layer 3 Lab 11 – EIGRP
(configuração inicial em EIGRP)
Objetivo Proposto
- Configure os roteadores do AS100 para se comunicarem via EIGRP AS100;
- Propague as redes configuradas nas interfaces Loopback dentro do AS100 e garanta
conectividade entre elas;
- Altere as métricas de “K” para os valores K1=1 K2=1 K3=1 K4=0 K5=0
- Faça com que o roteador R3 utilize preferencialmente o roteador R5 para alcançar a loopback
do roteador R6.
- Configure para que os roteadores do AS100 não propaguem nenhuma informação de EIGRP
para roteadores fora do próprio AS;
- Configure autenticação utilizando a key-string CAFECOMREDES e MD5 como modo de
autenticação entre os roteadores.
Passo a Passo
O protocolo EIGRP (Enhanced Interior Gateway Routing Protocol) é o protocolo de roteamento
dinâmico derivado do IGRP (legado) com o melhor tempo de convergência entre todos os IGPs,
utiliza o algoritimo de atualização por difusão (DUAL) e é um protocolo híbrido (vetor de
distância com características de link state), além de ser um protocolo bem simples de se
trabalhar.
Ele se comunica via multicast pelo endereço [Link] e utiliza os seguintes pacotes para se
comunicar:
Hello: Descoberta e recuperação de neighbors;
Acks: Reconhece o recebimento de uma atualização (enviado via unicast);
Updates: Pacotes de atualização para formação/manutenção da tabela de roteamento;
Queries: Usadas para solicitar ao neighbor um novo caminho para uma rota recentemente
perdida;
Replies: São enviados quando o destino entra em estado ativo (resposta as queries);
Convergência:
Feasible distance - Esta é a melhor métrica ao longo de todos os caminhos para uma rede
remota.
Reported distance - Essa é a métrica de uma rede remota, como relatado por um vizinho. É
métrica da tabela de roteamento do vizinho.
Successor - Successor é o melhor caminho para uma rede remota. A rota successor é usada
pelo EIGRP para encaminhar o tráfego para um destino e é armazenado na tabela de
roteamento.
Feasible successor - O caminho que não é um sucessor, mas satisfaz a condição de viabilidade.
O feasible successor é um caminho cuja “reported distance” é menor do que a “feasible
distance”, e é considerada como uma via de backup.
Feasibility condition- Quando múltiplos caminhos para a mesma subrede existem, Reported
Distance(RD) precisa ser menor do que a Feasible Distance(FD)
Não é tão utilizado no dia-a-dia devido a ter sido por um bom tempo proprietário Cisco e não
ser aceito em outros vendors, porém é cobrado em todas as provas de certificação de R&S da
Cisco.
O primeiro passo para configurar o EIGRP é habilitar o protocolo com o AS informado acima e
habilitar as interfaces que irão se comunicar via EIGRP:
R3(config)#router eigrp 100
R3(config-router)# network [Link] [Link]
R3(config-router)# network [Link] [Link]
Observe que o comando network, ao contrário dos outros protocolos, não propaga a rede
informada, mas sim informa qual interface irá se comunicar via EIGRP, com os comandos
acima você habilita todas as interfaces que estão no bloco [Link]/24, agora realize nos
outros roteadores:
R4(config)#router eigrp 100
R4(config-router)# network [Link] [Link]
R4(config-router)# network [Link] [Link]
R5(config)#router eigrp 100
R5(config-router)# network [Link] [Link]
R5(config-router)# network [Link] [Link]
R6(config)#router eigrp 100
R6(config-router)# network [Link] [Link]
R6(config-router)# network [Link] [Link]
Verifique as rotas recebidas via EIGRP após as adjacências serem fechadas e teste a
conectividade com as redes loopbacks:
R3#sh ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
D [Link] [90/409600] via [Link], 02:13:18, Ethernet0/1
[Link]/32 is subnetted, 1 subnets
D [Link] [90/409600] via [Link], 02:12:57, Ethernet0/2
[Link]/32 is subnetted, 1 subnets
D [Link] [90/435200] via [Link], 02:12:31, Ethernet0/2
[90/435200] via [Link], 02:12:31, Ethernet0/1
[Link]/24 is variably subnetted, 6 subnets, 2 masks
D [Link]/30 [90/307200] via [Link], 02:12:36, Ethernet0/1
D [Link]/30
[90/307200] via [Link], 02:12:36, Ethernet0/2
R3#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/5/21 ms
R3#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R3#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/6/27 ms
O próximo passo é alterar os valores de K do protocolo, primeiro vamos verificar os valores
padrões:
Composição da Metrica= [K1*Bandwidth+ (K2*Bandwidth)/ (256-load)
+k3*delay]*[K5/reliability+K4)]
K1= Bandwith
K2= Load
K3= Delay
K4= Reliability
K5= MTU
R3#sh ip protocols
*** IP Routing is NSF aware ***
Routing Protocol is "application"
Sending updates every 0 seconds
Invalid after 0 seconds, hold down 0, flushed after 0
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Maximum path: 32
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 4)
Routing Protocol is "eigrp 100"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP-IPv4 Protocol for AS(100)
Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
NSF-aware route hold timer is 240
Router-ID: [Link]
Topology : 0 (base)
Active Timer: 3 min
Distance: internal 90 external 170
Maximum path: 4
Maximum hopcount 100
Maximum metric variance 1
Automatic Summarization: disabled
Maximum path: 4
Routing for Networks:
[Link]/32
[Link]
Routing Information Sources:
Gateway Distance Last Update
[Link] 90 02:20:05
[Link] 90 02:20:05
Distance: internal 90 external 170
Como podemos observar, por padrão apenas K1 e K3 são utilizados para calcular a métrica por
padrão no EIGRP, vamos alterar esses valores e verificar o que acontece com os neighbors:
R3(config)#router eigrp 100
R3(config-router)#metric weights 0 1 1 1 0 0
*Dec 23 18:40:55.008: %DUAL-5-NBRCHANGE: EIGRP-IPv4 100: Neighbor [Link] (Ethernet0/1) is down: K-
value mismatch
R4(config)#router eigrp 100
R4(config-router)#metric weights 0 1 1 1 0 0
R5(config)#router eigrp 100
R5(config-router)#metric weights 0 1 1 1 0 0
R6(config)#router eigrp 100
R6(config-router)#metric weights 0 1 1 1 0 0
Verifique novamente as rotas recebidas via EIGRP e as métricas utilizadas:
R3#sh ip protocols
*** IP Routing is NSF aware ***
Routing Protocol is "application"
Sending updates every 0 seconds
Invalid after 0 seconds, hold down 0, flushed after 0
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Maximum path: 32
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 4)
Routing Protocol is "eigrp 100"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP-IPv4 Protocol for AS(100)
Metric weight K1=1, K2=1, K3=1, K4=0, K5=0
NSF-aware route hold timer is 240
Router-ID: [Link]
Topology : 0 (base)
Active Timer: 3 min
Distance: internal 90 external 170
Maximum path: 4
Maximum hopcount 100
Maximum metric variance 1
Automatic Summarization: disabled
Maximum path: 4
Routing for Networks:
[Link]/32
[Link]
Routing Information Sources:
Gateway Distance Last Update
[Link] 90 00:04:31
[Link] 90 00:04:31
Distance: internal 90 external 170
R3#sh ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
D [Link] [90/410603] via [Link], 00:05:37, Ethernet0/1
[Link]/32 is subnetted, 1 subnets
D [Link] [90/410603] via [Link], 00:05:38, Ethernet0/2
[Link]/32 is subnetted, 1 subnets
D [Link] [90/436203] via [Link], 00:05:38, Ethernet0/2
[90/436203] via [Link], 00:05:38, Ethernet0/1
[Link]/24 is variably subnetted, 6 subnets, 2 masks
D [Link]/30 [90/308203] via [Link], 00:05:38, Ethernet0/1
D [Link]/30
[90/308203] via [Link], 00:05:38, Ethernet0/2
Verifique que as métricas aumentaram consideravelmente para todas as rotas.
Para a próxima task, verique o caminho atual para rede [Link]:
R3#traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 1 msec
[Link] 0 msec
[Link] 0 msec
2 [Link] 30 msec
[Link] 1 msec
[Link] 1 msec
O tráfego está sendo balanceado entre os 2 roteadores (R4 e R5), podemos manipular de
várias formas as métricas para que R5 vire a rota Sucessor do EIGRP, uma das formas mais
comuns e menos impactante é a alteração do delay (K3) nas interfaces dos roteadores:
R3#sh ip eigrp topology [Link] [Link]
EIGRP-IPv4 Topology Entry for AS(100)/ID([Link]) for [Link]/32
State is Passive, Query origin flag is 1, 2 Successor(s), FD is 435200
Descriptor Blocks:
[Link] (Ethernet0/1), from [Link], Send flag is 0x0
Composite metric is (435200/409600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
[Link] (Ethernet0/2), from [Link], Send flag is 0x0
Composite metric is (435200/409600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
R3(config)#interface ethernet 0/1
R3(config-if)#delay 100000
R3#sh ip eigrp topology [Link] [Link]
EIGRP-IPv4 Topology Entry for AS(100)/ID([Link]) for [Link]/32
State is Passive, Query origin flag is 1, 1 Successor(s), FD is 435200
Descriptor Blocks:
[Link] (Ethernet0/2), from [Link], Send flag is 0x0
Composite metric is (435200/409600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
[Link] (Ethernet0/1), from [Link], Send flag is 0x0
Composite metric is (26009600/409600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 1006000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
Outra forma de influenciar a métrica no EIGRP é utilizando offset-list, para isso vamos retirar a
configuração de delay realizada acima e adicionar o offset-list na configuração do roteador R4:
R3(config)#interface ethernet 0/1
R3(config-if)#no delay
R3#sh ip eigrp topology [Link] [Link]
EIGRP-IPv4 Topology Entry for AS(100)/ID([Link]) for [Link]/32
State is Passive, Query origin flag is 1, 2 Successor(s), FD is 435200
Descriptor Blocks:
[Link] (Ethernet0/1), from [Link], Send flag is 0x0
Composite metric is (435200/409600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
[Link] (Ethernet0/2), from [Link], Send flag is 0x0
Composite metric is (435200/409600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
Para criar o offset-list você precisa criar uma ACL simples com a rede que você quer influenciar
a métrica:
R4(config)#access-list 1 permit [Link]
Agora adicione a configuração de offset-list na configuração do eigrp
R4(config-router)# offset-list 1 in 10000
R4#sh access-lists
Standard IP access list 1
10 permit [Link] (4 matches)
R3#sh ip eigrp topology [Link] [Link]
EIGRP-IPv4 Topology Entry for AS(100)/ID([Link]) for [Link]/32
State is Passive, Query origin flag is 1, 1 Successor(s), FD is 435200
Descriptor Blocks:
[Link] (Ethernet0/2), from [Link], Send flag is 0x0
Composite metric is (435200/409600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
[Link] (Ethernet0/1), from [Link], Send flag is 0x0
Composite metric is (445200/419600), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7390 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
R3#traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 5 msec 1 msec 1 msec
2 [Link] 2 msec 1 msec *
Obs. As offset-list podem ser criadas tanto com “in” ou “out” e também podem ser
adicionadas apenas para as interfaces desejadas.
Para configurar os roteadores para não se comunicarem via EIGRP fora do AS 100, assim como
no RIP você pode configurar o passive-interface direto no router de duas formas:
R3(config)#router eigrp 100
R3(config-router)#passive-interface ethernet 0/0
R6(config)#router eigrp 100
R6(config-router)#passive-interface default
R6(config-router)#no passive-interface ethernet 0/0
R6(config-router)#no passive-interface ethernet 0/1
Para configurar a autenticação entre os roteadores do AS100 o processo é bem semelhante ao
de criar autenticação no protocolo RIP:
R3(config)#key chain CAFE
R3(config-keychain)#key 1
R3(config-keychain-key)#key-string CAFECOMREDES
R3(config)#interface ethernet 0/1
R3(config-if)#ip authentication mode eigrp 100 md5
R3(config-if)#ip authentication key-chain eigrp 100 CAFE
R3(config)#interface ethernet 0/2
R3(config-if)#ip authentication mode eigrp 100 md5
R3(config-if)#ip authentication key-chain eigrp 100 CAFE
R4(config)#key chain CAFE
R4(config-keychain)#key 1
R4(config-keychain-key)#key-string CAFECOMREDES
R4(config)#interface ethernet 0/0
R4(config-if)#ip authentication mode eigrp 100 md5
R4(config-if)#ip authentication key-chain eigrp 100 CAFE
R4(config)#interface ethernet 0/1
R4(config-if)#ip authentication mode eigrp 100 md5
R4(config-if)#ip authentication key-chain eigrp 100 CAFE
R5(config)#key chain CAFE
R5(config-keychain)#key 1
R5(config-keychain-key)#key-string CAFECOMREDES
R5(config)#interface ethernet 0/0
R5(config-if)#ip authentication mode eigrp 100 md5
R5(config-if)#ip authentication key-chain eigrp 100 CAFE
R5(config)#interface ethernet 0/1
R5(config-if)#ip authentication mode eigrp 100 md5
R5(config-if)#ip authentication key-chain eigrp 100 CAFE
R6(config)#key chain CAFE
R6(config-keychain)#key 1
R6(config-keychain-key)#key-string CAFECOMREDES
R6(config)#interface ethernet 0/1
R6(config-if)#ip authentication mode eigrp 100 md5
R6(config-if)#ip authentication key-chain eigrp 100 CAFE
R6(config)#interface ethernet 0/1
R6(config-if)#ip authentication mode eigrp 100 md5
R6(config-if)#ip authentication key-chain eigrp 100 CAFE
Configuração
R3(config)#router eigrp 100
R3(config-router)# network [Link] [Link]
R3(config-router)# network [Link] [Link]
R3(config)#key chain CAFE
R3(config-keychain)#key 1
R3(config-keychain-key)#key-string CAFECOMREDES
R3(config-router)#passive-interface ethernet 0/0
R3(config)#key chain CAFE
R3(config-keychain)#key 1
R3(config-keychain-key)#key-string CAFECOMREDES
R3(config)#interface ethernet 0/1
R3(config-if)#ip authentication mode eigrp 100 md5
R3(config-if)#ip authentication key-chain eigrp 100 CAFE
R3(config)#interface ethernet 0/2
R3(config-if)#ip authentication mode eigrp 100 md5
R3(config-if)#ip authentication key-chain eigrp 100 CAFE
R4(config)#router eigrp 100
R4(config-router)# network [Link] [Link]
R4(config-router)# network [Link] [Link]
R4(config)#key chain CAFE
R4(config-keychain)#key 1
R4(config-keychain-key)#key-string CAFECOMREDES
R4(config)#interface ethernet 0/0
R4(config-if)#ip authentication mode eigrp 100 md5
R4(config-if)#ip authentication key-chain eigrp 100 CAFE
R4(config)#interface ethernet 0/1
R4(config-if)#ip authentication mode eigrp 100 md5
R4(config-if)#ip authentication key-chain eigrp 100 CAFE
R4(config)#access-list 1 permit [Link]
R4(config-router)# offset-list 1 in 10000
R5(config)#router eigrp 100
R5(config-router)# network [Link] [Link]
R5(config-router)# network [Link] [Link]
R5(config)#key chain CAFE
R5(config-keychain)#key 1
R5(config-keychain-key)#key-string CAFECOMREDES
R5(config)#interface ethernet 0/0
R5(config-if)#ip authentication mode eigrp 100 md5
R5(config-if)#ip authentication key-chain eigrp 100 CAFE
R5(config)#interface ethernet 0/1
R5(config-if)#ip authentication mode eigrp 100 md5
R5(config-if)#ip authentication key-chain eigrp 100 CAFE
R6(config)#router eigrp 100
R6(config-router)# network [Link] [Link]
R6(config-router)# network [Link] [Link]
R6(config-router)#passive-interface default
R6(config-router)#no passive-interface ethernet 0/0
R6(config-router)#no passive-interface ethernet 0/1
R6(config)#key chain CAFE
R6(config-keychain)#key 1
R6(config-keychain-key)#key-string CAFECOMREDES
R6(config)#interface ethernet 0/1
R6(config-if)#ip authentication mode eigrp 100 md5
R6(config-if)#ip authentication key-chain eigrp 100 CAFE
R6(config)#interface ethernet 0/1
R6(config-if)#ip authentication mode eigrp 100 md5
R6(config-if)#ip authentication key-chain eigrp 100 CAFÉ
Layer 3 Lab 12 – EIGRP Named Mode
(configuração inicial em EIGRP Named Mode)
Objetivo Proposto
- Configure os roteadores do AS100 para se comunicarem via EIGRP named mode com o nome
de CAFE;
- Utilize a address-family ipv4 padrão para as configurações e o autonomous-system 100;
- Garanta que os roteadores não se comuniquem via EIGRP fora do AS100;
Passo a Passo
A Cisco lançou a partir da IOS 15.0 uma feature no EIGRP convencional, se trata do EIGRP Mult-
AF mode que permite uma configuração consolidada no processo global com a adição das af-
interface, além da possibilidade da configuração de VRFs, address-family, unicast, multicast
etc.
Além disso, ele já vem pronto para trabalhar com os valores das “Wide Metrics” e as suas
métricas já aparecem em picosegundos (problema antigo da versão clássica para trabalhar
com interfaces acima de 10GB).
R3(config)#router eigrp CAFE
R3(config-router)#address-family ipv4 autonomous-system 100
R3(config-router-af)# network [Link]
R3(config-router-af)#network [Link]
R3(config-router-af)#af-interface default
R3(config-router-af-interface)#passive-interface
R3(config-router-af)#af-interface ethernet 0/1
R3(config-router-af-interface)#no passive-interface
R3(config-router-af)#af-interface ethernet 0/2
R3(config-router-af-interface)#no passive-interface
R4(config)#router eigrp CAFE
R4(config-router)#address-family ipv4 autonomous-system 100
R4(config-router-af)# network [Link]
R4(config-router-af)#network [Link]
R5(config)#router eigrp CAFE
R5(config-router)#address-family ipv4 autonomous-system 100
R5(config-router-af)# network [Link]
R5(config-router-af)#network [Link]
R6(config)#router eigrp CAFE
R6(config-router)#address-family ipv4 autonomous-system 100
R6(config-router-af)# network [Link]
R6(config-router-af)#network [Link]
R6(config-router-af)#af-interface default
R6(config-router-af-interface)#passive-interface
R6(config-router-af)#af-interface ethernet 0/0
R6(config-router-af-interface)#no passive-interface
R6(config-router-af)#af-interface ethernet 0/1
R6(config-router-af-interface)#no passive-interface
Verifique que fica mais simples a análise do protocolo que está mais estruturado e organizado:
R3#sh run | s eigrp
router eigrp CAFE
!
address-family ipv4 unicast autonomous-system 100
af-interface default
passive-interface
exit-af-interface
af-interface Ethernet0/1
no passive-interface
exit-af-interface
af-interface Ethernet0/2
no passive-interface
exit-af-interface
topology base
exit-af-topology
network [Link]
network [Link]
exit-address-family
Verifique também que as métricas mudaram para atender as “Wide Metrics”:
R3#sh ip eigrp topology [Link] [Link]
EIGRP-IPv4 VR(CAFE) Topology Entry for AS(100)/ID([Link]) for [Link]/32
State is Passive, Query origin flag is 1, 2 Successor(s), FD is 196689920, RIB is 1536640
Descriptor Blocks:
[Link] (Ethernet0/1), from [Link], Send flag is 0x0
Composite metric is (196689920/131153920), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 2001250000 picoseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
[Link] (Ethernet0/2), from [Link], Send flag is 0x0
Composite metric is (196689920/131153920), route is Internal
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 2001250000 picoseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is [Link]
Obs. O nome dado ao processo do EIGRP é localmente significativo, não precisa ser igual nos
outros roteadores.
Configuração
R3(config)#router eigrp CAFE
R3(config-router)#address-family ipv4 autonomous-system 100
R3(config-router-af)# network [Link]
R3(config-router-af)#network [Link]
R3(config-router-af)#af-interface default
R3(config-router-af-interface)#passive-interface
R3(config-router-af)#af-interface ethernet 0/1
R3(config-router-af-interface)#no passive-interface
R3(config-router-af)#af-interface ethernet 0/2
R3(config-router-af-interface)#no passive-interface
R4(config)#router eigrp CAFE
R4(config-router)#address-family ipv4 autonomous-system 100
R4(config-router-af)# network [Link]
R4(config-router-af)#network [Link]
R5(config)#router eigrp CAFE
R5(config-router)#address-family ipv4 autonomous-system 100
R5(config-router-af)# network [Link]
R5(config-router-af)#network [Link]
R6(config)#router eigrp CAFE
R6(config-router)#address-family ipv4 autonomous-system 100
R6(config-router-af)# network [Link]
R6(config-router-af)#network [Link]
R6(config-router-af)#af-interface default
R6(config-router-af-interface)#passive-interface
R6(config-router-af)#af-interface ethernet 0/0
R6(config-router-af-interface)#no passive-interface
R6(config-router-af)#af-interface ethernet 0/1
R6(config-router-af-interface)#no passive-interface
Layer 3 Lab 13 – OSPFv2
(configuração inicial em OSPF)
Objetivo Proposto
- Configure os roteadores R4, R5 e R6 do AS100 para se comunicarem via OSPF área 0;
- Configure os roteadores R4 e R5 para se comunicarem via OSPF com a configuração
diretamente nas interfaces;
- Configure o roteador R3 AS100 para se comunicarem via OSPF área 1;
- Configure o roteadore R7 do AS200 para se comunicar via OSPF área 2;
- Configure o roteadore R8 do AS200 para se comunicar via OSPF área 3;
- Configure o router-id dos roteadores com os IPs das interfaces loopbacks dos mesmos;
- Configure a autenticação da área 0 utilizando MD5 com a senha CAFECOMREDES, já a
autenticação da área 2 deverá ser em plain-text com a mesma senha;
- Configure para que os roteadores R3 e R8 não se comuniquem via OSFP fora dos seus
respectivos ASs;
- Configure um virtual link para resolver o problema de design da rede;
- Altere o modo do OSPF dos roteadores R7 e R8 para point-to-point network;
- Propague a rota default para os roteadores do AS200 via R6;
- Diminua os timers (hello timer e dead interval) do OSPF da área 0 pela metade do padrão;
Passo a Passo
OSPF (Open Shortest Path First) é um dos protocolos de roteamento mais utilizados no
mercado, ele é um protocolo link-state (analisa o estado da conexão) e utiliza o algoritimo SPF
(Dijkstra) para calcular o menor custo para uma rota.
O OSPF utiliza alguns conceitos importantes para o entendimento do protocolo, segue alguns
deles:
- Possui algumas variações de topologias (broadcast, non-broadcast ou NBMA, point-to-point e
point-to-multipoint);
- Realiza uma eleição de DR (Designated Router) BRD (Backup Designated Router) em
segmentos de multiacessos, essa eleição utiliza os seguintes critérios:
- Maior prioridade OSPF (0 – 255 sendo 1 o default);
- Maior Router ID (mais comum método de manipulação);
- Maior endereço Loopback;
- Maior IP configurado nas interfaces (interface up/up).
- Utiliza o endereço Multicast [Link] para os roteadores normais (áreas convencionais) e
[Link] para o DR/BDR;
O OSPF utiliza a troca de LSAs (Link State Advertisement) para manter a sua database (LSDB)
atualizada entre os roteadores, podendo existir alguns tipos de LSAs:
LSA Type 1: Router LSA – Gerado pelos roteadores de uma mesma área listando as interfaces
que estão partipando dessa área;
LSA Type 2: Network LSA – Gerado pelo DR, possui o router ID do mesmo, informando todos
os routers que estão conectados no DR;
LSA Type 3: Summary LSA – Gerado pelo ABR e propagado para outras áreas em que ele está
conectado (ex. ABR da área 1 injeta os LSA type 3 na área 0) informando os prefixos/redes que
precisam passar por ele para chegar no destino;
LSA Type 4: Summary ASBR LSA – Gerado pelo ASBR para os outros roteadores o encontrá-lo
na rede, possúi o router ID do ASBR no anuncio;
LSA Type 5: Autonomous system external LSA – Gerados pelo ASBR para anunciar rotas
externas (pode ser enviado pelo ABR da área 0 informando a existência de um ASBR pra dentro
da área 0);
LSA Type 6: Multicast OSPF LSA – Não suportado pela Cisco/não é muito utilizado (multicast
OSPF LSA);
LSA Type 7: Not-so-stubby area LSA – NSSA (Not-so-stubbt-area)
LSA Type 8: External attribute LSA for BGP (nunca foi padronizado).
LSA Type 9, 10 e 11: LSAs criados para uso futuro;
Área Stubby não permite a entrada de LSAs tipo 4 e 5 (nada externo) e o ABR injeta uma rota
default para dentro dessa área;
Área Totally Stubby: não permite a entrada de LSAs tipo 4 e 5 e nem do tipo 3, o ABR divulga
também a rota default para essa área;
Área NSSA: parecido com a área Stubby (barra LSA 4 e 5) mas permite a entrada de ASBR na
área com a utilização do LSA tipo 7 (não tem rota default injetada);
Área Totally NSSA: Esssa é parecida com a Totally Stubby (barra LSA 3,4 e 5) mas permite o
LSA tipo 7 e permite rota default
Algumas regras devem ser mantidas para o bom funcionamento do protocolo:
- Todas as áreas devem se comunicar diretamente com a área 0 (backbone área), caso não
seja possível, pode se utilizar o virtual link (enlace virtual) para realizar essa comunicação;
- O MTU das interfaces devem ser iguais;
- O protocolo utiliza alguns estados para informar se a adjacência foi formada ou não:
- Down – primeiro estado, nenhum hello foi recebido;
- Attempt state - Esse estado só é visto em ambientes NBMA em que o roteador envia hellos
via unicast para os neighbors;
- Init state – O roteador recebeu um hello do neighbor;
- 2-way state (Bidirecional) – Comunicação bidirecional foi estabelecida, os roteadores estão
trocando hellos, também ficam nesse estado os neighbors que se não são o DR e BDR em uma
rede multiacesso (broadcast e NBMA);
- Exstart state– Os roteadores trocam informações para realizar a eleição de DR e BDR;
- Exchange state – As trocas/comparações e verificações das bases estão sendo feitras entre
os roteadores para descobrirem o mapa da rede;
- Loading state – Ocorre a troca real de informações sobre os links states;
- Full state – Operação normal do OSPF com LSAs sendo trocados e os databases
sincronizados.
Os intervalos default dos timers do OSPF são:
-Redes Broadcast e point-to-point – Hello 10 segundos
- Redes NBMA – Hello 30 segundos
- Dead time – 4x o valor do hello
-Wait timer – igual ao valo de Dead time
Outro ponto importante no OSPF é que os routers são classificados da seguinte forma:
- Internal Router – todas as interfaces na mesma área;
- Backbone Router – Internal router na ára 0;
- (ABR) Area Border Router – equipamento que possuí uma ou mais interfaces em áreas
diferentes da área 0;
- (ASBR) Autonomous System Border Router – Equipamento que está em um AS diferente e
redistribui rotas de outros protocolos para dentro do OSPF (ex. BGP redistribuindo para dentro
do OSFP).
Primeiro vamos realizar as configurações básicas do OSPF nos roteadores conforme as 5
primeiras tasks do lab, observe que a configuração é bem simples, lembrando sempre que o
router process (router ospf 1) é localmente válido e também é utilizado wildcard mask para o
comando network conforme abaixo:
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#router-id [Link]
R4(config)#interface ethernet 0/0
R4(config-if)#ip ospf 1 area 1
R4(config-if)#interface ethernet 0/1
R4(config-if)#ip ospf 1 area 0
R4(config-if)#interface loopback 0
R4(config-if)#ip ospf 1 area 0
R4(config)#router ospf 1
R4(config-router)#router-id [Link]
R5(config)#interface ethernet 0/0
R5(config-if)#ip ospf 1 area 1
R5(config-if)#interface ethernet 0/1
R5(config-if)#ip ospf 1 area 0
R5(config-if)#interface loopback 0
R5(config-if)#ip ospf 1 area 0
R5(config)#router ospf 1
R4(config-router)#router-id [Link]
R6(config)#router ospf 1
R6(config-router)#network [Link] [Link] area 0
R6(config-router)#network [Link] [Link] area 0
R6(config-router)#network [Link] [Link] area 2
R6(config-router)#router-id [Link]
R7(config)#router ospf 1
R7(config-router)#network [Link] [Link] area 2
R7(config-router)#network [Link] [Link] area 2
R7(config-router)#network [Link] [Link] area 3
R7(config-router)#router-id [Link]
R8(config)#router ospf 1
R8(config-router)#network [Link] [Link] area 3
R8(config-router)#network [Link] [Link] area 3
R8(config-router)#router-id [Link]
Outro detalhe interessante é que você deve colocar a área que essa interface/network irá
participar.
Agora vamos analisar o ospf database do R3 e comparar com o R6:
R3#sh ip ospf database
OSPF Router with ID ([Link]) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
[Link] [Link] 295 0x8000000C 0x00CB93 1
[Link] [Link] 237 0x8000000C 0x00DF6F 1
[Link] [Link] 55 0x8000000E 0x008F6E 3
Net Link States (Area 1)end
Link ID ADV Router Age Seq# Checksum
[Link] [Link] 316 0x8000000B 0x00911D
[Link] [Link] 55 0x8000000B 0x009B0B
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
[Link] [Link] 295 0x8000000B 0x004EC3
[Link] [Link] 237 0x8000000B 0x00F801
[Link] [Link] 295 0x8000000B 0x00E811
[Link] [Link] 237 0x8000000B 0x000208
[Link] [Link] 295 0x8000000B 0x0056A9
[Link] [Link] 237 0x8000000B 0x0038C3
[Link] [Link] 52 0x8000000B 0x00AA11
[Link] [Link] 237 0x8000000B 0x008C2B
[Link] [Link] 295 0x8000000B 0x00FC49
[Link] [Link] 237 0x8000000B 0x0043F4
[Link] [Link] 295 0x8000000B 0x0039FE
[Link] [Link] 237 0x8000000B 0x00B687
[Link] [Link] 52 0x8000000B 0x009F73
[Link] [Link] 237 0x8000000B 0x00818D
OSPF Router with ID ([Link]) (Process ID 100)
R6#sh ip ospf database
OSPF Router with ID ([Link]) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
[Link] [Link] 471 0x8000000D 0x001717 2
[Link] [Link] 413 0x8000000C 0x00C554 2
[Link] [Link] 333 0x8000000E 0x0066DC 3
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
[Link] [Link] 471 0x8000000B 0x005AC9
[Link] [Link] 595 0x8000000B 0x00FD15
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
[Link] [Link] 471 0x8000000C 0x00DE2C
[Link] [Link] 413 0x8000000B 0x00C245
[Link] [Link] 333 0x8000000B 0x000AB3
[Link] [Link] 471 0x8000000C 0x004B02
[Link] [Link] 413 0x8000000B 0x0093AC
[Link] [Link] 471 0x8000000C 0x0087B7
[Link] [Link] 413 0x8000000B 0x00073F
[Link] [Link] 333 0x8000000B 0x00FE16
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
[Link] [Link] 333 0x8000000C 0x009F1D 2
[Link] [Link] 105 0x80000010 0x009EE8 3
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
[Link] [Link] 333 0x8000000C 0x0007F1
[Link] [Link] 333 0x8000000C 0x00748A
[Link] [Link] 333 0x8000000C 0x0046B4
[Link] [Link] 333 0x8000000C 0x00B34D
[Link] [Link] 333 0x8000000C 0x0073C7
[Link] [Link] 333 0x8000000C 0x004BEB
[Link] [Link] 333 0x8000000C 0x00BE7E
[Link] [Link] 333 0x8000000C 0x0096A2
R6#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
[Link] 1 FULL/BDR 00:00:38 [Link] Ethernet0/1
[Link] 1 FULL/BDR 00:00:36 [Link] Ethernet0/0
[Link] 0 FULL/ - 00:00:36 [Link] Serial1/0
O OSPF possuí 3 metodos de autenticação, o message-digest (MD5), o plain-text (texto normal)
e o null (sem autenticação), a configuração é realizada por interface também, com uma
observação que você precisa informar no processo do ospf ou na interface o método de
autenticação conforme abaixo:
R6(config)#router ospf 1
R6(config-router)#area 0 authentication message-digest
R6(config-if)#interface ethernet 0/0
R6(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
R6(config-if)#interface ethernet 0/1
R6(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
R4(config)#interface ethernet 0/1
R4(config-if)#ip ospf authentication message-digest
R4(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
R5(config)#interface ethernet 0/1
R5(config-if)#ip ospf authentication message-digest
R5(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
Para configurar a autenticação na área 2 utilize os comandos abaixo, observe que o limite de
caracteres é de 8:
R6(config)#interface serial 1/0
R6(config-if)#ip ospf authentication
R6(config-if)#ip ospf authentication-key CAFECOMREDES
% OSPF: Warning: The password/key will be truncated to 8 characters
R7(config)#interface serial 1/0
R7(config-if)#ip ospf authentication
R7(config-if)#ip ospf authentication-key CAFECOMREDES
% OSPF: Warning: The password/key will be truncated to 8 characters
Assim como a configuração dos outros protocolos, o passive interface também é utilizado no
OSPF de 2 formas diferentes, a primeira informando a interface e a segunda informando que
todas as interfaces entrarão em modo passive e depois habilitando as que falam OSPF:
R3(config)#router ospf 1
R3(config-router)#passive-interface ethernet 0/0
R8(config)#router ospf 1
R8(config-router)#passive-interface default
R8(config-router)#no passive-interface ethernet 0/0
Para resolver o problema de design da rede OSPF do lab, devemos observar que a área 3
(comunicação entre o R7 e R8) não estão conectados diretamente na área 0, sendo assim
devemos utilizar um virtual link na área 2 que irá na verdade transportar todos os LSAs e os
pacotes OSPF diretamente para a área 0:
R6(config)#router ospf 1
R6(config-router)# area 2 virtual-link [Link]
R7(config)#router ospf 1
R7(config-router)# area 2 virtual-link [Link]
Verifique que o R8 agora se comporta como um ABR e possui as rotas para as redes
informadas (inclusive as rotas intra-area):
R8#sh ip ospf database
OSPF Router with ID ([Link]) (Process ID 1)
Router Link States (Area 3)
Link ID ADV Router Age Seq# Checksum Link count
[Link] [Link] 939 0x80000010 0x0048E5 2
[Link] [Link] 1030 0x80000012 0x008B6B 3
Summary Net Link States (Area 3)
Link ID ADV Router Age Seq# Checksum
[Link] [Link] 874 0x80000001 0x00813E
[Link] [Link] 874 0x80000001 0x00EED6
[Link] [Link] 874 0x80000001 0x00C001
[Link] [Link] 874 0x80000001 0x002E99
[Link] [Link] 940 0x80000001 0x007D86
[Link] [Link] 874 0x80000001 0x00ED14
[Link] [Link] 874 0x80000001 0x00C538
[Link] [Link] 874 0x80000001 0x0039CA
[Link] [Link] 874 0x80000001 0x0011EE
[Link] [Link] 940 0x80000001 0x00F426
R8#sh ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/95] via [Link], 00:15:23, Ethernet0/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/85] via [Link], 00:15:23, Ethernet0/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/85] via [Link], 00:15:23, Ethernet0/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/75] via [Link], 00:15:23, Ethernet0/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/11] via [Link], 00:16:17, Ethernet0/0
[Link]/30 is subnetted, 4 subnets
O IA [Link] [110/94] via [Link], 00:15:23, Ethernet0/0
O IA [Link] [110/94] via [Link], 00:15:23, Ethernet0/0
O IA [Link] [110/84] via [Link], 00:15:23, Ethernet0/0
O IA [Link] [110/84] via [Link], 00:15:23, Ethernet0/0
[Link]/30 is subnetted, 1 subnets
O IA [Link] [110/74] via [Link], 00:16:17, Ethernet0/0
A alteração do tipo de rede OSPF é feita diretamente na interface conforme as opções abaixo:
R7(config-if)#ip ospf network ?
broadcast Specify OSPF broadcast multi-access network
non-broadcast Specify OSPF NBMA network
point-to-multipoint Specify OSPF point-to-multipoint network
point-to-point Specify OSPF point-to-point network
R7(config)#interface ethernet 0/0
R7(config-if)#ip ospf network point-to-point
R8(config)#interface ethernet 0/0
R8(config-if)#ip ospf network point-to-point
Para propagar a rota default no OSPF utilizamos o comando “default-originate” dentro do
modo de configuração do protocolo conforme abaixo:
R6(config)#router ospf 1
R6(config-router)#default-information originate always metric 100 metric-type 1
R7#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is [Link] to network [Link]
O*E1 [Link]/0 [110/164] via [Link], 00:00:05, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/85] via [Link], 00:07:20, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/75] via [Link], 00:07:20, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/75] via [Link], 00:07:20, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/65] via [Link], 00:07:20, Serial1/0
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
[Link]/32 is subnetted, 1 subnets
O [Link] [110/11] via [Link], 06:57:13, Ethernet0/0
[Link]/16 is variably subnetted, 2 subnets, 2 masks
C [Link]/24 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
[Link]/30 is subnetted, 4 subnets
O IA [Link] [110/84] via [Link], 00:07:20, Serial1/0
O IA [Link] [110/84] via [Link], 00:07:20, Serial1/0
O IA [Link] [110/74] via [Link], 00:07:20, Serial1/0
O IA [Link] [110/74] via [Link], 00:07:20, Serial1/0
[Link]/24 is variably subnetted, 2 subnets, 2 masks
C [Link]/30 is directly connected, Serial1/0
L [Link]/32 is directly connected, Serial1/0
É interessante observar que o comando “Always” força a criação da rota default nos demais
roteadores mesmo que o R6 não possua rota default criada, um bom teste para esse ambiente
é retirar o comando “Always” e verficar se a rota default permanece nos roteadores OSPF:
R6(config)#router ospf 1
R6(config-router)#no default-information originate always metric 100 metric-type 1
R6(config-router)#no default-information originate metric 100 metric-type 1
R7#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/85] via [Link], 00:11:22, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/75] via [Link], 00:11:22, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/75] via [Link], 00:11:22, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/65] via [Link], 00:11:22, Serial1/0
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
[Link]/32 is subnetted, 1 subnets
O [Link] [110/11] via [Link], 07:01:15, Ethernet0/0
[Link]/16 is variably subnetted, 2 subnets, 2 masks
C [Link]/24 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
[Link]/30 is subnetted, 4 subnets
O IA [Link] [110/84] via [Link], 00:11:22, Serial1/0
O IA [Link] [110/84] via [Link], 00:11:22, Serial1/0
O IA [Link] [110/74] via [Link], 00:11:22, Serial1/0
O IA [Link] [110/74] via [Link], 00:11:22, Serial1/0
[Link]/24 is variably subnetted, 2 subnets, 2 masks
C [Link]/30 is directly connected, Serial1/0
L [Link]/32 is directly connected, Serial1/0
Agora crie uma rota default no R6 simulando a saída de internet para o null0 e verifique que a
rota default voltará a ser propagada via OSPF:
R6(config)#ip route [Link] [Link] null 0
R6(config)#router ospf 1
R6(config-router)#default-information originate metric 100 metric-type 1
R7#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is [Link] to network [Link]
O*E1 [Link]/0 [110/164] via [Link], 00:00:00, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/85] via [Link], 00:13:57, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/75] via [Link], 00:13:57, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/75] via [Link], 00:13:57, Serial1/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/65] via [Link], 00:13:57, Serial1/0
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
[Link]/32 is subnetted, 1 subnets
O [Link] [110/11] via [Link], 07:03:50, Ethernet0/0
[Link]/16 is variably subnetted, 2 subnets, 2 masks
C [Link]/24 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
[Link]/30 is subnetted, 4 subnets
O IA [Link] [110/84] via [Link], 00:13:57, Serial1/0
O IA [Link] [110/84] via [Link], 00:13:57, Serial1/0
O IA [Link] [110/74] via [Link], 00:13:57, Serial1/0
O IA [Link] [110/74] via [Link], 00:13:57, Serial1/0
[Link]/24 is variably subnetted, 2 subnets, 2 masks
C [Link]/30 is directly connected, Serial1/0
L [Link]/32 is directly connected, Serial1/0
O comando Always ajuda também na estabilidade da rede ospf pois caso você não o utilize,
quando ocorrer algum flap de link ou queda (para onde é apontada a rota default) os
roteadores irão receber um flood de LSA tipo5 dentro do OSPF.
Outro comando interessante é o tipo da métrica que você pode escolher, metric type 1 ou 2,
também influência na escolha das melhores rotas:
1º. Intra-area routes.
2º. Inter-area routes.
3º. External Type-1 routes.
4.º External Type-2 routes.
Por último, vamos alterar os valores de hello e dead-interval dos roteadores R6, R4 e R5
conforme solicitado:
R6(config)#interface ethernet 0/0
R6(config-if)#ip ospf dead-interval 20
R6(config-if)# ip ospf hello-interval 5
R6(config)#interface ethernet 0/1
R6(config-if)#ip ospf dead-interval 20
R6(config-if)# ip ospf hello-interval 5
*Dec 29 19:35:35.477: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Ethernet0/0 fro
m FULL to DOWN, Neighbor Down: Dead timer expired
R4(config)#interface ethernet 0/1
R4(config-if)#ip ospf dead-interval 20
R4(config-if)# ip ospf hello-interval 5
R5(config)#interface ethernet 0/1
R5(config-if)#ip ospf dead-interval 20
R5(config-if)# ip ospf hello-interval 5
Verifique que enquanto trocamos os timers os neighbors vão caindo devido a diferença entre
eles, após as alterações, podemos verificar os timers configurados com o comando abaixo:
R4#sh ip ospf interface
Loopback0 is up, line protocol is up
Internet Address [Link]/32, Area 0, Attached via Interface Enable
Process ID 1, Router ID [Link], Network Type LOOPBACK, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Enabled by interface config, including secondary ip addresses
Loopback interface is treated as a stub Host
Ethernet0/1 is up, line protocol is up
Internet Address [Link]/30, Area 0, Attached via Interface Enable
Process ID 1, Router ID [Link], Network Type BROADCAST, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
0 10 no no Base
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) [Link], Interface address [Link]
Backup Designated router (ID) [Link], Interface address [Link]
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:04
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 4
Last flood scan time is 0 msec, maximum is 1 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor [Link] (Designated Router)
Suppress hello for 0 neighbor(s)
Cryptographic authentication enabled
Youngest key id is 1
Configuração
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#router-id [Link]
R3(config-router)#passive-interface ethernet 0/0
R4(config)#interface ethernet 0/0
R4(config-if)#ip ospf 1 area 1
R4(config-if)#interface ethernet 0/1
R4(config-if)#ip ospf 1 area 0
R4(config-if)#ip ospf authentication message-digest
R4(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
R4(config-if)#ip ospf dead-interval 20
R4(config-if)# ip ospf hello-interval 5
R4(config-if)#interface loopback 0
R4(config-if)#ip ospf 1 area 0
R4(config)#router ospf 1
R4(config-router)#router-id [Link]
R5(config)#interface ethernet 0/0
R5(config-if)#ip ospf 1 area 1
R5(config-if)#interface ethernet 0/1
R5(config-if)#ip ospf 1 area 0
R5(config-if)#ip ospf authentication message-digest
R5(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
R5(config-if)#ip ospf dead-interval 20
R5(config-if)# ip ospf hello-interval 5
R5(config-if)#interface loopback 0
R5(config-if)#ip ospf 1 area 0
R4(config-router)#router-id [Link]
R6(config)#router ospf 1
R6(config-router)#network [Link] [Link] area 0
R6(config-router)#network [Link] [Link] area 0
R6(config-router)#router-id [Link]
R6(config-router)#area 0 authentication message-digest
R6(config-router)# area 2 virtual-link [Link]
R6(config-router)#default-information originate always metric 100 metric-type 1
R6(config-if)#interface ethernet 0/0
R6(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
R6(config-if)#ip ospf dead-interval 20
R6(config-if)# ip ospf hello-interval 5
R6(config-if)#interface ethernet 0/1
R6(config-if)#ip ospf message-digest-key 1 md5 CAFECOMREDES
R6(config)#interface serial 1/0
R6(config-if)#ip ospf authentication
R6(config-if)#ip ospf authentication-key CAFECOMREDES
R6(config-if)#ip ospf dead-interval 20
R6(config-if)# ip ospf hello-interval 5
R6(config)#ip route [Link] [Link] null 0
R7(config)#router ospf 1
R7(config-router)#network [Link] [Link] area 2
R7(config-router)#network [Link] [Link] area 2
R7(config-router)#network [Link] [Link] area 3
R7(config-router)#router-id [Link]
R7(config-router)# area 2 virtual-link [Link]
R7(config)#interface serial 1/0
R7(config-if)#ip ospf authentication
R7(config-if)#ip ospf authentication-key CAFECOMREDES
R7(config)#interface ethernet 0/0
R7(config-if)#ip ospf network point-to-point
R8(config)#router ospf 1
R8(config-router)#network [Link] [Link] area 3
R8(config-router)#network [Link] [Link] area 3
R8(config-router)#router-id [Link]
R8(config-router)#passive-interface default
R8(config-router)#no passive-interface ethernet 0/0
R8(config)#interface ethernet 0/0
R8(config-if)#ip ospf network point-to-point
WAN Lab 14 – BGP
(configuração inicial em BGP)
Objetivo Proposto
-Configure o protocolo EIGRP AS 100 como IGP dos peers BGP, propague o endereço das
loopbacks dentro do EIGRP;
- Configure os roteadores do AS100 como IBGP;
- Configure o roteador R3 como route-reflector do AS100;
- Configure os peeers entre o AS100, AS200 e o AS 300 e garanta comunicação entre a
loopback de todos os roteadores;
- Utilize as interfaces loopbacks para comunicação entre os peers;
- Crie uma loopback com o ip [Link]/32 no roteador R1 e outra no R8;
- Configure autenticação no AS100 com a senha CAFECOMREDES entre os peers;
- Altere os timers padrão do AS 100 pela metade do padrão;
Passo a Passo
BGP – Boarder Gateway Protocol é o protocolo que provê comunicação entre os ASs (Sistemas
autônomous – redes ou grupo de redes sobre uma administração comum) e é o protocolo
base para comunicação entre os ISPs (service providers) hoje em dia.
O BGP possuí algumas particularidades, vou resumir algumas delas:
- Se divide em iBGP (internal) e eBGP (external);
- Utiliza a porta 179 TCP para estabelecer o peer (se o router estiver atrás de firewall cuidado
com esse detalhe);
- Utiliza ASNs para comunicação (autonomous system Numbers) é a conotação utilizada para
troca de paths;
- Para EBGP o TTL padrão é 1 (equipamentos Cisco), devendo ser alterado se necessário;
- É um dos protocolos com maior variedade de manipulação de rotas/parâmetros e engenharia
de tráfego;
Next_HOP - O next_hop deve ser alcançável "usado para chegar ao NLRI" - BGP PA = Well-
known mandatory;
Utiliza alguns mecanismos de desempate na escolha da melhor rota:
1º Weight - Propietario Cisco, quanto maior melhor, ex: # neighbor x.x.x.x weight 4;
2º Local preference, maior melhor, BPG PA = Well-known discretionary, default=100;
3º Rotas localmente injetadas (usando o comando #network, redistribuindo ou sumarizando);
4º Menor AS_Path (300,100,100,200) vs (300,100,200),
5º Melhor Origin PA- Well-known mandatory
6º Menor MED (Multi-exit discriminator) - optional nontransitive, tem o propósito de
informar ao AS vizinho qual é o melhor modo de encaminhar pacotes para o seu próprio AS, o
default é 0, vai de 0 a 4.294,967,295, quanto menor é melhor;
7º Prefere eBGP a iBGP
8º Menor métrica IGP para o next-hop;
9º Menor Router ID do router que propaga a rota
10º Menor neighbor ID
11º Menor tamanho de cluster list;
12º Menor neighbor address;
O primeiro passo antes de realizar as configurações de BGP é garantir a comunicação dos
roteadores via IGP, no caso foi escolhido o EIGRP para o processo:
R1(config)#router eigrp 100
R1(config-router)#network [Link]
R1(config-router)#network [Link]
R2(config)#router eigrp 100
R2(config-router)#network [Link]
R2(config-router)#network [Link]
R3(config)#router eigrp 100
R3(config-router)#network [Link]
R3(config-router)#network [Link]
R3(config-router)#network [Link]
R4(config)#router eigrp 100
R4(config-router)#network [Link]
R4(config-router)#network [Link]
R5(config)#router eigrp 100
R5(config-router)#network [Link]
R5(config-router)#network [Link]
R6(config)#router eigrp 100
R6(config-router)#network [Link]
R6(config-router)#network [Link]
R6(config-router)#network [Link]
R7(config)#router eigrp 100
R7(config-router)#network [Link]
R7(config-router)#network [Link]
R7(config-router)#network [Link]
R8(config)#router eigrp 100
R8(config-router)#network [Link]
R8(config-router)#network [Link]
Agora vamos realizar a configuração do AS100 com o R3 configurado como Route-Reflector do
AS:
R3(config)#router bgp 100
R3(config-router)#neighbor [Link] remote-as 100
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] remote-as 100
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] remote-as 100
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] route-reflector-client
R3(config-router)#neighbor [Link] route-reflector-client
R3(config-router)#neighbor [Link] route-reflector-client
R4(config)#router bgp 100
R4(config-router)#neighbor [Link] remote-as 100
R4(config-router)#neighbor [Link] update-source lo0
R5(config)#router bgp 100
R5(config-router)#neighbor [Link] remote-as 100
R5(config-router)#neighbor [Link] update-source lo0
R6(config)#router bgp 100
R6(config-router)#neighbor [Link] remote-as 100
R6(config-router)#neighbor [Link] update-source lo0
Para formar a adjacência entre o AS 100 e o AS200 devemos criar as configurações apontando
para o AS remoto ao invés do interno e devemos também informar que a adjacência será
formada por IPs que não estão diretamente conectados (Loopbacks):
R6(config)#router bgp 100
R6(config-router)#neighbor [Link] remote-as 200
R6(config-router)#neighbor [Link] update-source Loopback0
R6(config-router)#neighbor [Link] ebgp-multihop 2
R7(config)#router bgp 200
R7(config-router)# neighbor [Link] remote-as 100
R7(config-router)# neighbor [Link] update-source lo0
R7(config-router)# neighbor [Link] ebgp-multihop 2
R6#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 100 269 273 1 0 0 04:03:42 0
[Link] 4 200 43 43 1 0 0 00:36:01 0
O comando ebp-multihop não seria necessário se o neighbor fosse apontado para o IP da
interface física do router.
Para realizar a comunicação entre o AS 100 e o AS300 segue o mesmo padrão de configuração
acima:
R3(config)#router bgp 100
R3(config-router)#neighbor [Link] remote-as 300
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] remote-as 300
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] ebgp-multihop 2
R3(config-router)#neighbor [Link] ebgp-multihop 2
R1(config)#router bgp 300
R1(config-router)#neighbor [Link] remote-as 100
R1(config-router)#neighbor [Link] update-source lo0
R1(config-router)#neighbor [Link] remote-as 300
R1(config-router)#neighbor [Link] update-source lo0
R1(config-router)#neighbor [Link] ebgp-multihop 2
R2(config)#router bgp 300
R2(config-router)#neighbor [Link] remote-as 300
R2(config-router)#neighbor [Link] update-source lo0
R2(config-router)#neighbor [Link] remote-as 100
R2(config-router)#neighbor [Link] update-source lo0
R2(config-router)#neighbor [Link] ebgp-multihop 2
R3#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 300 8 6 1 0 0 00:04:22 0
[Link] 4 300 8 8 1 0 0 00:04:34 0
[Link] 4 100 1613 1610 1 0 0 1d00h 0
[Link] 4 100 289 287 1 0 0 04:19:27 0
[Link] 4 100 283 280 1 0 0 04:13:21 0
R1#sh ip bgp summary
BGP router identifier [Link], local AS number 300
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 300 11 12 1 0 0 00:07:22 0
[Link] 4 100 7 9 1 0 0 00:04:59 0
R2#sh ip bgp summary
BGP router identifier [Link], local AS number 300
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 300 12 12 1 0 0 00:07:53 0
[Link] 4 100 9 10 1 0 0 00:05:41 0
Verifique a comunicação entre as interfaces loopbacks conforme a task:
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/3 ms
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/12/28 ms
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
R1#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 11/11/12 ms
A configuração de update-source é uma boa prática para evitar que o peer fique suscetível a
quedas das interfaces físicas (contando que o roteador tenha outro caminho para chegar no
peer).
R3#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 100 8 8 1 0 0 00:04:04 0
[Link] 4 100 6 5 1 0 0 00:03:35 0
[Link] 4 100 5 4 1 0 0 00:02:19 0
Completando as configurações do AS 200:
R7(config-router)#neighbor [Link] remote-as 200
R7(config-router)#neighbor [Link] update-source lo0
R8(config)#router bgp 200
R8(config-router)#neighbor [Link] remote-as 200
R8(config-router)#neighbor [Link] update-source lo0
A configuração de autenticação ao contrário dos protocolos já vistos, é realizada diretamente
no neighbor conforme os comandos abaixo:
R3(config)#router bgp 100
R3(config-router)#neighbor [Link] password CAFECOMREDES
R3(config-router)#neighbor [Link] password CAFECOMREDES
R3(config-router)#neighbor [Link] password CAFECOMREDES
R4(config)#router bgp 100
R4(config-router)#neighbor [Link] password CAFECOMREDES
Agora antes de alterar as configurações dos roteadores R5 e R6 perceba que a comunicação
entre eles e o R3 (Route-reflector) não cai mesmo após a alteração da senha, para efeito de
testes vamos dar um clear na adjacência do R5 para analisar os logs:
R5#clear ip bgp *
R5#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 100 0 0 1 0 0 00:01:31 Active
R3#
*Jan 3 12:31:08.602: %TCP-6-BADAUTH: No MD5 digest from [Link](179) to [Link](50418) tableid - 0
*Jan 3 12:31:08.603: %TCP-6-BADAUTH: No MD5 digest from [Link](179) to [Link](50418) tableid - 0
*Jan 3 12:31:08.902: %TCP-6-BADAUTH: No MD5 digest from [Link](21810) to [Link](179) tableid - 0
R3#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down Stat/PfxRcd
[Link] 4 100 1321 1314 1 0 0 19:54:41 0
[Link] 4 100 0 0 1 0 0 00:13:42 Active
[Link] 4 100 1313 1315 1 0 0 19:52:56 0
R5(config)#router bgp 100
R5(config-router)#neighbor [Link] password 7 0225257D2E25200C7E6B2D3C36
R6(config)#router bgp 100
R6(config-router)#neighbor [Link] password 7 0225257D2E25200C7E6B2D3C36
R3#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 100 1413 1408 1 0 0 21:18:54 0
[Link] 4 100 87 85 1 0 0 01:16:31 0
[Link] 4 100 79 79 1 0 0 01:10:25 0
Obs. A senha pode ser adicionada criptografada (0 – 7) também.
Para verificar os timers default do bgp, utilize o comando:
R4#sh ip bgp neighbors [Link]
BGP neighbor is [Link], remote AS 100, internal link
BGP version 4, remote router ID [Link]
BGP state = Established, up for 1d01h
Last read 00:00:24, last write 00:00:53, hold time is 180, keepalive interval is 60 seconds
R4(config)#router bgp 100
R4(config-router)#neighbor [Link] timers 30 90
R3(config)#router bgp 100
R3(config-router)#neighbor [Link] timers 30 90
R3(config-router)#neighbor [Link] timers 30 90
R3(config-router)#neighbor [Link] timers 30 90
R3#clear ip bgp *
Verifique que mesmo após a alteração no R3 os peers com os outros routers não caíram, ao
contrário dos outros protocolos que não aceitam timers diferentes:
R3#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 300 4 4 1 0 0 00:00:04 0
[Link] 4 300 4 4 1 0 0 00:00:04 0
[Link] 4 100 4 4 1 0 0 00:00:04 0
[Link] 4 100 4 4 1 0 0 00:00:04 0
[Link] 4 100 4 4 1 0 0 00:00:04 0
R3#sh ip bgp neighbors [Link]
BGP neighbor is [Link], remote AS 100, internal link
BGP version 4, remote router ID [Link]
BGP state = Established, up for 00:01:50
Last read 00:00:25, last write 00:00:22, hold time is 90, keepalive interval is 30 seconds
Configured hold time is 90, keepalive interval is 30 seconds
Minimum holdtime from neighbor is 0 seconds
R3#sh ip bgp neighbors [Link]
BGP neighbor is [Link], remote AS 100, internal link
BGP version 4, remote router ID [Link]
BGP state = Established, up for 00:02:29
Last read 00:00:08, last write 00:00:10, hold time is 90, keepalive interval is 30 seconds
R6#sh ip bgp neighbors [Link]
BGP neighbor is [Link], remote AS 100, internal link
BGP version 4, remote router ID [Link]
BGP state = Established, up for 00:03:08
Last read 00:00:15, last write 00:00:22, hold time is 90, keepalive interval is 30 seconds
Neighbor sessions:
Observe que mesmo sem alterarmos os 2 lados, o BGP acaba negociando o menor valor.
Configuração
R1(config)#router eigrp 100
R1(config-router)#network [Link]
R1(config-router)#network [Link]
R1(config)#router bgp 300
R1(config-router)#neighbor [Link] remote-as 100
R1(config-router)#neighbor [Link] update-source lo0
R1(config-router)#neighbor [Link] remote-as 300
R1(config-router)#neighbor [Link] update-source lo0
R1(config-router)#neighbor [Link] ebgp-multihop 2
R2(config)#router eigrp 100
R2(config-router)#network [Link]
R2(config-router)#network [Link]
R2(config)#router bgp 300
R2(config-router)#neighbor [Link] remote-as 300
R2(config-router)#neighbor [Link] update-source lo0
R2(config-router)#neighbor [Link] remote-as 100
R2(config-router)#neighbor [Link] update-source lo0
R2(config-router)#neighbor [Link] ebgp-multihop 2
R3(config)#router eigrp 100
R3(config-router)#network [Link]
R3(config-router)#network [Link]
R3(config-router)#network [Link]
R3(config)#router bgp 100
R3(config-router)#neighbor [Link] remote-as 100
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] remote-as 100
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] remote-as 100
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] route-reflector-client
R3(config-router)#neighbor [Link] route-reflector-client
R3(config-router)#neighbor [Link] route-reflector-client
R3(config-router)#neighbor [Link] remote-as 300
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] remote-as 300
R3(config-router)#neighbor [Link] update-source lo0
R3(config-router)#neighbor [Link] ebgp-multihop 2
R3(config-router)#neighbor [Link] ebgp-multihop 2
R3(config-router)#neighbor [Link] password CAFECOMREDES
R3(config-router)#neighbor [Link] password CAFECOMREDES
R3(config-router)#neighbor [Link] password CAFECOMREDES
R3(config-router)#neighbor [Link] timers 30 90
R3(config-router)#neighbor [Link] timers 30 90
R3(config-router)#neighbor [Link] timers 30 90
R4(config)#router eigrp 100
R4(config-router)#network [Link]
R4(config-router)#network [Link]
R4(config)#router bgp 100
R4(config-router)#neighbor [Link] remote-as 100
R4(config-router)#neighbor [Link] update-source lo
R4(config-router)#neighbor [Link] update-source lo0
R4(config-router)#neighbor [Link] password CAFECOMREDES
R4(config-router)#neighbor [Link] timers 30 90
R5(config)#router eigrp 100
R5(config-router)#network [Link]
R5(config-router)#network [Link]
R5(config)#router bgp 100
R5(config-router)#neighbor [Link] remote-as 100
R5(config-router)#neighbor [Link] update-source lo0
R5(config-router)#neighbor [Link] password 7 0225257D2E25200C7E6B2D3C36
R5(config-router)#neighbor [Link] timers 30 90
R6(config)#router eigrp 100
R6(config-router)#network [Link]
R6(config-router)#network [Link]
R6(config-router)#network [Link]
R6(config)#router bgp 100
R6(config-router)#neighbor [Link] remote-as 100
R6(config-router)#neighbor [Link] update-source lo0
R6(config-router)#neighbor [Link] remote-as 200
R6(config-router)#neighbor [Link] update-source lo0
R6(config-router)#neighbor [Link] ebgp-multihop 2
R6(config-router)#neighbor [Link] password 7 0225257D2E25200C7E6B2D3C36
R6(config-router)#neighbor [Link] timers 30 90
R7(config)#router eigrp 100
R7(config-router)#network [Link]
R7(config-router)#network [Link]
R7(config-router)#network [Link]
R7(config)#router bgp 200
R7(config-router)# neighbor [Link] remote-as 100
R7(config-router)# neighbor [Link] update-source lo0
R7(config-router)# neighbor [Link] ebgp-multihop 2
R7(config-router)#neighbor [Link] remote-as 200
R7(config-router)#neighbor [Link] update-source lo0
R8(config)#router eigrp 100
R8(config-router)#network [Link]
R8(config-router)#network [Link]
R8(config)#router bgp 200
R8(config-router)#neighbor [Link] remote-as 200
R8(config-router)#neighbor [Link] update-source lo0
WAN Lab 15 HDLC e PPP
(configuração inicial em HDLC e PPP)
Objetivo Proposto
-Configure a interface serial do roteador R7 como DTE e o roteador R6 como DCE com o valor
de 64000 de clockrate e bandwith de 512.
- Configure os IPs [Link]/30 e [Link]/30 nos roteadores R7 e R6 respectivamente.
- Configure a comunicação entre os roteadores R6 e R7 com o protocolo de encapsulamento
padrão Cisco e teste a conectividade entre os roteadores;
- Configure a comunicação entre os roteadores R6 e R7 com o protocolo de encapsulamento
padrão aberto e teste a conectividade entre os roteadores;
- Configure a autenticação entre os roteadores primeiramente com CHAP e depois altere para
PAP.
- Configure para que o roteador R7 utilize o roteador R6 como rota default via PPP (utilizando 1
comando na interface para isso).
Passo a Passo
Interfaces seriais são muito utilizadas nos roteadores no dia a dia das operadoras e é muito
comum você se deparar com termos utilizados nessas configurações como CHAP, PAP etc.
Segue exemplo dos frames HDLC, HDLC Cisco e PPP:
O protocolo HDLC (High-Level Data Link Controller) é o protocolo padrão utilizado em
interfaces seriais nos equipamentos Cisco e por ser um protocolo bem simples, ele apenas
mantém os keepalives (SLARP – Serial Line Data Encapsulation Protocol) das interfaces seriais,
não possui autenticação.
O protocolo PPP é amplamente utilizado por todos os vendors e é base da comunicação de
diversos provedores de internet, utiliza LCP – Link Control Protocol e além de ser padrão
aberto, possui autenticação via CHAP (Challenge Handshake Authentication Protocol), MS-
CHAP (Microsoft Challenge Handshake Authentication Protocol) e também o PAP (Password
Authentication Protocol), além de ser base para o protocolo PPPoE que também é um dos
protocolos mais utilizados atualmente.
O primeiro passo do Lab é a configuração do clockrate, dos IPS e do bandwith dos
equipamentos:
R7(config)# interface Serial1/0
R7(config-if)# bandwidth 512
R7(config-if)# ip address [Link] [Link]
R7(config-if)# serial restart-delay 0
R7(config-if)# clock rate 64000
R7(config-if)#no shutdown
R6(config)# interface Serial1/0
R6(config-if)# bandwidth 512
R6(config-if)# ip address [Link] [Link]
R6(config-if)# serial restart-delay 0
R6(config-if)#no shutdown
Podemos perceber que o encapsulamento padrão dos equipamentos Cisco são HDLC conforme
o output abaixo:
R7#sh interfaces serial 1/0
Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is [Link]/30
MTU 1500 bytes, BW 512 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
Last input 00:00:06, output 00:00:03, output hang never
Last clearing of "show interface" counters 1d08h
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
12769 packets input, 943818 bytes, 0 no buffer
Received 12769 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
12772 packets output, 908582 bytes, 0 underruns
0 output errors, 0 collisions, 3 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
3 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
R7# ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/12 ms
Para forçar a comunicação via HDLC na interface, utilize o comando abaixo:
R7(config-if)#encapsulation hdlc
O próximo passo é a configuração via PPP nas interfaces dos roteadores, a princípio é uma
configuração bem simples:
R7(config)#interface serial 1/0
R7(config-if)#encapsulation ppp
R6(config)#interface serial 1/0
R6(config-if)#encapsulation ppp
R7#sh interfaces serial 1/0
Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is [Link]/30
MTU 1500 bytes, BW 512 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Open: IPCP, CDPCP, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters 00:01:09
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
21 packets input, 1309 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
26 packets output, 1030 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
3 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
Agora vamos configurar o usuário e senha utilizado na negociação entre os roteadores,
observe que você deve criar o username baseado no hostname do outro roteador:
R7(config)# username R6 password 0 cafecomredes
R6(config)# username R7 password 0 cafecomredes
R7(config)#interface serial 1/0
R7(config-if)#ppp authentication chap
R7(config-if)#ppp chap hostname R7
R7(config-if)#ppp chap password 0 cafecomredes
R6(config)#interface serial 1/0
R6(config-if)#ppp authentication chap
R6(config-if)#ppp chap hostname R6
R6(config-if)#ppp chap password 0 cafecomredes
Para verificação utilize o comando:
R7#sh ppp all
Interface/ID OPEN+ Nego* Fail- Stage Peer Address Peer Name
------------ --------------------- -------- --------------- --------------------
Se1/0 LCP+ CHAP+ IPCP+ CDP> LocalT [Link] R6
Para testarmos a autenticação, vamos alterar o username do R7 e habilitar o debug ppp
authentication nele e analisar os resultados:
R7(config)#no username R6 password 0 cafecomredes
This operation will remove all username related configurations with same [Link] you want to continue? [confirm]
R7(config)# username R3 password 0 cafecomredes
R7#debug ppp authentication
PPP authentication debugging is on
*Dec 22 20:56:20.004: Se1/0 PPP: Using default call direction
*Dec 22 20:56:20.004: Se1/0 PPP: Treating connection as a dedicated line
*Dec 22 20:56:20.004: Se1/0 PPP: Session handle[3D00009C] Session id[155]
*Dec 22 20:56:20.058: Se1/0 CHAP: O CHALLENGE id 1 len 23 from "R7"
*Dec 22 20:56:20.063: Se1/0 CHAP: I CHALLENGE id 1 len 23 from "R6"
*Dec 22 20:56:20.081: Se1/0 PPP: Sent CHAP SENDAUTH Request
*Dec 22 20:56:20.081: Se1/0 CHAP: I RESPONSE id 1 len 23 from "R6"
*Dec 22 20:56:20.082: Se1/0 PPP: Received SENDAUTH Response FAIL
*Dec 22 20:56:20.082: Se1/0 CHAP: Unable to authenticate for peer
*Dec 22 20:56:20.086: Se1/0 PPP: Sending AAA radius abort
*Dec 22 20:56:20.086: Se1/0 PPP: Sent CHAP LOGIN Request
*Dec 22 20:56:20.086: Se1/0 PPP: Received LOGIN Response FAIL
*Dec 22 20:56:20.086: Se1/0 CHAP: O FAILURE id 1 len 25 msg is "Authentication failed"
Agora volte a configuração de username do R7 para o correto (R6) e configure a autenticação
como PPP PAP:
R7(config)# username R6 password 0 cafecomredes
R7(config)#interface serial 1/0
R7(config-if)#ppp authentication pap
R7(config-if)#ppp pap sent-username R7 password cafecomredes
R7(config-if)#shut
R7(config-if)#no shut
R6(config)#interface serial 1/0
R6(config-if)#ppp authentication pap
R6(config-if)#ppp pap sent-username R6 password cafecomredes
R6(config-if)#shut
R6(config-if)#no shut
Verficação:
R7#sh ppp all
Interface/ID OPEN+ Nego* Fail- Stage Peer Address Peer Name
------------ --------------------- -------- --------------- --------------------
Se1/0 LCP+ PAP+ IPCP+ CDPC> LocalT [Link] R6
Por último uma configuração bastante utilizada no dia-a-dia é a propagação da rota default via
PPP que é realizada com o seguinte comando:
R7(config)#interface serial 1/0
R7(config-if)#ppp ipcp route default
R7#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is [Link] to network [Link]
S* [Link]/0 [1/0] via [Link]
[Link]/24 is variably subnetted, 3 subnets, 2 masks
C [Link]/30 is directly connected, Serial1/0
L [Link]/32 is directly connected, Serial1/0
C [Link]/32 is directly connected, Serial1/0
Configuração
R7(config)# interface Serial1/0
R7(config-if)# bandwidth 512
R7(config-if)# ip address [Link] [Link]
R7(config-if)# serial restart-delay 0
R7(config-if)# clock rate 64000
R7(config-if)#encapsulation ppp
R7(config)# username R6 password 0 cafecomredes
R6(config)# interface Serial1/0
R6(config-if)# bandwidth 512
R6(config-if)# ip address [Link] [Link]
R6(config-if)# serial restart-delay 0
R6(config-if)#encapsulation ppp
R6(config)# username R7 password 0 cafecomredes
CHAP:
R7(config)#interface serial 1/0
R7(config-if)#ppp authentication chap
R7(config-if)#ppp chap hostname R7
R7(config-if)#ppp chap password 0 cafecomredes
R6(config)#interface serial 1/0
R6(config-if)#ppp authentication chap
R6(config-if)#ppp chap hostname R6
R6(config-if)#ppp chap password 0 cafecomredes
PAP:
R7(config)#interface serial 1/0
R7(config-if)#ppp authentication pap
R7(config-if)#ppp pap sent-username R7 password cafecomredes
R6(config)#interface serial 1/0
R6(config-if)#ppp authentication pap
R6(config-if)#ppp pap sent-username R6 password cafecomredes
Rota default:
R7(config)#interface serial 1/0
R7(config)#ppp ipcp route default
WAN LAB 16 – MPLS
(configuração inicial em MPLS)
Objetivo Proposto
- Configure os roteadores do AS 100 e do AS200 com o protocolo de roteamento OSPF (IGP);
- Habilite o protocolo LDP automaticamente no AS100 e manualmente no AS200;
- Utilize a senha REDES nas configurações de LDP no AS 200;
- Garanta que o router-id selecionado nos roteadores seja o IP das interfaces loopback 0 dos
mesmos;
- Verifique a comunicação entre os roteadores R3 e R8 e quais labels estão sendo utilizados no
transporte.
Passo a Passo
MPLS ou Multi Protocol Label Switching é um protocolo de comutação de pacotes via label
(rótulo) criado para viabilizar/melhorar as redes ATMs que na época demandavam muito dos
roteadores no processo de montagem e remontagem dos pacotes, na verdade o MPLS se
utiliza do rótulo (4bytes) para identificar uma FEC-Fowarding Equivalent Class (grupo de
pacotes IPs enviados com o mesmo padrão, destino ou priorização) algo semelhante ao que o
Frame-relay faz com os DLCIs, pensando assim, com a utilização do MPLS o roteador/switch
não precisa mais ler o cabeçalho IP inteiro para encaminhar o pacote, basta ler o label e
encaminhar para o label destino (utiliza algumas tabelas para encaminhar o pacote como a LIB-
Label Information Base, FIB-Forwarding Information Base e a LFIB-Label Forwarding
Information Base) tornando a comunicação muito mais rápida e utilizando menos recursos.
Para um bom funcionamento de uma rede MPLS, são necessários alguns itens:
- O MPLS requer o uso de protocolos de control plane (Label Distribution Protocol – LDP, ou
mesmo OSPF), para o aprendizado dos labels e correlação para um determinado prefixo
(criação das tabelas de encaminhamento);
- Para encaminhar pacotes, o MPLS utiliza a CEF FIB (encaminha pacotes sem label) e a MPLS
LFIB (encaminha pacotes com label);
- A troca de labels utiliza alguns processos como o de push (inclui um label no pacote) e o de
pop (remove);
- Label Switch Router (LSR) – Qualquer rorteador que adiciona/remove labels nos pacotes ou
encaminha pacotes com labels;
- Edge LSR (E-LSR) – roteador borda da rede MPLS (processa pacotes com ou sem label);
- Ingress E-LSR –Roteador que recebe o pacote sem label e adiciona o label nele;
- Egress E-LSR – Recebe um pacote com label e retira o mesmo para encaminha o pacote;
- ATM – LSR – Roteadores com circuitos ATM;
- ATM E-LSR – igual o Edge LSR porém para ATM;
Obs. Os labels são distribuídos automaticamente por padrão, porém podem ser configurados
manualmente.
LDP – cria uma entrada (label) para cada prefixo na tabela de roteamento, então os LSRs
enviam mensagens trocando essas informações, utilizada as portas 646 (LDP) e 711 (TDP) além
de UDP (para Hellos no endereço multicast [Link]) e TCP (para Updates) nessa
comunicação, a comunicação é inciada pelo roteador com o maior ID LDP (ID escolhido pelo
maior IP configurado em uma interface Loopback up/up, ou pelo maior IP configurado em uma
interface normal se não houver loopback).
As configurações do lab de MPLS LDP são bem diretas, sendo mais simples utilizar o comando
autoconfig no IGP selecionado, ou configurar manualmente a interface que irá participar do
LDP, além disso estamos forçando a utilização da interface loopback 0 como router-id do LDP:
R3(config)#ip cef
R3(config)#mpls ip
R3(config)#mpls ldp router-id loopback 0
R3(config)# R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#mpls ldp autoconfig
R4(config)#ip cef
R4(config)#mpls ip
R4(config)#mpls ldp router-id loopback 0
R4(config)# R3(config)#router ospf 1
R4(config-router)#network [Link] [Link] area 0
R4(config-router)# mpls ldp autoconfig
R5(config)#ip cef
R5(config)#mpls ip
R5(config)#mpls ldp router-id loopback 0
R5(config)# R3(config)#router ospf 1
R5(config-router)#network [Link] [Link] area 0
R5(config-router)# mpls ldp autoconfig
R6(config)#ip cef
R6(config)#mpls ip
R6(config)#mpls ldp router-id loopback 0
R6(config)# R3(config)#router ospf 1
R6(config-router)#network [Link] [Link] area 0
R6(config-router)# mpls ldp autoconfig
R6(config)# mpls ldp neighbor [Link] password REDES
R6(config)#interface serial 1/0
R6(config-if)#mpls ip
Após a configuração você irá perceber que as adjacências irão subir automaticamente:
*Feb 6 16:20:34.535: %LDP-5-NBRCHG: LDP Neighbor [Link]:0 (1) is UP
Verifique as adjacências do R3 confme abaixo:
R3#sh mpls ldp neighbor
Peer LDP Ident: [Link]:0; Local LDP Ident [Link]:0
TCP connection: [Link].26393 - [Link].646
State: Oper; Msgs sent/rcvd: 81/82; Downstream
Up time: 00:59:12
LDP discovery sources:
Ethernet0/1, Src IP addr: [Link]
Addresses bound to peer LDP Ident:
[Link] [Link] [Link]
Peer LDP Ident: [Link]:0; Local LDP Ident [Link]:0
TCP connection: [Link].41596 - [Link].646
State: Oper; Msgs sent/rcvd: 40/40; Downstream
Up time: 00:22:52
LDP discovery sources:
Ethernet0/2, Src IP addr: [Link]
Addresses bound to peer LDP Ident:
[Link] [Link] [Link]
Já as configurações no AS200 são um pouco mais complexas, sendo necessário habilitar o LDP
diretamente na interface, além de configurar a password solicitada no lab:
R7(config)#ip cef
R7(config)#mpls ip
R7(config)#mpls ldp router-id loopback 0
R7(config)#interface serial 1/0
R7(config-if)#mpls ip
R7(config)# R3(config)#router ospf 1
R7(config-router)#network [Link] [Link] area 0
R7(config-if)interface ethernet 0/0
R7(config-if) mpls ip
R7(config)mpls ldp password required
R7(config)mpls ldp neighbor [Link] password REDES
R7(config)#mpls ldp neighbor [Link] password REDES
R8(config)#ip cef
R8(config)#mpls ip
R8(config)#mpls ldp router-id loopback 0
R8(config)#router ospf 1
R8(config-router)#network [Link] [Link] area 0
R8(config-if)interface ethernet 0/0
R8(config-if) mpls ip
R8(config)mpls ldp password required
R8(config)mpls ldp neighbor [Link] password REDES
Agora realize um traceroute do R3 para a interface loopback do R8:
R3#traceroute [Link] source lo0
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] [MPLS: Label 20 Exp 0] 11 msec
[Link] [MPLS: Label 20 Exp 0] 13 msec
[Link] [MPLS: Label 20 Exp 0] 11 msec
2 [Link] [MPLS: Label 20 Exp 0] 12 msec
[Link] [MPLS: Label 20 Exp 0] 12 msec
[Link] [MPLS: Label 20 Exp 0] 11 msec
3 [Link] [MPLS: Label 20 Exp 0] 24 msec 10 msec 10 msec
4 [Link] 10 msec 11 msec *
Verifique também a tabela de encaminhamento:
R3#sh mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label [Link]/32 0 Et0/1 [Link]
17 Pop Label [Link]/32 0 Et0/2 [Link]
18 18 [Link]/32 0 Et0/1 [Link]
18 [Link]/32 0 Et0/2 [Link]
19 19 [Link]/32 0 Et0/1 [Link]
19 [Link]/32 0 Et0/2 [Link]
20 20 [Link]/32 0 Et0/1 [Link]
20 [Link]/32 0 Et0/2 [Link]
21 21 [Link]/24 0 Et0/1 [Link]
21 [Link]/24 0 Et0/2 [Link]
22 Pop Label [Link]/30 0 Et0/1 [Link]
23 Pop Label [Link]/30 \
0 Et0/2 [Link]
24 24 [Link]/30 0 Et0/1 [Link]
24 [Link]/30 0 Et0/2 [Link]
Configuração
R3(config)#ip cef
R3(config)#mpls ip
R3(config)#mpls ldp router-id loopback 0
R3(config)# R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#mpls ldp autoconfig
R4(config)#ip cef
R4(config)#mpls ip
R4(config)#mpls ldp router-id loopback 0
R4(config)# R3(config)#router ospf 1
R4(config-router)#network [Link] [Link] area 0
R4(config-router)# mpls ldp autoconfig
R5(config)#ip cef
R5(config)#mpls ip
R5(config)#mpls ldp router-id loopback 0
R5(config)# R3(config)#router ospf 1
R5(config-router)#network [Link] [Link] area 0
R5(config-router)# mpls ldp autoconfig
R6(config)#ip cef
R6(config)#mpls ip
R6(config)#mpls ldp router-id loopback 0
R6(config)# R3(config)#router ospf 1
R6(config-router)#network [Link] [Link] area 0
R6(config-router)# mpls ldp autoconfig
R6(config)# mpls ldp neighbor [Link] password REDES
R6(config)#interface serial 1/0
R6(config-if)#mpls ip
R7(config)#ip cef
R7(config)#mpls ip
R7(config)#mpls ldp router-id loopback 0
R7(config)#interface serial 1/0
R7(config-if)#mpls ip
R7(config)# R3(config)#router ospf 1
R7(config-router)#network [Link] [Link] area 0
R7(config-if)interface ethernet 0/0
R7(config-if) mpls ip
R7(config)mpls ldp password required
R7(config)mpls ldp neighbor [Link] password REDES
R7(config)#mpls ldp neighbor [Link] password REDES
R8(config)#ip cef
R8(config)#mpls ip
R8(config)#mpls ldp router-id loopback 0
R8(config)#router ospf 1
R8(config-router)#network [Link] [Link] area 0
R8(config-if)interface ethernet 0/0
R8(config-if) mpls ip
R8(config)mpls ldp password required
R8(config)mpls ldp neighbor [Link] password REDES
WAN LAB 17 – Tunel GRE
(Configuração inicial em GRE)
Objetivo Proposto
- Crie um túnel GRE entre os roteadores R4 e R8 e garanta que o tráfego não seja capturado
pelos roteadores R6 e R7;
- Utilize a rede [Link]/30 como IP na configuração do túnel;
- Reduza o overhead dos roteadores ajustando o tamanho dos pacotes dentro do túnel;
- Teste a conectividade do roteador R4 para a interface Loopback 1 do roteador R8 via túnel.
Passo a Passo
Tunel GRE é um método de transporte do tráfgo entre dois pontos utilizando a técnica de
tunelamento para dimunuir os seguintes problemas encontrados nas redes:
- A rede não suporta o protocolo utilizado;
- Segurança em redes públicas;
- A rede não suporta o tipo do tráfego ([Link]);
Também é o método de transposte básico para grande parte das VPNs existentes hoje.
Trabalha criando uma rede virtual (overlay network) por “cima” da infraestrutura física
(underlay network) entre dois pontos, utiliza alguns protocolos para encapsular/desencapsular
o tráfego (L2TP, IP-in-IP, GRE etc), escondendo assim o tráfego incial dentro da estrutura física.
Exemplo:
O primeiro passo é a criação do túnel nos roteadores R4 e R8 conforme abaixo:
R4(config)#interface tunnel 0
*Feb 23 16:50:54.222: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to down
R4(config-if)#tunnel source loopback 0
R4(config-if)#ip address [Link] [Link]
R4(config-if)#tunnel destination [Link]
*Feb 23 16:59:09.007: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up
R8(config)#interface tunnel 0
*Feb 23 16:53:24.740: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to down
R8(config-if)#tunnel source loopback 0
R8(config-if)#tunnel destination [Link]
*Feb 23 17:01:22.174: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up
R8(config-if)#ip address [Link] [Link]
*Feb 23 17:02:01.268: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Tunnel0 from LOADING to FULL, Loading Done
A configuração é bem simples, bastando apenas apontar a interface de source e o ip de
destination, além do IP que servirá como overlay network, teste a comunicação:
R4#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/50/144 ms
E verifiquei também o status da interface tunnel 0:
R4#sh interfaces tunnel 0
Tunnel0 is up, line protocol is up
Hardware is Tunnel
Internet address is [Link]/30
MTU 17916 bytes, BW 100 Kbit/sec, DLY 50000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation TUNNEL, loopback not set
Keepalive not set
Tunnel linestate evaluation up
Tunnel source [Link] (Loopback0), destination [Link]
Tunnel Subblocks:
src-track:
Tunnel0 source tracking subblock associated with Loopback0
Set of tunnels with source Loopback0, 1 member (includes iterators), o
n interface <OK>
Tunnel protocol/transport GRE/IP
Key disabled, sequencing disabled
Checksumming of packets disabled
Tunnel TTL 255, Fast tunneling enabled
Tunnel transport MTU 1476 bytes
Tunnel transmit bandwidth 8000 (kbps)
Tunnel receive bandwidth 8000 (kbps)
Last input 00:00:38, output 00:01:55, output hang never
Last clearing of "show interface" counters 00:26:28
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/0 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
119 packets input, 12907 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
133 packets output, 13963 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
Com essa configuração habilitada, automaticamente o OSPF irá ser habilitado e a adjacência
entre o R4 e R8 será formada:
R4#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:30 [Link] Tunnel0
[Link] 1 FULL/DR 00:00:35 [Link] Ethernet0/1
Para desabilitar esse comportamento, transforme a interface Tunel 0 em modo passivo no
OSPF:
R4(config)#router ospf 1
R4(config-router)#passive-interface tunnel 0
*Feb 23 17:15:27.725: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Tunnel0 from FULL to DOWN, Neighbor Down:
Interface down or detached
R8(config)#router ospf 1
R8(config-router)#passive-interface tunnel 0
Para que os roteadores não fiquem sobrecarregados na fragmentação de pacotes normais
(MTU de 1500) e não ter problemas com alguns protocolos senvsiveis, utilize os comandos
abaixo:
R4(config)#interface tunnel 0
R4(config-if)#ip mtu 1400
R4(config-if)#ip tcp adjust-mss 1360
R8(config)#interface tunnel 0
R8(config-if)#ip mtu 1400
R8(config-if)#ip tcp adjust-mss 1360
Para testar o caminho utilizado, realize o traceroute para o ip da interface loopback 1 do
roteador R1:
R4# traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 * * *
2 * * *
3 *
R4#sh ip route [Link]
% Network not in table
R4#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
[Link]/32 is subnetted, 1 subnets
O [Link] [110/11] via [Link], 00:52:28, Ethernet0/1
[Link]/32 is subnetted, 1 subnets
O [Link] [110/75] via [Link], 00:52:28, Ethernet0/1
[Link]/32 is subnetted, 1 subnets
O [Link] [110/85] via [Link], 00:37:25, Ethernet0/1
[Link]/8 is variably subnetted, 2 subnets, 2 masks
C [Link]/30 is directly connected, Tunnel0
L [Link]/32 is directly connected, Tunnel0
[Link]/24 is subnetted, 1 subnets
O [Link] [110/84] via [Link], 00:52:28, Ethernet0/1
[Link]/24 is variably subnetted, 4 subnets, 2 masks
C [Link]/30 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
C [Link]/30 is directly connected, Ethernet0/1
L [Link]/32 is directly connected, Ethernet0/1
[Link]/30 is subnetted, 1 subnets
O [Link] [110/74] via [Link], 00:52:28, Ethernet0/1
Como podemos perceber, não há rota para a rede [Link], para resolver esse problema,
podemos criar uma rota especifica para essa rede apontando a interface túnel ou
simplesmente uma rota default para a mesma interface:
R4(config)#ip route [Link] [Link] tunnel 0
R4# traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 15 msec 16 msec *
Configuração
R4(config)#interface tunnel 0
R4(config-if)#tunnel source loopback 0
R4(config-if)#ip address [Link] [Link]
R4(config-if)#tunnel destination [Link]
R4(config-if)#ip mtu 1400
R4(config-if)#ip tcp adjust-mss 1360
R4(config)#router ospf 1
R4(config-router)#passive-interface tunnel 0
R4(config)#ip route [Link] [Link] tunnel 0
R8(config)#interface tunnel 0
R8(config-if)#tunnel source loopback 0
R8(config-if)#tunnel destination [Link]
R8(config-if)#ip address [Link] [Link]
R8(config-if)#ip mtu 1400
R8(config-if)#ip tcp adjust-mss 1360
R8(config)#router ospf 1
R8(config-router)#passive-interface tunnel 0
R8(config)#ip route [Link] [Link] tunnel 0
Infraestructure Services Lab 18 – DHCP
(configuração inicial em DHCP)
Objetivo Proposto
- Configure o roteador R7 como DHCP server ;
- Configure a rede [Link]/24 como rede base para o DHCP;
- Configure para que o lease fique valido por 8 dias, 4 horas e 2 minutos;
- Configure o gateway padrão como [Link];
- Configure o domínio [Link];
- Configure o servidor de DNS como [Link];
- Crie uma exclusão para que o range IP [Link] – [Link] não seja atribuído;
- Para efeito de teste, configure para que somente o MAC da interface Ethernet 0/0 receba o
lease do DHCP;
Passo a Passo
Uma das features cobradas nos exames Cisco é a possibilidade de configurar o DHCP Server
diretamente nos roteadores, firewalls e alguns switches, permitindo as mesmas funções de um
servidor DHCP do Windows ou Linux.
É uma configuração bem simples e direta
R7(config)#ip dhcp pool AS200
R7(dhcp-config)#lease 8 4 2
R7(dhcp-config)#default-router [Link]
R7(dhcp-config)#domain-name [Link]
R7(dhcp-config)#dns-server [Link]
R7(dhcp-config)# network [Link] [Link]
Para criar exclusões no escopo DHCP utilize:
R7(config)#ip dhcp excluded-address [Link] [Link]
Com esses comandos, o roteador R8 deverá conseguir um IP dentro dessa rede conforme o log
abaixo:
R8#
*Jan 8 20:15:00.604: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/0 assigned DHCP address [Link], mask
[Link], hostname R8
R8#sh interfaces ethernet 0/0
Ethernet0/0 is up, line protocol is up
Hardware is AmdP2, address is aabb.cc00.c008 (bia aabb.cc00.c000)
Internet address is [Link]/24
MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:26, output 00:00:02, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
311 packets input, 98188 bytes, 0 no buffer
Received 304 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
1440 packets output, 166566 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets
21 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
R8#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Para completar a última task, retire a configuração de network do DHCP server e configure
para que apenas o MAC da interface do roteador R8 consiga o lease do DHCP:
R7(config)#ip dhcp pool AS200
R7(dhcp-config)#no network [Link] [Link]
R7(dhcp-config)#client-identifier [Link].00c0.08
R7(dhcp-config)#host [Link] /24
R8(config)#interface ethernet 0/0
R8(config-if)#shutdown
R8(config-if)#no shutdown
Verifique que mesmo após realizar essa configuração, a interface não irá conseguir o lease do
DHCP:
R8#sh interfaces ethernet 0/0
Ethernet0/0 is up, line protocol is up
Hardware is AmdP2, address is aabb.cc00.c008 (bia aabb.cc00.c000)
Internet address will be negotiated using DHCP
MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:27, output 00:00:05, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
326 packets input, 102147 bytes, 0 no buffer
Received 314 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
1531 packets output, 180797 bytes, 0 underruns
0 output errors, 0 collisions, 3 interface resets
21 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Para completar a última task do lab, primeiro precisamos alterar o cliente-identifier para o tipo
ethernet (01) no roteador R7 para que ele entenda que está recebendo um DHCP Request de
um roteador via ethernet:
R7(config)#ip dhcp pool AS200
R7(dhcp-config)#client-identifier [Link].00c0.08
Obs. Outros equipamentos como impressoras (você pode configurar o cliente-ID), Microsoft
Remote Access Server “RAS” (utiliza cliente ID 01 52 41 53 20), etc.
Mesmo assim você não conseguirá obter o IP corretamente, agora no R8 vamos analisar o
motivo:
R8#debug dhcp detail
*Jan 9 18:22:19.306: DHCP: Try 5 to acquire address for Ethernet0/0
*Jan 9 18:22:19.319: DHCP: allocate request
*Jan 9 18:22:19.319: DHCP: zapping entry in DHC_PURGING state for Et0/0
*Jan 9 18:22:19.319: DHCP: deleting entry F2F6BEE0 [Link] from list
*Jan 9 18:22:19.319: Temp IP addr: [Link] for peer on Interface: Ethernet0/0
*Jan 9 18:22:19.319: Temp sub net mask: [Link]
*Jan 9 18:22:19.319: DHCP Lease server: [Link], state: 11 Purging
*Jan 9 18:22:19.319: DHCP transaction id: 23A
*Jan 9 18:22:19.319: Lease: 0 secs, Renewal: 0 secs, Rebind: 0 secs
*Jan 9 18:22:19.319: Next timer fires after: 00:00:11
*Jan 9 18:22:19.319: Retry count: 0 Client-ID: cisco-aabb.cc00.c008-Et0/0
*Jan 9 18:22:19.319: Client-ID hex dump: 636973636F2D616162622E636330302E
*Jan 9 18:22:19.319: 633030382D4574302F30
*Jan 9 18:22:19.319: Hostname: R8
*Jan 9 18:22:19.319: DHCP: new entry. add to queue, interface Ethernet0/0
*Jan 9 18:22:19.319: DHCP: SDiscover attempt # 1 for entry:
*Jan 9 18:22:19.319: Temp IP addr: [Link] for peer on Interface: Ethernet0/0
*Jan 9 18:22:19.319: Temp sub net mask: [Link]
*Jan 9 18:22:19.319: DHCP Lease server: [Link], state: 3 Selecting
*Jan 9 18:22:19.319: DHCP transaction id: 23B
*Jan 9 18:22:19.319: Lease: 0 secs, Renewal: 0 secs, Rebind: 0 secs
*Jan 9 18:22:19.319: Next timer fires after: 00:00:04
*Jan 9 18:22:19.319: Retry count: 1 Client-ID: cisco-aabb.cc00.c008-Et0/0
*Jan 9 18:22:19.319: Client-ID hex dump: 636973636F2D616162622E636330302E
*Jan 9 18:22:19.320: 633030382D4574302F30
*Jan 9 18:22:19.320: Hostname: R8
*Jan 9 18:22:19.320: DHCP: SDiscover: sending 291 byte length DHCP packet
*Jan 9 18:22:19.320: DHCP: SDiscover 291 bytes
*Jan 9 18:22:19.320: B'cast on Ethernet0/0 interface from [Link]
Perceba que o cliente-ID que está enviando o DHCP Request não é o mesmo que configuramos
no roteador R7, para resolver esse problema adicione o comando abaixo na interface do R8:
R8(config)#interface ethernet 0/0
R8(config-if)#ip address dhcp client-id ethernet 0/0
*Jan 9 18:32:30.510: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/0 assigned DHCP address [Link], mask
[Link], hostname R8
Segue alguns comandos de tshoot no dhcp:
R7#sh ip dhcp server statistics
statistics DHCP server statistics
R7#sh ip dhcp server st
R7#sh ip dhcp server statistics
Memory usage 56934
Address pools 1
Database agents 0
Automatic bindings 0
Manual bindings 0
Expired bindings 0
Malformed messages 0
Secure arp entries 0
Message Received
BOOTREQUEST 0
DHCPDISCOVER 2033
DHCPREQUEST 4
DHCPDECLINE 0
DHCPRELEASE 12
DHCPINFORM 0
Message Sent
BOOTREPLY 0
DHCPOFFER 4
DHCPACK 4
DHCPNAK 0
R7#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
[Link] 0063.6973.636f.2d61. Jan 17 2018 04:58 PM Automatic
6162.622e.6363.3030.
2e63.3030.382d.4574.
302f.30
R7#sh ip dhcp conflict
IP address Detection method Detection time VRF
R7#debug ip dhcp server events
DHCP server event debugging is on.
*Jan 9 11:08:25.761: DHCPD: Sending notification of TERMINATION:
*Jan 9 11:08:25.761: DHCPD: address [Link] mask [Link]
*Jan 9 11:08:25.761: DHCPD: reason flags: RELEASE
*Jan 9 11:08:25.761: DHCPD: htype 1 chaddr aabb.cc00.c008
*Jan 9 11:08:25.761: DHCPD: lease time remaining (secs) = 705001
*Jan 9 11:08:25.761: DHCPD: returned [Link] to address pool AS200.
*Jan 9 11:08:27.208: DHCPD: Seeing if there is an internally specified pool class:
*Jan 9 11:08:27.208: DHCPD: htype 1 chaddr aabb.cc00.c008
*Jan 9 11:08:27.208: DHCPD: remote id 020a0000ac10010100000000
*Jan 9 11:08:27.208: DHCPD: circuit id 00000000
*Jan 9 11:08:29.213: DHCPD: Seeing if there is an internally specified pool class:
*Jan 9 11:08:29.214: DHCPD: htype 1 chaddr aabb.cc00.c008
*Jan 9 11:08:29.214: DHCPD: remote id 020a0000ac10010100000000
*Jan 9 11:08:29.214: DHCPD: circuit id 00000000
R7#debug ip dhcp server packet
DHCP server packet debugging is on.
*Jan 9 11:09:24.241: DHCPD: client's VPN is .
*Jan 9 11:09:24.241: DHCPD: No option 125
*Jan 9 11:09:24.241: DHCPD: DHCPRELEASE message received from client
0063.6973.636f.2d61.6162.622e.6363.3030.2e63.3030.382d.4574.302f.30 ([Link]).
*Jan 9 11:09:24.241: DHCPD: removing ARP entry ([Link] vrf default).
*Jan 9 11:09:25.969: DHCPD: client's VPN is .
*Jan 9 11:09:25.969: DHCPD: No option 125
*Jan 9 11:09:25.969: DHCPD: DHCPRELEASE message received from client
0063.6973.636f.2d61.6162.622e.6363.3030.2e63.3030.382d.4574.302f.30 ([Link]).
*Jan 9 11:09:25.970: DHCPD: Finding a relay for client
0063.6973.636f.2d61.6162.622e.6363.3030.2e63.3030.382d.4574.302f.30 on interface Ethernet0/0.
*Jan 9 11:09:27.970: DHCPD: client's VPN is .
*Jan 9 11:09:27.970: DHCPD: No option 125
*Jan 9 11:09:27.970: DHCPD: DHCPRELEASE message received from client
0063.6973.636f.2d61.6162.622e.6363.3030.2e63.3030.382d.4574.302f.30 ([Link]).
*Jan 9 11:09:27.970: DHCPD: Finding a relay for client
0063.6973.636f.2d61.6162.622e.6363.3030.2e63.3030.382d.4574.302f.30 on interface Ethernet0/0.
Outro comando muito utilizado no dia-a-dia é o comando “ip helper-address” que permite o
apontamento de um servidor DHCP em outra vlan (encaminha os pacotes broadcast DHCP
para o servidor apontado via unicast), geralmente é configurado nas interfaces vlans dos
switches, mas pode ser configurado em routers também:
R8(config)#interface ethernet 0/0
R8(config-if)#ip helper-address [Link]
SW4(config)#interface vlan 100
SW4(config-if)#ip helper-address [Link]
Configuração
R7(config)#ip dhcp pool AS200
R7(dhcp-config)# default-router [Link]
R7(dhcp-config)#network [Link] /24
R7(dhcp-config)# domain-name [Link]
R7(dhcp-config)# dns-server [Link]
R7(dhcp-config)# lease 8 4 2
R8(config)#interface ethernet 0/0
R8(config-if)#ip address dhcp client-id Ethernet0/0
R7(config)#ip dhcp pool AS200
R7(dhcp-config)#no network [Link] /24
R7(dhcp-config)# client-identifier [Link].00c0.08
LAB 19 - Infraestructure Services - NAT
(configuração inicial em NAT)
Objetivo Proposto
- Configure os equipamentos do AS 100 se comuniquem com o AS200 IP da interface serial 1/0
do roteador R6;
- Configure para que a loopback do roteador R3 utilize o IP da loopback do roteador R6 para o
IP da loopback do roteador R8;
- Configure para que o roteador R4 consiga realizar um telnet na porta 777 e se conecte na
loopback do roteador R8 via porta 23;
Passo a passo
Nat – Network Address Translation é o processo onde um equipamento de rede aloca um ip
público para um dispositivo ou um grupo de dispositivos dentro de uma rede privada
permitindo assim economizar a quantidade de IPs públicos que a empresa precisa.
Possuem 3 tipos:
- Nat estático – Realiza a tradução de um endereço interno para 1 endereço público;
- Nat dinâmico – Realiza a tradução de um range de IPs internos para outro range de IPs
públicos;
- Nat de portas (PAT) - Realiza a tradução de um range de IPs internos para outro range de IPs
públicos, porém com a utilização de portas UDP, TCP etc para distinguir essa tradução;
A Cisco define alguns termos para ajudar no entendimento dos IPs de NAT:
- Inside local address – Endereço IP associado a um host dentro da rede interna (inside),
geralmente IP privado;
- Inside global address – IP válido para roteamento na internet na perspectiva da rede local;
- Outside local address – Endereço IP associado a um host de fora da rede (IP privado) e a
como ele é visto localmente na sua rede (rede de destino);
- Outside global address – IP válido para roteamento na internet na perspectiva da rede de
destino;
- Local address – Qualquer endereço interno da rede;
- Global address – Qualquer endereço externo da rede;
O primeiro passo para configurar um NAT nos roteadores Cisco é criar uma acessl list
informando qual será a origem do tráfego que será traduzido:
R6(config)#ip access-list standard AS100
R6(config-std-nacl)#permit [Link] [Link]
Agora crie a configuração de NAT informando a ACL criada acima como source e a interface
serial 1/0 como destino:
R6(config)#ip nat inside source list AS100 interface serial 1/0
*Feb 7 21:36:03.254: %LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up
Configure os NATs inside e outside nas interfaces do roteador R6:
R6(config)#interface ethernet 0/0
R6(config-if)#ip nat inside
R6(config)#interface serial 1/0
R6(config-if)#ip nat outside
Para testar as configurações, realize alguns pings do AS100 para os IPs no AS200 conforme
abaixo:
R3#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms
R3#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/9/11 ms
Agora analise as traduções realizadas no roteador R6:
R6#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp [Link]:0 [Link]:0 [Link]:0 [Link]:0
icmp [Link]:1 [Link]:1 [Link]:1 [Link]:1
icmp [Link]:2 [Link]:2 [Link]:2 [Link]:2
Verifique que ao realizar o ping via interface loopback não há tradução:
R3#ping [Link] source lo0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
Packet sent with a source address of [Link] !!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms
R6#sh ip nat translations
R6#
Verifique também que do roteador R5 você não irá conseguir realizar o NAT pois colocamos
apenas a interface Ethernet 0/0 como NAT inside:
R5#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/11 ms
R6#sh ip nat translations
R6#
Adicione o comando NAT inside na interface ethernet 0/1 e repita o teste:
R6(config)#interface ethernet 0/1
R6(config-if)#ip nat inside
R5#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/11 ms
R6#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp [Link]:1 [Link]:1 [Link]:1 [Link]:1
A configuração de NAT estático é um pouco mais simples, tendo como diferença apenas que
colocamos os IPS diretamente na configuração de NAT conforme abaixo:
R6(config)#ip nat inside source static [Link] [Link]
R3#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/12 ms
R6#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
--- [Link] [Link] --- ---
icmp [Link]:8 [Link]:8 [Link]:8 [Link]:8
R3#ping [Link] source lo0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
Packet sent with a source address of [Link]
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/11 ms
R6#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp [Link]:13 [Link]:13 [Link]:13 [Link]:13
--- [Link] [Link] --- ---
icmp [Link]:12 [Link]:12 [Link]:12 [Link]:12
udp [Link]:49186 [Link]:49186 [Link]:33440 [Link]:33440
Agora para completar a última taks, vamos retirar as configurações realizadas até o momento
e alterar algumas configurações, além de inverter as ordens dos nats inside e outside:
Reconfigure as redes /30 dos roteadores R4 e R6 para um bloco /24 para que a rede
[Link] consiga chegar no IP de alias que iremos criar no roteador R6 conforme abaixo:
R6(config)#interface ethernet 0/1
R6(config-if)#shutdown
R6(config)#interface ethernet 0/0
R6(config-if)#ip address [Link] [Link]
R4(config)#interface ethernet 0/0
R4(config-if)#shutdown
R4(config-if)#interface ether0/1
R4(config-if)#ip address [Link] [Link]
Agora configure o nat source conforme abaixo (protocolo tcp, o destination, porta, IP de alias e
a porta source):
R6(config)#iip nat inside source static tcp [Link] 23 [Link] 777 extendable
Agora inverta as configurações de nat inside e outside das interfaces do R6:
R6(config)#interface ethernet 0/0
R6(config-if)#no ip nat inside
R6(config-if)#ip nat outside
R6(config)#interface serial 1/0
R6(config-if)#no ip nat outside
R6(config-if)#ip nat inside
Agora basta realizar o teste no roteador R4 o acesso via telnet na porta 777 e verifique o nat
no R6:
R4#telnet [Link] 777
Trying [Link], 777 ... Open
User Access Verification
Username: admin
Password:
R8>
R6#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
--- [Link] [Link] --- ---
tcp [Link]:777 [Link]:23 [Link]:26720 [Link]:26720
tcp [Link]:777 [Link]:23 --- ---
R6#sh ip aliases
Address Type IP Address Port
Interface [Link]
Interface [Link]
Interface [Link]
Dynamic [Link]
Interface [Link]
Configuração
R6(config)#interface ethernet 0/1
R6(config-if)#shutdown
R6(config)#interface ethernet 0/0
R6(config-if)#ip address [Link] [Link]
R6(config)#interface ethernet 0/0
R6(config-if)#no ip nat inside
R6(config-if)#ip nat outside
R6(config)#interface serial 1/0
R6(config-if)#no ip nat outside
R6(config-if)#ip nat inside
R4(config)#interface ethernet 0/0
R4(config-if)#shutdown
R4(config-if)#interface ether0/1
R4(config-if)#ip address [Link] [Link]
Infraestructure Services Lab 20 – FHRP (HRSP, VRRP e GLBP)
(configuração inicial em FHRP)
Objetivo Proposto
- Configure os switches SW1 e SW2 com o protocolo HSRP na vlan 100, sendo que o SW1 deve
ser o switch principal;
- Configure a autenticação do HSRP como MD5 com a senha CAFECOMREDES;
- Altere os timers padrão do HSRP para o dobro desse valor;
- Configure os switches SW3 e SW4 com o protocolo VRRP na vlan 200, sendo que o SW3 deve
ser o switch principal;
- Configure a autenticação do VRRP como com a senha CAFECOMR;
- Altere os timers padrão do VRRP para o dobro desse valor;
- Configure os switches SW2 e SW4 com o protocolo GLBP na vlan 300, sendo que o SW2 deve
ser o switch principal;
- Configure o IP virtual dos protocolos com o .5 no último octeto;
- Configure a autenticação do GLBP como MD5 com a senha CAFECOMREDES;
- Altere os timers padrão do GLBP para o dobro desse valor;
- Realize testes de conectividade e colete evidências da queda dos equipamentos principais.
Passo a passo
Os protocolos de FHRP – First Hop Redundancy Protocols foram criados para proteger a rede
de pontos de falha em gateways estáticamente configurados, eles criam um mecanismo em
que o equipamento principal responde como ativo e em caso de falha, o equipamento backup
assume o IP principal tornando quase imperceptível o downtime da sua rede.
HSRP (Hot Standby Router Protocol) – Protocolo criado pela Cisco em 2 versões sendo a
versão 2 a mais utilizada, os 2 devices formam o HSRP group ou standby group, eles trocam
mensagens (hellos) via endereço multicast ([Link]) que são responsáveis pela verificação
de up ou down do IP virtual criado, a eleição do equipamento ativo se da via priority (default
100), é escolhido o equipamento ativo que tiver a maior priority ;
- HSRP States:
- Initial;
- Learn;
- Listen;
- Speak;
- Standby;
- Active;
Por default, os timers do HSRP são 3 segundos de hello e 10 de holdtime;
VRRP (Virtual Router Redundancy Protocol) – Bem similar ao de cima, porém ao invés do
HSRP group o VRRP cria um “virtual router” ou VRRP group, apenas um roteador atua como
virtual router master, o restante fica como virtual router backup, a eleição do VRRP é realizada
via vrrp priority (de 1 a 254, maior melhor), e a troca de mensagens é feita via multicast
[Link];
GLBP (Gateway Load Balancing Protocol) – parecido com os outros 2, porém adiciona a
possibilidade de balanceamento de carga em cima do IP virtual, trabalha com o endereço
multicast [Link] UPD porta 3222 (SRC e DST) e suporta até 1024 grupos GLBP além de
poder trabalhar com até 4 ativos (encaminhadores de trafego por grupo).
O primeiro passo para configurar o HSRP nos switches é configurar os paramêtros do stanby na
interface vlan 100 conforme solicitado:
SW1(config)#interface vlan 100
SW1(config)#standby 1 ip [Link]
SW1(config)# standby 1 priority 110
SW1(config)# standby 1 authentication md5 key-string CAFECOMREDES
SW1(config-if)#standby 1 timers 6 20
SW2(config)#interface vlan 100
SW2(config)#istandby 1 ip [Link]
SW2(config)#i standby 1 priority 105
SW2(config-if)#standby 1 timers 6 20
*Jan 10 13:08:38.656: %HSRP-4-BADAUTH: Bad authentication from [Link], group 1, remote state Active
SW2(config-if)# standby 1 authentication md5 key-string CAFECOMREDES
*Jan 10 13:08:41.232: %HSRP-5-STATECHANGE: Vlan100 Grp 1 state Active -> Speak
*Jan 10 13:08:52.597: %HSRP-5-STATECHANGE: Vlan100 Grp 1 state Speak -> Standby
SW1#sh standby
Vlan100 - Group 1
State is Active
2 state changes, last state change 04:59:03
Virtual IP address is [Link]
Active virtual MAC address is 0000.0c07.ac01 (MAC In Use)
Local virtual MAC address is 0000.0c07.ac01 (v1 default)
Hello time 6 sec, hold time 20 sec
Next hello sent in 4.032 secs
Authentication MD5, key-string
Preemption disabled
Active router is local
Standby router is [Link], priority 105 (expires in 18.560 sec)
Priority 110 (configured 110)
Group name is "hsrp-Vl100-1" (default)
Agora vamos simular uma queda na interface vlan 100 do switch SW1 e verificar se o SW2
assume como ativo:
SW1(config)#interface vlan 100
SW1(config-if)#shutdown
SW1#
*Jan 10 17:41:43.211: %LINK-5-CHANGED: Interface Vlan100, changed state to administratively down
*Jan 10 17:41:44.220: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan100, changed state to down
*Jan 10 17:41:44.221: %HSRP-5-STATECHANGE: Vlan100 Grp 1 state Active -> Init
SW2#
*Jan 10 17:42:00.772: %HSRP-5-STATECHANGE: Vlan100 Grp 1 state Standby -> Active
SW3#ping [Link] repeat 100000
Type escape sequence to abort.
Sending 100000, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!..........!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 99 percent (28125/28136), round-trip min/avg/max = 1/1/37 ms (output resumido)
Uma observação interessante é que com o timer alterado o switch demora o dobro de tempo
para se tornar ativo.
Outra observação é que você pode habilitar o comando “preempt” para que qualquer
equipamento com prioridade maior se torne o ativo da rede.
Para configurar o VRRP:
SW3(config)#interface vlan 200
SW3(config-if)#vrrp 1 ip [Link]
SW3(config-if)#vrrp 1 authentication text CAFECOMREDES
% Maximum authentication string length is 8
SW3(config-if)#vrrp 1 authentication text CAFECOMR
SW3(config-if)#vrrp 1 priority 110
SW3(config-if)#vrrp 1 timers advertise 2
SW4(config)#interface vlan 200
SW4(config-if)#vrrp 1 ip [Link]
*Jan 10 18:15:28.613: %VRRP-6-STATECHANGE: Vl200 Grp 1 state Init -> Backup
*Jan 10 18:15:28.618: %VRRP-6-STATECHANGE: Vl200 Grp 1 state Init -> Backup
*Jan 10 18:15:28.742: %VRRP-4-BADAUTHTYPE: Bad authentication from [Link], group 1, type 1, expected 0
SW4(config-if)#vrrp 1 priority 105
SW4(config-if)#vrrp 1 authentication text CAFECOMR
*Jan 10 18:16:15.415: %VRRP-6-STATECHANGE: Vl200 Grp 1 state Master -> Backup
SW4(config-if)#vrrp 1 timers advertise 2
SW3#sh vrrp
Vlan200 - Group 1
State is Master
Virtual IP address is [Link]
Virtual MAC address is 0000.5e00.0101
Advertisement interval is 2.000 sec
Preemption enabled
Priority is 110
Authentication is enabled
Master Router is [Link] (local), priority is 110
Master Advertisement interval is 2.000 sec
Master Down interval is 3.570 sec
Uma observação interessante é que o VRRP vem com o preempt habilitado por padrão, para
testar, altere a prioridade do switch SW4 para um valor maior que a do SW3:
SW4(config-if)#vrrp 1 priority 120
*Jan 10 18:24:25.113: %VRRP-6-STATECHANGE: Vl200 Grp 1 state Backup -> Master
SW4(config-if)#no vrrp 1 priority 120
Agora para o teste de contingência:
SW3(config)#interface vlan 200
SW3(config-if)#shutdown
SW3#
*Jan 10 18:25:59.854: %VRRP-6-STATECHANGE: Vl200 Grp 1 state Master -> Init
SW4#
*Jan 10 18:26:00.470: %VRRP-6-STATECHANGE: Vl200 Grp 1 state Backup -> Master
SW2#ping [Link] repeat 10000
Type escape sequence to abort.
Sending 10000, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 99 percent (4806/4809), round-trip min/avg/max = 1/1/32 ms (output resumido)
A configuração do GLBP:
SW2(config)#interface vlan 300
SW2(config-if)#glbp 1 ip [Link]
SW2(config-if)#glbp 1 authentication md5 key-string CAFECOMREDES
SW2(config-if)#glbp 1 priority 110
SW2(config-if)#glbp 1 timers 6 20
SW4(config)#interface vlan 300
SW4(config-if)#glbp 1 ip [Link]
SW4(config-if)#glbp 1 authentication md5 key-string CAFECOMREDES
SW4(config-if)#glbp 1 priority 105
SW4(config-if)#glbp 1 timers 6 20
*Jan 10 19:23:14.484: %GLBP-6-FWDSTATECHANGE: Vlan300 Grp 1 Fwd 1 state Active -> Listen
SW2#sh glbp
Vlan300 - Group 1
State is Active
4 state changes, last state change 00:00:53
Virtual IP address is [Link]
Hello time 6 sec, hold time 20 sec
Next hello sent in 1.856 secs
Redirect time 600 sec, forwarder timeout 14400 sec
Authentication MD5, key-string
Preemption disabled
Active is local
Standby is unknown
Priority 100 (default)
Weighting 100 (default 100), thresholds: lower 1, upper 100
Load balancing: round-robin
Group members:
aabb.cc80.2000 ([Link]) local
aabb.cc80.4000 ([Link]) authenticated
There are 2 forwarders (2 active)
Forwarder 1
State is Active
3 state changes, last state change 00:04:10
MAC address is 0007.b400.0101 (default)
Owner ID is aabb.cc80.2000
Redirection enabled
Preemption enabled, min delay 30 sec
Active is local, weighting 100
Forwarder 2
State is Active
1 state change, last state change 00:00:52
MAC address is 0007.b400.0102 (learnt)
Owner ID is aabb.cc80.4000
Redirection enabled, 595.904 sec remaining (maximum 600 sec)
Time to live: 14395.904 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is local, weighting 100
Para o teste de contingência:
SW2(config)#interface vlan 300
SW2(config-if)#shutdown
*Jan 10 19:31:07.249: %GLBP-6-FWDSTATECHANGE: Vlan300 Grp 1 Fwd 1 state Active -> Init
*Jan 10 19:31:07.249: %GLBP-6-STATECHANGE: Vlan300 Grp 1 state Active -> Init
*Jan 10 19:31:09.265: %LINK-5-CHANGED: Interface Vlan300, changed state to administratively down
SW4#
*Jan 10 19:31:24.504: %GLBP-6-FWDSTATECHANGE: Vlan300 Grp 1 Fwd 1 state Listen -> Active
*Jan 10 19:31:26.319: %GLBP-6-STATECHANGE: Vlan300 Grp 1 state Standby -> Active
SW3#ping [Link] repeat 10000
Type escape sequence to abort.
Sending 10000, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!.
Success rate is 99 percent (7842/7844), round-trip min/avg/max = 1/1/60 ms
SW3#
SW4#sh glbp
Vlan300 - Group 1
State is Active
4 state changes, last state change 00:02:09
Virtual IP address is [Link]
Hello time 6 sec, hold time 20 sec
Next hello sent in 0.608 secs
Redirect time 600 sec, forwarder timeout 14400 sec
Authentication MD5, key-string
Preemption disabled
Active is local
Standby is unknown
Priority 105 (configured)
Weighting 100 (default 100), thresholds: lower 1, upper 100
Load balancing: round-robin
Group members:
aabb.cc80.4000 ([Link]) local
There are 2 forwarders (2 active)
Forwarder 1
State is Active
5 state changes, last state change 00:02:11
MAC address is 0007.b400.0101 (learnt)
Owner ID is aabb.cc80.2000
Redirection enabled, 449.504 sec remaining (maximum 600 sec)
Time to live: 14249.504 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is local, weighting 100
Forwarder 2
State is Active
3 state changes, last state change 00:05:53
MAC address is 0007.b400.0102 (default)
Owner ID is aabb.cc80.4000
Redirection enabled
Preemption enabled, min delay 30 sec
Active is local, weighting 100
Obs. Assim como o HSRP o preempt é desabilitado por default.
Configuração
SW1(config)#interface vlan 100
SW1(config)#standby 1 ip [Link]
SW1(config)# standby 1 priority 110
SW1(config)# standby 1 authentication md5 key-string CAFECOMREDES
SW1(config-if)#standby 1 timers 6 20
SW2(config)#interface vlan 100
SW2(config)#istandby 1 ip [Link]
SW2(config)#i standby 1 priority 105
SW2(config-if)#standby 1 timers 6 20
SW2(config-if)# standby 1 authentication md5 key-string CAFECOMREDES
SW2(config)#interface vlan 300
SW2(config-if)#glbp 1 ip [Link]
SW2(config-if)#glbp 1 authentication md5 key-string CAFECOMREDES
SW2(config-if)#glbp 1 priority 110
SW2(config-if)#glbp 1 timers 6 20
SW3(config)#interface vlan 200
SW3(config-if)#vrrp 1 ip [Link]
SW3(config-if)#vrrp 1 authentication text CAFECOMREDES
SW3(config-if)#vrrp 1 authentication text CAFECOMR
SW3(config-if)#vrrp 1 priority 110
SW3(config-if)#vrrp 1 timers advertise 2
SW4(config)#interface vlan 200
SW4(config-if)#vrrp 1 ip [Link]
SW4(config-if)#vrrp 1 priority 105
SW4(config-if)#vrrp 1 authentication text CAFECOMR
SW4(config-if)#vrrp 1 timers advertise 2
SW4(config)#interface vlan 300
SW4(config-if)#glbp 1 ip [Link]
SW4(config-if)#glbp 1 authentication md5 key-string CAFECOMREDES
SW4(config-if)#glbp 1 priority 105
SW4(config-if)#glbp 1 timers 6 20
Security Lab 21 – ACL
(configuração inicial em ACL)
Objetivo Proposto
- Configure para que apenas a interface loopback do roteador R5 consiga acessar a interface
eth0/0 do roteador R7;
- Configure para que o apenas o roteador R4 consiga acesso HTTP no roteador R7;
- Garanta que o acesso via telnet no roteador R7 seja realizado apenas pelo roteador R6.
Passo a passo
As listas de acesso ou ACL são utilizadas para controle e gerenciamento do tráfego que é
utilizado dentro da rede, possúi diversas funções e muita variedade na utilização (ex. permitir
acesso à um servidor, uma aplicação, controlar o acesso durante um período ou mesmo
proteger a control plane de ataques DDoS), segue alguns pontos sobre as ACLs:
- A leitura pelo equipamento é realizada de cima para baixo e sempre da esquerda para a
direita, obedecendo o sequenciamento criado na lista.
- A checagem ocorre até que um match ocorra nessa lista, caso não, existe um comando deny
implícito em todas as ACLs criadas por padrão.
- As ACLs se dividem em standard ou padrão (numeração de 1 a 99) e extended ou extendida
(numeração 100 a 199 ou no range expandido de 2000 a 2699).
- As ACLs devem ser aplicadas como Inbound (pacote checado antes da análise de destino do
roteador), ou Outbound (checagem realizada após a análise de destino);
- Sempre tenha em mente o ponto de vista do roteador para identificar o tráfego Inbound e
Outbound;
- São utilizadas wildcard bits para identificação da máscara de rede;
- As ACLs também podem ser nomeadas para melhor identificação.
- São utilizadas para manipulação de rotas em praticamente todos os protocolos de
roteamento;
- As boas práticas de ACL recomendam aplicar ACLs Standard o mais próximo do destino o
possível, já as ACLs Extended o mais próximo da origem;
- Não delete uma ACL que está aplicada em uma interface, sempre retire as configurações da
interface e depois delete;
Pessoal, para realizar as duas primeiras tasks podemos utilizar apenas uma ACL extendida
conforme abaixo:
R6(config)#ip access-list extended R7
R6(config-ext-nacl)#permit ip [Link] [Link] [Link] [Link]
R6(config-ext-nacl)#permit tcp [Link] [Link] [Link] [Link] eq 80
R6(config)#interface serial 1/0
R6(config-if)#ip access-group R7 out
Agora realize alguns testes como pingar a interface Lo0 do R7 pelo R4 ou tentar um telnet na
porta 80 pelo R5:
R4#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
R5#telnet [Link] 80
Trying [Link], 80 ...
% Destination unreachable; gateway or host down
Verifique se houve match em uma das ACLs criadas:
R6#sh ip access-lists
Extended IP access list R7
10 permit ip host [Link] host [Link]
20 permit tcp host [Link] host [Link] eq www
Agora realize os testes que as tasks pedem:
R4#telnet [Link] 80
Trying [Link], 80 ... Open
R6#sh ip access-lists
Extended IP access list R7
10 permit ip host [Link] host [Link]
20 permit tcp host [Link] host [Link] eq www (3 matches)
R5#traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 1 msec 2 msec 1 msec
2 [Link] 11 msec 11 msec *
R6#sh ip access-lists
Extended IP access list R7
10 permit ip host [Link] host [Link] (1 matches)
20 permit tcp host [Link] host [Link] eq www (3 matches)
Agora para testarmos o acesso via telnet, vamos criar uma acess-list padrão permitindo o ip do
roteador R6:
R7(config)#ip access-list standard 1
R7(config-std-nacl)#permit host [Link]
Adicione a ACL nas lines vty conforme abaixo:
R7(config)#line vty 0 4
R7(config-line)#access-class 1 in
Para teste, retire a ACL R7 do roteador R6 conforme abaixo:
R6(config)#interface serial 1/0
R6(config-if)#no ip access-group R7 out
Agora realize os testes dos roteadores R4, R5 e R6:
R4#telnet [Link]
Trying [Link] ...
% Connection refused by remote host
R5#telnet [Link]
Trying [Link] ...
% Connection refused by remote host
R6#telnet [Link]
Trying [Link] ... Open
User Access Verification
Username: admin
Password:
R7>
R6#telnet [Link]
Trying [Link] ... Open
User Access Verification
Username:
Para melhor exemplificar a granularidade das ACLs, verifiquem as opções disponíveis na
criação de uma ACL extendida:
R6(config)#ip access-list extended 100
R6(config-ext-nacl)#?
Ext Access List configuration commands:
<1-2147483647> Sequence Number
default Set a command to its defaults
deny Specify packets to reject
dynamic Specify a DYNAMIC list of PERMITs or DENYs
evaluate Evaluate an access list
exit Exit from access-list configuration mode
no Negate a command or set its defaults
permit Specify packets to forward
remark Access list entry comment
R6(config-ext-nacl)#permit ?
<0-255> An IP protocol number
ahp Authentication Header Protocol
eigrp Cisco's EIGRP routing protocol
esp Encapsulation Security Payload
gre Cisco's GRE tunneling
icmp Internet Control Message Protocol
igmp Internet Gateway Message Protocol
ip Any Internet Protocol
ipinip IP in IP tunneling
nos KA9Q NOS compatible IP over IP tunneling
object-group Service object group
ospf OSPF routing protocol
pcp Payload Compression Protocol
pim Protocol Independent Multicast
sctp Stream Control Transmission Protocol
tcp Transmission Control Protocol
udp User Datagram Protocol
R6(config-ext-nacl)#permit ip ?
A.B.C.D Source address
any Any source host
host A single source host
object-group Source network object group
R6(config-ext-nacl)#permit ip any any ?
dscp Match packets with given dscp value
fragments Check non-initial fragments
log Log matches against this entry
log-input Log matches against this entry, including input interface
option Match packets with given IP Options value
precedence Match packets with given precedence value
reflect Create reflexive access list entry
time-range Specify a time-range
tos Match packets with given TOS value
ttl Match packets with given TTL value
Configuração
R6(config)#ip access-list extended R7
R6(config-ext-nacl)#permit ip [Link] [Link] [Link] [Link]
R6(config-ext-nacl)#permit tcp [Link] [Link] [Link] [Link] eq 80
R6(config)#interface serial 1/0
R6(config-if)#ip access-group R7 out
R7(config)#ip access-list standard 1
R7(config-std-nacl)#permit host [Link]
R7(config)#line vty 0 4
R7(config-line)#access-class 1 in
BGP Advanced Lab 22 - eBGP
(configuração inicial em BGP-ADV)
Objetivo Proposto
- Estabeleça BGP peer entre os routers R11, R4 e R10 usando eBGP;
- Propague as redes de dentro do AS100 para os outros ASs utilizando o comando “network”;
- Configure os routers do AS200 como IGP OSPF com o processo 200, e o AS300 utilizando
EIGRP com o ASN 300 e redistribua as suas rotas para os outros ASs via BGP redistribute.
- Configure o eBGP entre o AS400 e os ASs 200 e 300 (R3–R5 e R8-R9);
- Configure o eBGP entre o AS400 e os ASs 500 e 600 (R7–R6 e R2-R1);
- Utilize autenticação entre os ASs 400 e os ISPs com a senha “cafecomredes”;
- Configure o AS400 com o IGP OSPF no processo 100;
- Configure todos os router-ids dos BGPs com o ip da interface Lo1;
- Todas as Lo1 devem estar na tabela de roteamento e na tabela BGP de cada router.
Passo a passo
O primeiro passo dessa taks é realizar a configuração do eBGP entre o router R11 e os routers
R4 e R10 dos ASs 200 e 300 respectivamente, para isso vamos adicionar as configurações
abaixo nos 3 routers:
R11(config)#router bgp 100
R11(config-router)#neighbor [Link] remote-as 200
R11(config-router)#neighbor [Link] remote-as 300
R4(config)#router bgp 200
R4(config-router)#neighbor [Link] remote-as 100
R10(config)#router bgp 300
R10(config-router)#neighbor [Link] remote-as 100
Verifique se o eBGP está UP com peer entre os ASs com o comando abaixo:
R11#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 200 6 6 1 0 0 00:01:55 0
[Link] 4 300 4 3 1 0 0 00:01:17 0
O próximo passo no nossa lab é propagar as redes do AS100 para os outros BGPs utilizando o
comando network, para isso lembre-se da diferença entre os outros protocolos IGP (OSPF ,
EIGRP) em que o comando “network” serve para informar qual interface irá participar do
processo de roteamento via esse protocolo, no caso do BGP esse comando server para
propagar as redes desejadas para os BGPs neighbors (com uma rega de que a rede
propagada deve estar ativa na tabela de roteamento comum):
R11(config)#router bgp 100
R11(config-router)#network [Link] mask [Link]
R11(config-router)#network [Link] mask [Link]
Para efeito de teste, tente adicionar o commando a baixo e veja se a rota [Link]/24
será propagada sendo que não temos ela ativa na tabela de roteamento:
R11#sh ip route
*Jan 20 02:15:44.529: %SYS-5-CONFIG_I: Configured from console by console
R11#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/8 is variably subnetted, 2 subnets, 2 masks
C [Link]/24 is directly connected, Loopback10
L [Link]/32 is directly connected, Loopback10
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback1
[Link]/16 is variably subnetted, 4 subnets, 2 masks
C [Link]/30 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
C [Link]/30 is directly connected, Ethernet0/1
L [Link]/32 is directly connected, Ethernet0/1
R11(config)#router bgp 100
R11(config-router)#network [Link] mask [Link]
Agora verifique nos outros BGPs se a rota entrou na tabela de roteamento:
R10#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/8 is variably subnetted, 2 subnets, 2 masks
B [Link]/24 [20/0] via [Link], 00:04:12
C [Link]/32 is directly connected, Loopback1
[Link]/32 is subnetted, 1 subnets
B [Link] [20/0] via [Link], 00:04:42
[Link]/16 is variably subnetted, 4 subnets, 3 masks
C [Link]/30 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
C [Link]/24 is directly connected, Ethernet0/1
L [Link]/32 is directly connected, Ethernet0/1
Um dos workarounds nesse tipo de situação é adicionar uma rota para Null0 dentro do R11
(alguns ambientes podem precisar desse tipo de configuração como em múltiplas VRFs ou
VPNs):
R11(config)#ip route [Link] [Link] null 0
R10#sh ip route
[Link]/8 is variably subnetted, 2 subnets, 2 masks
B [Link]/24 [20/0] via [Link], 00:05:55
C [Link]/32 is directly connected, Loopback1
[Link]/32 is subnetted, 1 subnets
B [Link] [20/0] via [Link], 00:06:25
[Link]/16 is variably subnetted, 4 subnets, 3 masks
C [Link]/30 is directly connected, Ethernet0/0
L [Link]/32 is directly connected, Ethernet0/0
C [Link]/24 is directly connected, Ethernet0/1
L [Link]/32 is directly connected, Ethernet0/1
B [Link]/24 [20/0] via [Link], 00:00:08
O próximo passos do lab é configurar o AS 200 com o IGP OSPF no processo 200:
R4(config)#router ospf 200
R4(config-router)# network [Link] [Link] area 0
R4(config-router)# network [Link] [Link] area 0
R5(config)#router ospf 200
R5(config-router)# network [Link] [Link] area 0
R5(config-router)# network [Link] [Link] area 0
Agora vamos criar o filtro via Prefix List 5 e Route-map RED para redistribuir para os outros
ASNs:
R4(config)#ip prefix-list 5 seq 5 permit [Link]/24
R4(config)#ip prefix-list 5 seq 10 permit [Link]/32
R4(config)#ip prefix-list 5 seq 15 permit [Link]/32
R4(config)# route-map RED permit 10
R4(config-route-map)# match ip address prefix-list 5
R4(config-route-map)#exit
R4(config)# router bgp 200
R4(config-router)# redistribute ospf 200 route-map RED
R4(config-router)#end
R5(config)#ip prefix-list 5 seq 5 permit [Link]/24
R5(config)#ip prefix-list 5 seq 10 permit 4..4.4.4/32
R5(config)#ip prefix-list 5 seq 15 permit [Link]/32
R5(config)# route-map RED permit 10
R5(config-route-map)# match ip address prefix-list 5
R5(config-route-map)#exit
R5(config)# router bgp 200
R5(config-router)# redistribute ospf 200 route-map RED
R5(config-router)#end
R10(config)#ip prefix-list 5 seq 5 permit [Link]/24
R10(config)#ip prefix-list 5 seq 10 permit [Link]/32
R10(config)#ip prefix-list 5 seq 15 permit [Link]/32
R10(config)# route-map RED permit 10
R10(config-route-map)# match ip address prefix-list 5
R10(config-route-map)#exit
R10(config)# router bgp 300
R10(config-router)# redistribute eigrp 300 route-map RED
R10(config-router)#end
R9(config)#ip prefix-list 5 seq 5 permit [Link]/24
R9(config)#ip prefix-list 5 seq 10 permit [Link]/32
R9(config)#ip prefix-list 5 seq 15 permit [Link]/32
R9(config)# route-map RED permit 10
R9(config-route-map)# match ip address prefix-list 5
R9(config-route-map)#exit
R9(config)# router bgp 300
R9(config-router)# redistribute eigrp 300 route-map RED
R9(config-router)#end
Agora vamos configurar os equipamentos do AS 400 com o IGP OSPF no processo 100 e os
EBGPs com os ASNs vizinhos:
R3(config)#router ospf 100
R3(config-router)#network [Link] [Link] area 0
R3(config-router)# network [Link] [Link] area 0
R3(config-router)#exit
R3(config-router)#router bgp 400
R3(config-router)#bgp router-id [Link]
R3(config-router)# neighbor [Link] remote-as 200
R8(config)#router ospf 100
R8(config-router)#network [Link] [Link] area 0
R8(config-router)# network [Link] [Link] area 0
R8(config-router)#exit
R8(config-router)#router bgp 400
R8(config-router)#bgp router-id [Link]
R8(config-router)# neighbor [Link] remote-as 300
R2(config)#router ospf 100
R2(config-router)#network [Link] [Link] area 0
R2(config-router)# network [Link] [Link] area 0
R2(config-router)#exit
R2(config-router)#router bgp 400
R2(config-router)#bgp router-id [Link]
R2(config-router)# neighbor [Link] remote-as 500
R2(config-router)#neighbor [Link] password cafecomredes
R7(config)#router ospf 100
R7(config-router)#network [Link] [Link] area 0
R7(config-router)# network [Link] [Link] area 0
R7(config)#router ospf 600
R7(config-router)#network [Link] [Link] area 0
R7(config-router)# network [Link] [Link] area 0
R7(config-router)# network [Link] [Link] area 0
R7(onfig-router)#exit
R7(config-router)#router bgp 400
R7(config-router)#bgp router-id [Link]
R7(config-router)# neighbor [Link] remote-as 600
R7(config-router)# neighbor [Link] password cafecomredes
R7(config-router)# neighbor [Link] ebgp-multihop 2
R7(config-router)# neighbor [Link] update-source Loopback1
Agora vamos fazer a configuração dos 2 ISPs:
ISP-1(config-router)#router bgp 500
ISP-1 (config-router)#bgp router-id [Link]
ISP-1 (config-router)# neighbor [Link] remote-as 300
ISP-1 (config-router)# neighbor [Link] password cafecomredes
ISP-1 (config-router)#network [Link] mask [Link]
ISP-1 (config-router)#network [Link] mask [Link]
ISP-2(config)#router ospf 600
ISP-2(config-router)#network [Link] [Link] area 0
ISP-2 (config-router)# network [Link] [Link] area 0
ISP-2(config-router)# network [Link] [Link] area 0
ISP-2(config-router)#exit
ISP-2 (config-router)#router bgp 600
ISP-2 (config-router)#bgp router-id [Link]
ISP-2 (config-router)# neighbor [Link] remote-as 400
ISP-2 (config-router)# neighbor [Link] password cafecomredes
ISP-2(config-router)# neighbor [Link] ebgp-multihop 2
ISP-2 (config-router)# neighbor [Link] update-source Loopback1
ISP-2 (config-router)# network [Link] mask [Link]
ISP-2 (config-router)# network [Link] mask [Link]
Para adicionar a configuração de bgp router-id dos routers:
R11(config-router)#router bgp 100
R11(config-router)#bgp router-id [Link]
R4(config-router)#router bgp 200
R4(config-router)#bgp router-id [Link]
R5(config-router)#router bgp 200
R5(config-router)#bgp router-id [Link]
R10(config-router)#router bgp 300
R10(config-router)#bgp router-id [Link]
R9(config-router)#router bgp 300
R9(config-router)#bgp router-id [Link]
R8(config-router)#router bgp 400
R8(config-router)#bgp router-id [Link]
R3(config-router)#router bgp 400
R3(config-router)#bgp router-id [Link]
R2(config-router)#router bgp 400
R2(config-router)#bgp router-id [Link]
R7(config-router)#router bgp 400
R7(config-router)#bgp router-id [Link]
R1(config-router)#router bgp 500
R1(config-router)#bgp router-id [Link]
R6(config-router)#router bgp 600
R6(config-router)#bgp router-id [Link]
Configure a redistribuição das entre os IGPs e os EGPs do lab:
R3(config)#router bgp 400
R3(config-router)#redistribute ospf 100
R8(config)#router bgp 400
R8(config-router)#redistribute ospf 100
R2(config)#router bgp 400
R2(config-router)#redistribute ospf 100
R7(config)#router bgp 400
R7(config-router)#redistribute ospf 100
R5(config)#router ospf 200
R5(config-router)#redistribute bgp 200 subnets
R9(config)#router eigrp 300
R9(config-router)#redistribute bgp 300 metric 10000 10 1 1 1500
Agora propague a rota [Link]/32 entre o AS400 e os ASs 200 e 300:
R3(config)#router bgp 400
R3(config-router)# network [Link] mask [Link]
R8(config)#router bgp 400
R8(config-router)# network [Link] mask [Link]
Perceba que por não termos IBGP entre os routers a propagação e divulgação de rotas fica
bem complicado tornando difícil a realização da última task.
Configuração
R11(config)#router bgp 100
R11(config-router)#neighbor [Link] remote-as 200
R11(config-router)#neighbor [Link] remote-as 300
R11(config-router)#network [Link] mask [Link]
R11(config-router)#network [Link] mask [Link]
R11(config-router)#bgp router-id [Link]
R4(config)#router bgp 200
R4(config-router)#neighbor [Link] remote-as 100
R4(config-router)# network [Link] [Link] area 0
R4(config-router)# network [Link] [Link] area 0
R4(config)#ip prefix-list 5 seq 5 permit [Link]/24
R4(config)#ip prefix-list 5 seq 10 permit [Link]/32
R4(config)#ip prefix-list 5 seq 15 permit [Link]/32
R4(config)# route-map RED permit 10
R4(config-route-map)# match ip address prefix-list 5
R4(config)# router bgp 200
R4(config-router)# redistribute ospf 200 route-map RED
R4(config-router)#bgp router-id [Link]
R10(config)#router bgp 300
R10(config-router)#neighbor [Link] remote-as 100
R10(config)#ip prefix-list 5 seq 5 permit [Link]/24
R10(config)#ip prefix-list 5 seq 10 permit [Link]/32
R10(config)#ip prefix-list 5 seq 15 permit [Link]/32
R10(config)# route-map RED permit 10
R10(config-route-map)# match ip address prefix-list 5
R10(config)# router bgp 300
R10(config-router)# redistribute eigrp 300 route-map RED
R10(config-router)#bgp router-id [Link]
R5(config)#router ospf 200
R5(config-router)# network [Link] [Link] area 0
R5(config-router)# network [Link] [Link] area 0
R5(config-router)#redistribute bgp 200 subnets
R5(config)#ip prefix-list 5 seq 5 permit [Link]/24
R5(config)#ip prefix-list 5 seq 10 permit 4..4.4.4/32
R5(config)#ip prefix-list 5 seq 15 permit [Link]/32
R5(config)# route-map RED permit 10
R5(config-route-map)# match ip address prefix-list 5
R5(config)# router bgp 200
R5(config-router)# redistribute ospf 200 route-map RED
R5(config-router)#bgp router-id [Link]
R9(config)#router eigrp 300
R9(config-router)#redistribute bgp 300 metric 10000 10 1 1 1500
R9(config)#ip prefix-list 5 seq 5 permit [Link]/24
R9(config)#ip prefix-list 5 seq 10 permit [Link]/32
R9(config)#ip prefix-list 5 seq 15 permit [Link]/32
R9(config)# route-map RED permit 10
R9(config-route-map)# match ip address prefix-list 5
R9(config)# router bgp 300
R9(config-router)# redistribute eigrp 300 route-map RED
R9(config-router)#bgp router-id [Link]
R3(config)#router ospf 100
R3(config-router)#network [Link] [Link] area 0
R3(config-router)# network [Link] [Link] area 0
R3(config-router)#router bgp 400
R3(config-router)#bgp router-id [Link]
R3(config-router)# neighbor [Link] remote-as 200
R3(config-router)#redistribute ospf 100
R3(config-router)# network [Link] mask [Link]
R8(config)#router ospf 100
R8(config-router)#network [Link] [Link] area 0
R8(config-router)# network [Link] [Link] area 0
R8(config-router)#router bgp 400
R8(config-router)#bgp router-id [Link]
R8(config-router)# neighbor [Link] remote-as 300
R8(config-router)#redistribute ospf 100
R8(config-router)# network [Link] mask [Link]
R2(config)#router ospf 100
R2(config-router)#network [Link] [Link] area 0
R2(config-router)# network [Link] [Link] area 0
R2(config-router)#router bgp 400
R2(config-router)#bgp router-id [Link]
R2(config-router)# neighbor [Link] remote-as 500
R2(config-router)#neighbor [Link] password cafecomredes
R2(config-router)#redistribute ospf 100
R7(config)#router ospf 100
R7(config-router)#network [Link] [Link] area 0
R7(config-router)# network [Link] [Link] area 0
R7(config)#router ospf 600
R7(config-router)#network [Link] [Link] area 0
R7(config-router)# network [Link] [Link] area 0
R7(config-router)# network [Link] [Link] area 0
R7(config-router)#router bgp 400
R7(config-router)#bgp router-id [Link]
R7(config-router)# neighbor [Link] remote-as 600
R7(config-router)# neighbor [Link] password cafecomredes
R7(config-router)# neighbor [Link] ebgp-multihop 2
R7(config-router)# neighbor [Link] update-source Loopback1
R7(config-router)#redistribute ospf 100
ISP-1(config-router)#router bgp 500
ISP-1 (config-router)#bgp router-id [Link]
ISP-1 (config-router)# neighbor [Link] remote-as 300
ISP-1 (config-router)# neighbor [Link] password cafecomredes
ISP-1 (config-router)#network [Link] mask [Link]
ISP-1 (config-router)#network [Link] mask [Link]
ISP-2(config)#router ospf 600
ISP-2(config-router)#network [Link] [Link] area 0
ISP-2 (config-router)# network [Link] [Link] area 0
ISP-2(config-router)# network [Link] [Link] area 0
ISP-2 (config-router)#router bgp 600
ISP-2 (config-router)#bgp router-id [Link]
ISP-2 (config-router)# neighbor [Link] remote-as 400
ISP-2 (config-router)# neighbor [Link] password cafecomredes
ISP-2(config-router)# neighbor [Link] ebgp-multihop 2
ISP-2 (config-router)# neighbor [Link] update-source Loopback1
ISP-2 (config-router)# network [Link] mask [Link]
ISP-2 (config-router)# network [Link] mask [Link]
BGP Advanced Lab 23 – eBGP manipulando Origin code
(configuração inicial em BGP-ADV)
Objetivo Proposto
- Permita a instalação BGP 2 caminhos distindos para alcançar as redes remotas perspectiva do
R11;
- Manipule o melhor caminho para a rede [Link]/32 utilizando o atributo de Origin Code
dessa rota.
Passo a passo
O primeiro passo para realizar esse lab é configurar o maximum path 2 para que o o BGP possa
instalar duas rotas com métricas iguais na tabela BGP, no nosso caso não teremos as métricas
iguais pois as redistribuições são de IGPs (OSPF e EIGRP) tendo o MED automaticamente
calculado em caso de redistribuição, mas é uma boa prática no caso de 2 caminhos diferentes
para o mesmo destino:
R11(config)#router bgp 100
R11(config-router)# maximum path 2
Em seguida vamos criar a prefix list para dar o match na rede [Link]/32 e a route-map
para manipular o Origin code desse bloco especifico:
R11(config)#ip prefix list ISP1 seq 5 permit [Link]/32
R11(config)#route-map OC permit 10
R11(config-route-map)match ip address prefix-list ISP1
R11(config-route-map)set origin igp
Por último vamos aplicar o route-map como “in” no neighbor configurado do AS300 e dar um
clear na sessão BGP com o AS300:
R11(config)#router bgp 100
R11(config-router)#neighbor [Link] route-map OC in
R11(config-router)#end
R11# clear ip bgp * soft
Por fim vamos checar como ficou a rota para o destino após a configuração realizada:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
*> [Link]/32 [Link] 0 0 200 i
*> [Link]/32 [Link] 11 0 200 ?
*> [Link]/24 [Link] 0 32768 i
*> [Link]/32 [Link] 0 0 300 i
*> [Link]/32 [Link] 0 300 i
* [Link] 0 200 ?
*> [Link]/24 [Link] 0 0 200 ?
Configuração
R11(config)#router bgp 100
R11(config-router)# maximum path 2
R11(config)#ip prefix list ISP1 seq 5 permit [Link]/32
R11(config)#route-map OC permit 10
R11(config-route-map)match ip address prefix-list ISP1
R11(config-route-map)set origin igp
R11(config)#router bgp 100
R11(config-router)#neighbor [Link] route-map OC in
BGP Advanced Lab 24 – iBGP
(configuração inicial em BGP-ADV)
Objetivo Proposto
-Configure os IGPs como iBGP dentro dos ASs 400, 200 e 300;
- Utilize o comando next-hop self quando necessário.
Passo a passo
O primeiro passo para realizar esse lab é realizar a configuração do AS200 nos routers R4 e R5:
R4(config)#router bgp 200
R4(config-router)#neighbor [Link] remote-as 200
R4(config-router)#neighbor [Link] update-source lo1
R5(config)#router bgp 200
R5(config-router)#neighbor [Link] remote-as 200
R5(config-router)#neighbor [Link] update-source lo1
Um dos pontos importantes nessa configuração é que o R5 esta recebendo a rota para
[Link]/32 com o Next-Hop [Link] (interface diretamente conectada do R3), porém o
R4 tem a rota instalada na sua tabela BGP mas não na sua tabela de roteamento (o ip do next-
hop [Link] não é alcançável), para ajustar esse comportamento, devemos utilizar o
comando Next-hop self:
R4(config)#router bgp 200
R4(config-router)#neighbor [Link] next-hop-self
R5(config)#router bgp 200
R5(config-router)#neighbor [Link] next-hop-self
Após a configuração, o bloco ficara instalado tanto na tabela BGP quanto na tabela de
roteamento na seguinte forma com o next-hop para o ip [Link]:
R4#sh ip bgp | in [Link]
*>i [Link]/32 [Link] 0 100 0 400 i
R4#sh ip route [Link]
Routing entry for [Link]/32
Known via "bgp 200", distance 200, metric 0
Tag 400, type internal
Last update from [Link] 04:11:20 ago
Routing Descriptor Blocks:
* [Link], from [Link], 04:11:20 ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 400
MPLS label: none
O próximo passo é realizar a configuração do AS400 nos routers R2 e R3:
R2(config)#router bgp 400
R2(config-router)#neighbor [Link] remote-as 400
R2(config-router)#neighbor [Link] update-source lo1
R2(config-router)#neighbor [Link] next-hop-self
R3(config)#router bgp 400
R3(config-router)#neighbor [Link] remote-as 400
R3(config-router)#neighbor [Link] update-source lo1
R3(config-router)#neighbor [Link] next-hop-self
Após realizar as configurações acima, as rotas para o AS500 devem aparecer da seguinte forma
na perspectiva do AS100:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> [Link]/32 [Link] 0 200 400 500 i
* [Link]/32 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
*> [Link]/32 [Link] 0 200 400 i
* [Link] 0 300 400 ?
*> [Link]/32 [Link] 0 0 200 i
*> [Link]/32 [Link] 11 0 200 ?
* [Link]/32 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/32 [Link] 0 200 400 ?
*> [Link] 0 300 400 i
*> [Link]/32 [Link] 409600 0 300 ?
*> [Link]/24 [Link] 0 32768 i
*> [Link]/32 [Link] 0 0 300 i
Network Next Hop Metric LocPrf Weight Path
*> [Link]/32 [Link] 0 32768 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/24 [Link] 0 0 200 ?
*> [Link]/24 [Link] 0 0 300 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
Após realizar as configurações acima, vamos realizar as configurações no AS300 também:
R9(config)#router bgp 300
R9(config-router)#neighbor [Link] remote-as 300
R9(config-router)#neighbor [Link] update-source lo1
R9(config-router)#neighbor [Link] next-hop-self
R10(config)#router bgp 300
R10(config-router)#neighbor [Link] remote-as 300
R10(config-router)#neighbor [Link] update-source lo1
R10(config-router)#neighbor [Link] next-hop-self
Agora vamos realizar as configurações restantes do AS400:
R8(config)#router bgp 400
R8(config-router)#neighbor [Link] remote-as 400
R8(config-router)#neighbor [Link] update-source lo1
R8(config-router)#neighbor [Link] next-hop-self
R8(config-router)#neighbor [Link] remote-as 400
R8(config-router)#neighbor [Link] update-source lo1
R8(config-router)#neighbor [Link] next-hop-self
R7(config)#router bgp 400
R7(config-router)#neighbor [Link] remote-as 400
R7(config-router)#neighbor [Link] update-source lo1
R7(config-router)#neighbor [Link] next-hop-self
R7(config-router)#neighbor [Link] remote-as 400
R7(config-router)#neighbor [Link] update-source lo1
R7(config-router)#neighbor [Link] next-hop-self
R2(config)#router bgp 400
R2(config-router)#neighbor [Link] remote-as 400
R2(config-router)#neighbor [Link] update-source lo1
R2(config-router)#neighbor [Link] next-hop-self
R3(config)#router bgp 400
R3(config-router)#neighbor [Link] remote-as 400
R3(config-router)#neighbor [Link] update-source lo1
R3(config-router)#neighbor [Link] next-hop-self
Após o termino das configurações, devemos ter o AS-PATH completo para as rotas na
perspectiva do AS100:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> [Link]/32 [Link] 0 200 400 500 i
* [Link]/32 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
*> [Link]/32 [Link] 0 200 400 i
* [Link] 0 300 400 ?
*> [Link]/32 [Link] 0 0 200 i
*> [Link]/32 [Link] 11 0 200 ?
* [Link]/32 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/32 [Link] 0 200 400 ?
*> [Link] 0 300 400 i
*> [Link]/32 [Link] 409600 0 300 ?
*> [Link]/24 [Link] 0 32768 i
*> [Link]/32 [Link] 0 0 300 i
Network Next Hop Metric LocPrf Weight Path
*> [Link]/32 [Link] 0 32768 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/24 [Link] 0 0 200 ?
*> [Link]/24 [Link] 0 0 300 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
* [Link]/30 [Link] 0 200 400 ?
*> [Link] 0 300 400 ?
R11#sh ip bgp [Link]/32
BGP routing table entry for [Link]/32, version 13
Paths: (2 available, best #2, table default)
Advertised to update-groups:
Refresh Epoch 1
200 400
[Link] from [Link] ([Link])
Origin incomplete, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
300 400
[Link] from [Link] ([Link])
Origin IGP, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
Configuração
R4(config)#router bgp 200
R4(config-router)#neighbor [Link] remote-as 200
R4(config-router)#neighbor [Link] update-source lo1
R4(config-router)#neighbor [Link] next-hop-self
R5(config)#router bgp 200
R5(config-router)#neighbor [Link] remote-as 200
R5(config-router)#neighbor [Link] update-source lo1
R5(config-router)#neighbor [Link] next-hop-self
R2(config)#router bgp 400
R2(config-router)#neighbor [Link] remote-as 400
R2(config-router)#neighbor [Link] update-source lo1
R2(config-router)#neighbor [Link] next-hop-self
R2(config-router)#neighbor [Link] remote-as 400
R2(config-router)#neighbor [Link] update-source lo1
R2(config-router)#neighbor [Link] next-hop-self
R3(config)#router bgp 400
R3(config-router)#neighbor [Link] remote-as 400
R3(config-router)#neighbor [Link] update-source lo1
R3(config-router)#neighbor [Link] next-hop-self
R3(config-router)#neighbor [Link] remote-as 400
R3(config-router)#neighbor [Link] update-source lo1
R3(config-router)#neighbor [Link] next-hop-self
R9(config)#router bgp 300
R9(config-router)#neighbor [Link] remote-as 300
R9(config-router)#neighbor [Link] update-source lo1
R9(config-router)#neighbor [Link] next-hop-self
R10(config)#router bgp 300
R10(config-router)#neighbor [Link] remote-as 300
R10(config-router)#neighbor [Link] update-source lo1
R10(config-router)#neighbor [Link] next-hop-self
R8(config)#router bgp 400
R8(config-router)#neighbor [Link] remote-as 400
R8(config-router)#neighbor [Link] update-source lo1
R8(config-router)#neighbor [Link] next-hop-self
R8(config-router)#neighbor [Link] remote-as 400
R8(config-router)#neighbor [Link] update-source lo1
R8(config-router)#neighbor [Link] next-hop-self
R7(config)#router bgp 400
R7(config-router)#neighbor [Link] remote-as 400
R7(config-router)#neighbor [Link] update-source lo1
R7(config-router)#neighbor [Link] next-hop-self
R7(config-router)#neighbor [Link] remote-as 400
R7(config-router)#neighbor [Link] update-source lo1
R7(config-router)#neighbor [Link] next-hop-self
BGP Advanced Lab 25 – Aggregation, Summary-only, Suppress-
map
(configuração inicial em BGP-ADV)
Objetivo Proposto
- Crie uma agregação para os IPs das Loopbacks 2, 3, 4 e 5 do router R1 no ASN 500 e propague
a agregação para os outros ASNs;
- Crie a mesma configuração porém utilizando o comando “summary-only” e verifique a
diferença na tabela BGP dos ASNs vizinhos;
- Realize um suppress da rota [Link]/32 utilizando suppress-map com prefix-list permit;
- Realize um suppress da rota [Link]/32 utilizando suppress-map com prefix-list deny;
Passo a passo
Galera, o primeiro passo para agregação dos blocos é transformar os dígitos decimais em
binários, como a diferença fica no último octeto, vamos realizar apenas nele:
[Link]/32 01011000
[Link]/32 01100011
[Link]/32 01100100
[Link]/32 01100101
Com esse bloco, a agregação fica em um bloco /26 ou mascara [Link], como essa
mascara “pula de 64 em 64” vamos utilizar a rede [Link]/26.
O próximo passo é realizar a configuração no nosso router ISP-1:
ISP-1(config)#router bgp 500
ISP-1(config-router)#aggregate-address [Link] [Link]
ISP-1(config-router)#end
ISP-1# clear ip bgp * soft
Agora valide se a sumarização está sendo recebida no router R11 do AS100:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> [Link]/26 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
O próximo passo é realizar a propagação dos blocos mais específico/32 no nosso router ISP-1
ISP-1(config)#router bgp 500
ISP-1(config-router)#network [Link] mask [Link]
ISP-1(config-router)#network [Link] mask [Link]
ISP-1(config-router)#network [Link] mask [Link]
ISP-1(config-router)#network [Link] mask [Link]
Valide novamente a sumarização e os blocos sendo recebida no router R11 do AS100:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> [Link]/26 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
Agora vamos realizar a configuração para recebermos somente a agregação, sem os blocos
mais específicos, para isso vamos utilizar o comando “summary-only”:
ISP-1(config)#router bgp 500
ISP-1(config-router)#aggregate-address [Link] [Link] summary-only
ISP-1(config-router)#end
ISP-1# clear ip bgp * soft
Valide novamente a sumarização e os blocos sendo recebida no router R11 do AS100:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> [Link]/26 [Link] 0 200 400 500 i
Agora vamos realizar o suppress da rota [Link]/32 utilizando a prefix-list SPP (permit),
mas antes retire o comando “summary-only”:
ISP-1(config)# router bgp 500
ISP-1(config-router)#no aggregate-address [Link] [Link] summary-only
ISP-1(config-router)#aggregate-address [Link] [Link]
ISP-1(config-router)#exit
ISP-1(config)#ip prefix-list SPP permit [Link]/32
ISP-1(config)#iroute-map SUPPRESS
ISP-1(config-route-map)#match ip address SPP
ISP-1(config-route-map)#exit
ISP-1(config)# router bgp 500
ISP-1(config-router)# aggregate-address [Link] [Link] suppress-map SUPPRESSS
ISP-1(config-router)#end
ISP-1# clear ip bgp * soft
Valide novamente a sumarização e os blocos sendo recebida no router R11 do AS100:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> [Link]/26 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
O último passo do lab é realizar o suppress da rota utilizando o deny ao invés de permit,
perceba que a logica do suprress é invertida (deny serve para não realizar o suppress):
ISP-1(config)#no ip prefix-list SPP permit [Link]/32
ISP-1(config)#ip prefix-list SPP seq 5 deny [Link]/32
ISP-1(config)#ip prefix-list SPP seq 10 deny [Link]/32
ISP-1(config)#ip prefix-list SPP seq 15 deny [Link]/32
ISP-1(config)#ip prefix-list SPP seq 20 permit [Link]/0 le 32
Valide novamente a sumarização e os blocos sendo recebida no router R11 do AS100:
R11#sh ip bgp
BGP table version is 20, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> [Link]/26 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
Configuração
ISP-1(config)#router bgp 500
ISP-1(config-router)#aggregate-address [Link] [Link]
ISP-1(config-router)#network [Link] mask [Link]
ISP-1(config-router)#network [Link] mask [Link]
ISP-1(config-router)#network [Link] mask [Link]
ISP-1(config-router)#network [Link] mask [Link]
ISP-1(config-router)#aggregate-address [Link] [Link] summary-only
ISP-1(config)#ip prefix-list SPP permit [Link]/32
ISP-1(config)#iroute-map SUPPRESS
ISP-1(config-route-map)#match ip address SPP
ISP-1(config)# router bgp 500
ISP-1(config-router)# aggregate-address [Link] [Link] suppress-map SUPPRESSS
ISP-1(config)#no ip prefix-list SPP permit [Link]/32
ISP-1(config)#ip prefix-list SPP seq 5 deny [Link]/32
ISP-1(config)#ip prefix-list SPP seq 10 deny [Link]/32
ISP-1(config)#ip prefix-list SPP seq 15 deny [Link]/32
ISP-1(config)#ip prefix-list SPP seq 20 permit [Link]/0 le 32
BGP Advanced Lab 26 – Route Reflector
(configuração inicial em BGP-ADV)
Objetivo Proposto
- Configure o router R2 como route-reflector do AS 400 para ajustar o design do lab.
Passo a passo
Pessoal, como configuramos o R11 para instalar na tabela BGP 2 entradas com o comando
“maximum-path 2” percebemos que as rotas para os blocos do AS500 estão chegando apenas
pelo path AS200 – AS400- AS500 conforme abaixo:
R11#sh ip bgp
BGP table version is 51, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
*> [Link]/32 [Link] 0 200 400 500 i
Outro detalhe importante é que o R8 não está recebendo as rotas do AS500 como os outros
routers que possuem iBGP com o R2:
R8#sh ip route bgp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
B [Link] [200/11] via [Link], 03:02:06
[Link]/32 is subnetted, 1 subnets
B [Link] [200/0] via [Link], 03:02:06
[Link]/32 is subnetted, 2 subnets
B [Link] [200/0] via [Link], 03:01:42
[Link]/32 is subnetted, 1 subnets
B [Link] [20/0] via [Link], 03:02:07
[Link]/8 is variably subnetted, 2 subnets, 2 masks
B [Link]/24 [20/0] via [Link], 03:01:54
B [Link]/32 [20/409600] via [Link], 03:02:07
[Link]/32 is subnetted, 1 subnets
B [Link] [20/0] via [Link], 03:01:54
[Link]/16 is variably subnetted, 4 subnets, 3 masks
B [Link]/24 [200/0] via [Link], 03:02:06
B [Link]/24 [20/0] via [Link], 03:02:07
O primeiro passo para ajustar o design do AS400 e configurar o R2 como route-reflector é criar
o iBGP peer entre o R8 e o R2:
R2(config)#router bgp 400
R2(config-router)#neighbor [Link] remote-as 400
R2(config-router)#neighbor [Link] update-source lo1
R2(config-router)#neighbor [Link] next-hop-self
R8(config)#router bgp 400
R8(config-router)#neighbor [Link] remote-as 400
R8(config-router)#neighbor [Link] update-source lo1
R8(config-router)#neighbor [Link] next-hop-self
Após a configuração passamos a receber os blocos do AS500 no R8 e também no R11 (com 2
paths disponíveis):
R8#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/32 is subnetted, 4 subnets
B [Link] [200/0] via [Link], 00:01:54
B [Link] [200/0] via [Link], 00:01:54
B [Link] [200/0] via [Link], 00:01:54
B [Link] [200/0] via [Link], 00:01:54
R11#sh ip bgp
BGP table version is 51, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
* [Link]/32 [Link] 0 300 400 500 i
*> [Link] 0 200 400 500 i
* [Link]/32 [Link] 0 300 400 500 i
*> [Link] 0 200 400 500 i
* [Link]/32 [Link] 0 300 400 500 i
*> [Link] 0 200 400 500 i
* [Link]/32 [Link] 0 300 400 500 i
*> [Link] 0 200 400 500 i
O problema do AS400 nessa configuração atual é a necessidade de um full-mesh entre todos
os routers para manter o as-path/atributos sendo propagados, o custo de uma infra para
suportar todos os iBGPs entre os routers pode ser um problema além da complexidade das
configurações para todos os routers, para simplificar o nosso AS podemos utilizar o route-
reflector como solução, para isso basta apenas realizar a configuração abaixo no R2:
R2(config)#router bgp 400
R2(config-router)#neighbor [Link] route-reflector-client
R2(config-router)#neighbor [Link] route-reflector-client
R2(config-router)#neighbor [Link] route-reflector-client
Após a configuração, verifique o bloco [Link]/24 na perspectiva do router R2:
R2# sh ip bgp [Link]/24
BGP routing table entry for [Link]/24, version 61
Paths: (2 available, best #2, table default)
Advertised to update-groups:
1 5
Refresh Epoch 3
300 100, (Received from a RR-client)
[Link] (metric 21) from [Link] ([Link])
Origin IGP, metric 0, localpref 100, valid, internal
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
200 100, (Received from a RR-client)
[Link] (metric 11) from [Link] ([Link])
Origin IGP, metric 0, localpref 100, valid, internal, best
rx pathid: 0, tx pathid: 0x0
Configuração
R2(config)#router bgp 400
R2(config-router)#neighbor [Link] remote-as 400
R2(config-router)#neighbor [Link] update-source lo1
R2(config-router)#neighbor [Link] next-hop-self
R2(config-router)#neighbor [Link] route-reflector-client
R2(config-router)#neighbor [Link] route-reflector-client
R2(config-router)#neighbor [Link] route-reflector-client
R8(config)#router bgp 400
R8(config-router)#neighbor [Link] remote-as 400
R8(config-router)#neighbor [Link] update-source lo1
R8(config-router)#neighbor [Link] next-hop-self