Rota configurada para next-hop ou interface de saída?

Uma rota estática deve ser configura sempre apontando para o IP do next-hop. Isso é o que diz as melhores práticas para configuração de roteamento… Mas qual a diferença na prática??

Bom, sabemos que quando a rota é configurada apontando para a interface, ela tem distância administrativa 0 (diretamente conectada) e apontando para um IP terá distância administrativa será 1 (padrão para rota estática).

Rota configurada: ip route 192.168.1.0 255.255.255.0 f0/0
Entrada na tabela de roteamento: S    192.168.1.0/24 is directly connected, FastEthernet0/0

Rota configurada: ip route 192.168.1.0 255.255.255.0 172.16.1.10
Entrada na tabela de roteamento: S    192.168.1.0/24 [1/0] via 172.16.1.10

Isso pode ser bom ou mau, dependendo da sua necessidade.

Mas vamos ver algumas situações onde (e porque) existem diferenças entre configurar uma rota estática para o IP do next-hop ou para a interface de saída.

1°) Imagine que você tem 10 rotas apontando para a S0/0 (interface de saída), e foi necessário mudar a interface (deu problema na interface e o link foi conectado na S0/1, por exemplo) teríamos que mudar também todas as rotas.

2°) Este problema ocorre com freqüência quando utilizamos a interface de saída na rota em conexões NÃO ponto a ponto. Por exemplo uma conexão entre um roteador e um switch, que recebe ainda a conexão de diversos dispositivos. Se você aponta a rota para sua interface de saída, o equipamento vai enviar o pacote para quem?

Para onde o tráfego vai?

Na teoria o roteador BrainRT01 vai enviar um broadcast layer2 e o roteador BrainRT02 responderá (proxy-ARP). Porém isso nem sempre funciona (algum equipamento pode bloquear a requisição,por exemplo)…E se não for ethernet? Ai fica pior, e são grandes as chances do tráfego não ir para lugar nenhum.

3°) Proxy-ARP em redes do tipo broadcast. Quando configuramos a rota para a interface, o equipamento envia uma mensagem broadcast para descobrir para onde o tráfego deve ser enviando, como vimos acima. Ele fará isso para todo IP buscado através daquela rota. Por sua vez o roteador que conhece este IP ou rede (BrainRT02, no exemplo abaixo) responderá todas as requisições, fazendo o proxy-ARP (enviará o seu mac-address da interface F0/1). Com esta resposta o roteador que fez a requisição (BrainRT01) cadastra o mac-address do roteador que respondeu (BrainRT02) em sua tabela ARP, associando ao IP.

Exemplo: Rotas estáticas configuradas apontando a interface de saída.

Rotas configuradas no BrainRT01:
ip route 1.1.1.0 255.255.255.252 FastEthernet0/1
ip route 2.1.1.0 255.255.255.252 FastEthernet0/1
ip route 3.1.1.0 255.255.255.252 FastEthernet0/1
ip route 4.1.1.0 255.255.255.252 FastEthernet0/1

Proxy-ARP e excesso de broadcast

Do BrainRT01 vamos pingar as redes de BrainRT02, e depois ver como ficou a tabela ARP.

BrainRT01#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/8 ms
BrainRT01#ping 2.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms
BrainRT01#ping 3.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/9 ms
BrainRT01#ping 4.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
BrainRT01#
BrainRT01#
BrainRT01#show arp
Protocol  Address          Age (min)    Hardware Addr     Type    Interface
Internet  1.1.1.1                     0     001b.d4c9.77d7     ARPA    FastEthernet0/1
Internet  3.1.1.1                     0     001b.d4c9.77d7     ARPA    FastEthernet0/1
Internet  2.1.1.1                     0     001b.d4c9.77d7     ARPA    FastEthernet0/1
Internet  4.1.1.1                     0     001b.d4c9.77d7     ARPA    FastEthernet0/1
Internet  172.16.1.5                  –       0019.aa80.28c2      ARPA    FastEthernet0/1
Internet  172.16.1.6               79        001b.d4c9.77d7     ARPA     FastEthernet0/1
Internet  172.16.1.1               79        000c.ce36.fb00      ARPA     FastEthernet0/0
Internet  172.16.1.2                 –        0019.aa80.28c1      ARPA    FastEthernet0/0
BrainRT01#

Cada ping criou uma requisição ARP. Isso pode causar excesso de broadcast na rede, principalmente se a rota em questão, que está configurada apontando para a interface, for a rota default.

Veja a diferença na tabela ARP quando usamos rotas com o IP do next-hop:

Rotas configuras no BrainRT01:
ip route 1.1.1.0 255.255.255.0 172.16.1.6
ip route 2.1.1.0 255.255.255.0 172.16.1.6
ip route 3.1.1.0 255.255.255.0 172.16.1.6
ip route 4.1.1.0 255.255.255.0 172.16.1.6

BrainRT01#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/9 ms
BrainRT01#ping 2.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
BrainRT01#ping 3.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
BrainRT01#ping 4.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms
BrainRT01#
BrainRT01#show arp
Protocol  Address          Age (min)   Hardware Addr     Type     Interface
Internet  172.16.1.5               –     0019.aa80.28c2      ARPA    FastEthernet0/1
Internet  172.16.1.6            5     001b.d4c9.77d7   ARPA    FastEthernet0/1
Internet  172.16.1.1            236    000c.ce36.fb00       ARPA    FastEthernet0/0
Internet  172.16.1.2               –     0019.aa80.28c1      ARPA    FastEthernet0/0
BrainRT01#

Desta forma o roteador BraintRT01 precisa identificar apenas o mac-address do next-hop, e colocá-lo em sua tabela ARP, como mostrado acima.

4°) Agora imagine que na topologia abaixo temos configurado protocolo de roteamento, além das rotas estáticas. Se configurarmos as rotas estáticas para a interface e ela ficar down a rota é removida da tabela de roteamento. Por outro lado, se a rota for configurada com o IP do next-hop, mesmo que a interface F0/1 do BrainRT01 fique down, o IP do next-hop será aprendido pelo protocolo de roteamento, e a rota estática continuará na tabela de roteamento.

Exemplo: Rotas estáticas configuradas para a interface + EIGRP (todas as redes)

Rotas estáticas configuradas no BrainRT01:
ip route 1.1.1.0 255.255.255.0 FastEthernet0/1
ip route 2.1.1.0 255.255.255.0 FastEthernet0/1
ip route 3.1.1.0 255.255.255.0 FastEthernet0/1
ip route 4.1.1.0 255.255.255.0 FastEthernet0/1

Rota estática + EIGRP

BrainRT01#sh ip route
Codes: 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

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets
S       1.1.1.0 is directly connected, FastEthernet0/1
2.0.0.0/24 is subnetted, 1 subnets
S       2.1.1.0 is directly connected, FastEthernet0/1
3.0.0.0/24 is subnetted, 1 subnets
S       3.1.1.0 is directly connected, FastEthernet0/1
4.0.0.0/24 is subnetted, 1 subnets
S       4.1.1.0 is directly connected, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
D       172.16.1.8 [90/30720] via 172.16.1.6, 00:04:14, FastEthernet0/1
[90/30720] via 172.16.1.1, 00:04:14, FastEthernet0/0
C       172.16.1.4 is directly connected, FastEthernet0/1
C       172.16.1.0 is directly connected, FastEthernet0/0
BrainRT01#

Se a interface F0/1 do BrainRT01 ficar down (dei um shutdown antes do show ip route abaixo), as rotas estáticas são removidas.

BrainRT01#sh ip route
Codes: 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

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/158720] via 172.16.1.1, 00:00:22, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
D       2.1.1.0 [90/158720] via 172.16.1.1, 00:00:22, FastEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
D       3.1.1.0 [90/158720] via 172.16.1.1, 00:00:22, FastEthernet0/0
4.0.0.0/24 is subnetted, 1 subnets
D       4.1.1.0 [90/158720] via 172.16.1.1, 00:00:22, FastEthernet0/0
172.16.0.0/30 is subnetted, 3 subnets
D       172.16.1.8 [90/30720] via 172.16.1.1, 00:00:22, FastEthernet0/0
D       172.16.1.4 [90/33280] via 172.16.1.1, 00:00:22, FastEthernet0/0
C       172.16.1.0 is directly connected, FastEthernet0/0
BrainRT01#

Agora, se as rotas estáticas forem configuradas com o IP do next-hop, mesmo que a interface F0/1 do BrainRT01 fique down, eles permanecerão na tabela de roteamento.

Rotas estáticas configuradas no BrainRT01:
ip route 1.1.1.0 255.255.255.0 172.16.1.6
ip route 2.1.1.0 255.255.255.0 172.16.1.6
ip route 3.1.1.0 255.255.255.0 172.16.1.6
ip route 4.1.1.0 255.255.255.0 172.16.1.6

BrainRT01#sh ip route
Codes: 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

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets
S       1.1.1.0 [1/0] via 172.16.1.6
2.0.0.0/24 is subnetted, 1 subnets
S       2.1.1.0 [1/0] via 172.16.1.6
3.0.0.0/24 is subnetted, 1 subnets
S       3.1.1.0 [1/0] via 172.16.1.6
4.0.0.0/24 is subnetted, 1 subnets
S       4.1.1.0 [1/0] via 172.16.1.6
172.16.0.0/30 is subnetted, 3 subnets
D       172.16.1.8 [90/30720] via 172.16.1.6, 00:00:25, FastEthernet0/1
[90/30720] via 172.16.1.1, 00:00:25, FastEthernet0/0
C       172.16.1.4 is directly connected, FastEthernet0/1
C       172.16.1.0 is directly connected, FastEthernet0/0
BrainRT01#

Observe abaixo, que mesmo com a interface F0/1 desativada, as rotas permaneceram na tabela de roteamento.

BrainRT01#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
BrainRT01(config)#int f0/1
BrainRT01(config-if)#shutdown
BrainRT01(config-if)#end
BrainRT01#show ip route
Codes: 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

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets
S       1.1.1.0 [1/0] via 172.16.1.6
2.0.0.0/24 is subnetted, 1 subnets
S       2.1.1.0 [1/0] via 172.16.1.6
3.0.0.0/24 is subnetted, 1 subnets
S       3.1.1.0 [1/0] via 172.16.1.6
4.0.0.0/24 is subnetted, 1 subnets
S       4.1.1.0 [1/0] via 172.16.1.6
172.16.0.0/30 is subnetted, 3 subnets
D       172.16.1.8 [90/30720] via 172.16.1.1, 00:00:06, FastEthernet0/0
D       172.16.1.4 [90/33280] via 172.16.1.1, 00:00:06, FastEthernet0/0
C       172.16.1.0 is directly connected, FastEthernet0/0
BrainRT01#

Para finalizar, lembre-se que podemos configurar a rota apontando ambos, a interface de saída e o IP do next-hop.

ip route 1.1.1.0 255.255.255.0 FastEthernet0/0 172.16.1.6

Neste caso não temos problema com o proxy-ARP/excesso de broadcast e mesmo que a interface fique down, a rota passa a utilizar o IP do next-hop (desde que seja possível chegar a ele, claro).

Ufa! Até a próxima.

About Us

Luckily friends do ashamed to do suppose. Tried meant mr smile so. Exquisite behaviour as to middleton perfectly. Chicken no wishing waiting am. Say concerns dwelling graceful.

Services

Most Recent Posts

  • All Post
  • Branding
  • Certificação
  • Cisco
  • Cloud
  • Configuração
  • Configuração Básica
  • Development
  • Geral
  • Informação
  • Leadership
  • Linux
  • Management
  • Microsoft
  • Network
  • Security
  • UC
  • Virtualização
  • Wireless

Company Info

She wholly fat who window extent either formal. Removing welcomed.

Your Business Potential with Our Proven Strategies

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Company

About Us

Contact Us

Products

Services

Blog

Features

Analytics

Engagement

Builder

Publisher

Help

Privacy Policy

Terms

Conditions

Product

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
You have been successfully Subscribed! Ops! Something went wrong, please try again.
© 2023 Created with Royal Elementor Addons