Adicionando rotas dinâmicas


Essa página aborta o básico / mínimo para configurar os seguintes protocolos de roteamento dinâmico:

  • RIP
  • EIGRP
  • OSPF

Global

Basicamente todo protocolo de roteamento possui o mesmo princípio, através das redes diretamente conectadas e das informações trocadas (enviadas / recebidas) atingir a convergência total. Convergência é o termo usado para dizer que todos os roteadores possuem conhecimento (tabela de roteamento completa) para enviar/encaminhar pacotes para todos da rede (todos que deveriam enviar/receber).

Portanto essa afirmação deixa claro que tudo irá começar pelas rotas diretamente conectadas (tipo C). A maneira como a conversa com os outros roteadores é feita não será abordada nessa página, pois essa possui a intenção de demonstrar apenas o básico para fazer o protocolo de roteamento subir, para maiores informações clique no link do protocolo de roteamento desejado.

Para todos os exemplos abaixo será utilizada as seguintes configurações:

Topologia

Software Utilizado

  • GNS3-0.8.4-RC2

Hardware Utilizado

  • 2 Roteadores Cisco 2600 (Simulado no GNS3) IOS: c2600-is-mz.122-8.T4.bin

Conexões e Endereçamento

R1

  • Serial: 213.0.0.1/24
  • Loopback 1: 192.168.10.1/24

R2

  • Serial: 213.0.0.2/24
  • Loopback 2: 192.168.20.1/24

RIP

R1

R1#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R1#! Criado por RagazziD.com.br
R1#! Acesse ragazzid.com.br
R1#! Acesse blog.ragazzid.com.br
R1#! Acesso estudo.ragazzid.com.br
R1#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R1#enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#hostname R1
R1(config)#interface serial 0/0
R1(config-if)#ip address 213.0.0.1 255.255.255.0
R1(config-if)#clock rate 4000000
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface loopback 1
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#network 213.0.0.0
R1(config-router)#network 192.168.10.0
R1(config-router)#passive-interface loopback 1
R1(config-router)#end
R1#wr
Building configuration...

00:05:21: %SYS-5-CONFIG_I: Configured from console by console[OK]
R1#
R1#! Fim

R2

R2#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R2#! Criado por RagazziD.com.br
R2#! Acesse ragazzid.com.br
R2#! Acesse blog.ragazzid.com.br
R2#! Acesso estudo.ragazzid.com.br
R2#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R2#enable
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#hostname R2
R2(config)#interface serial 0/0
R2(config-if)#ip address 213.0.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface loopback 2
R2(config-if)#ip address 192.168.20.1 255.255.255.0
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#network 213.0.0.0
R2(config-router)#network 192.168.20.0
R2(config-router)#passive-interface loopback 2
R2(config-router)#end
R2#wr
Building configuration...

00:05:27: %SYS-5-CONFIG_I: Configured from console by console[OK]
R2#
R2#! Fim

Testes

  • R1

Verificando a tabela de roteamento:

R1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

C    192.168.10.0/24 is directly connected, Loopback1
C    213.0.0.0/24 is directly connected, Serial0/0
C    192.168.20.0/24 is directly connected, Loopback2

Verificando o estado do protocolo de roteamento dinâmico

R1#show ip protocols
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 23 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial0/0             1     1 2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    192.168.10.0
    213.0.0.0
  Passive Interface(s):
    Loopback1
    Loopback2
  Routing Information Sources:
    Gateway         Distance      Last Update
    213.0.0.2            120      00:00:14
  Distance: (default is 120)

Testando a conexão com o PING (ICMP)

R1#ping 192.168.20.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
  • R2

Verificando a tabela de roteamento:

R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

R    192.168.10.0/24 [120/1] via 213.0.0.1, 00:00:02, Serial0/0
C    213.0.0.0/24 is directly connected, Serial0/0
C    192.168.20.0/24 is directly connected, Loopback2

Verificando o estado do protocolo de roteamento dinâmico

R2#sh ip protocols
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 27 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial0/0             1     1 2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    192.168.20.0
    213.0.0.0
  Passive Interface(s):
    Loopback2
  Routing Information Sources:
    Gateway         Distance      Last Update
    213.0.0.1            120      00:00:16
  Distance: (default is 120)

Testando a conexão com o PING (ICMP)

R2#ping 192.168.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/6/12 ms

Arquivos

EIGRP

R1

R1#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R1#! Criado por RagazziD.com.br
R1#! Acesse ragazzid.com.br
R1#! Acesse blog.ragazzid.com.br
R1#! Acesso estudo.ragazzid.com.br
R1#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R1#enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#hostname R1
R1(config)#interface serial 0/0
R1(config-if)#ip address 213.0.0.1 255.255.255.0
R1(config-if)#clock rate 4000000
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface loopback 1
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#exit
R1(config)#router eigrp 13
R1(config-router)#network 213.0.0.0 0.0.0.255
R1(config-router)#network 192.168.10.0 0.0.0.255
R1(config-router)#passive-interface loopback 1
R1(config-router)#end
R1#wr
Building configuration...

00:30:14: %SYS-5-CONFIG_I: Configured from console by console[OK]
R1#
R1#! Fim

R2

R2#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R2#! Criado por RagazziD.com.br
R2#! Acesse ragazzid.com.br
R2#! Acesse blog.ragazzid.com.br
R2#! Acesso estudo.ragazzid.com.br
R2#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R2#enable
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#hostname R2
R2(config)#interface serial 0/0
R2(config-if)#ip address 213.0.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface loopback 2
R2(config-if)#ip address 192.168.20.1 255.255.255.0
R2(config-if)#exit
R2(config)#router eigrp 13
R2(config-router)#network 213.0.0.0 0.0.0.255
R2(config-router)#network 192.168.20.0 0.0.0.255
R2(config-router)#passive-interface loopback 2
R2(config-router)#end
R2#wr
Building configuration...

00:30:23: %SYS-5-CONFIG_I: Configured from console by console[OK]
R2#
R2#! Fim

Testes

  • R1

Verificando a tabela de roteamento

R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

C    192.168.10.0/24 is directly connected, Loopback1
C    213.0.0.0/24 is directly connected, Serial0/0
D    192.168.20.0/24 [90/2297856] via 213.0.0.2, 00:00:34, Serial0/0

Verificando o estado do protocolo de roteamento dinâmico

R1#show ip protocols
Routing Protocol is "eigrp 13"
  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 metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 13
  Automatic network summarization is in effect
  Automatic address summarization:
    192.168.10.0/24 for Serial0/0
  Maximum path: 4
  Routing for Networks:
    192.168.10.0
    213.0.0.0
  Passive Interface(s):
    Loopback1
  Routing Information Sources:
    Gateway         Distance      Last Update
    213.0.0.2             90      00:01:07
  Distance: internal 90 external 170

Testando a conexão com o PING (ICMP)

R1#ping 192.168.20.1

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

Verificando a vizinhança do EIGRP

R1#sh ip eigrp neighbors
IP-EIGRP neighbors for process 13
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq Type
                                            (sec)         (ms)       Cnt Num
0   213.0.0.2               Se0/0             14 00:03:56    4   200  0  2

Verificando a tabela de topologia (inteira)

R1#show ip eigrp topology all-links
IP-EIGRP Topology Table for AS(13)/ID(192.168.10.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 192.168.10.0/24, 1 successors, FD is 128256, serno 1
         via Connected, Loopback1
P 192.168.20.0/24, 1 successors, FD is 2297856, serno 3
         via 213.0.0.2 (2297856/128256), Serial0/0
P 213.0.0.0/24, 1 successors, FD is 2169856, serno 2
         via Connected, Serial0/0
  • R2

Verificando a tabela de roteamento

R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

D    192.168.10.0/24 [90/2297856] via 213.0.0.1, 00:07:13, Serial0/0
C    213.0.0.0/24 is directly connected, Serial0/0
C    192.168.20.0/24 is directly connected, Loopback2

Verificando o estado do protocolo de roteamento dinâmico

R2#sh ip protocols
Routing Protocol is "eigrp 13"
  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 metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 13
  Automatic network summarization is in effect
  Automatic address summarization:
    192.168.20.0/24 for Serial0/0
  Maximum path: 4
  Routing for Networks:
    192.168.20.0
    213.0.0.0
  Passive Interface(s):
    Loopback2
  Routing Information Sources:
    Gateway         Distance      Last Update
    213.0.0.1             90      00:00:30
  Distance: internal 90 external 170

Testando a conexão com o PING (ICMP)

R2#ping 192.168.10.1

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

Verificando a vizinhança do EIGRP

R2#show ip eigrp neighbors
IP-EIGRP neighbors for process 13
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq Type
                                            (sec)         (ms)       Cnt Num
0   213.0.0.1               Se0/0             10 00:02:18 1154  5000  0  2

Verificando a tabela de topologia (inteira)

R2#show ip eigrp topology all-links
IP-EIGRP Topology Table for AS(13)/ID(192.168.20.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 192.168.10.0/24, 1 successors, FD is 2297856, serno 3
         via 213.0.0.1 (2297856/128256), Serial0/0
P 192.168.20.0/24, 1 successors, FD is 128256, serno 1
         via Connected, Loopback2
P 213.0.0.0/24, 1 successors, FD is 2169856, serno 2
         via Connected, Serial0/0

Arquivos

OSPF

R1

R1#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R1#! Criado por RagazziD.com.br
R1#! Acesse ragazzid.com.br
R1#! Acesse blog.ragazzid.com.br
R1#! Acesso estudo.ragazzid.com.br
R1#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R1#enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#hostname R1
R1(config)#interface serial 0/0
R1(config-if)#ip address 213.0.0.1 255.255.255.0
R1(config-if)#clock rate 4000000
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface loopback 1
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#exit
R1(config)#router ospf 13
R1(config-router)#network 213.0.0.0 0.0.0.255 area 0
R1(config-router)#network 192.168.10.0 0.0.0.255 area 0
R1(config-router)#passive-interface loopback 1
R1(config-router)#end
R1#wr
Building configuration...

00:46:04: %SYS-5-CONFIG_I: Configured from console by console[OK]
R1#
R1#! Fim

R2

R2#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R2#! Criado por RagazziD.com.br
R2#! Acesse ragazzid.com.br
R2#! Acesse blog.ragazzid.com.br
R2#! Acesso estudo.ragazzid.com.br
R2#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
R2#enable
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#hostname R2
R2(config)#interface serial 0/0
R2(config-if)#ip address 213.0.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface loopback 2
R2(config-if)#ip address 192.168.20.1 255.255.255.0
R2(config-if)#exit
R2(config)#router ospf 47
R2(config-router)#network 213.0.0.0 0.0.0.255 area 0
R2(config-router)#network 192.168.20.0 0.0.0.255 area 0
R2(config-router)#passive-interface loopback 2
R2(config-router)#end
R2#wr
Building configuration...

00:46:04: %SYS-5-CONFIG_I: Configured from console by console
00:46:05: %SYS-5-CONFIG_I: Configured from console by console
00:46:08: %OSPF-5-ADJCHG: Process 47, Nbr 192.168.10.1 on Serial0/0 from LOADING to FULL, Loading Done[OK]
R2#
R2#! Fim

Testes

  • R1

Verificando a tabela de roteamento

R1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

C    192.168.10.0/24 is directly connected, Loopback1
C    213.0.0.0/24 is directly connected, Serial0/0
     192.168.20.0/32 is subnetted, 1 subnets
O       192.168.20.1 [110/65] via 213.0.0.2, 00:00:34, Serial0/0

Verificando o estado do protocolo de roteamento dinâmico

Routing Protocol is "ospf 13"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.10.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.10.0 0.0.0.255 area 0
    213.0.0.0 0.0.0.255 area 0
  Passive Interface(s):
    Loopback1
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.10.1         110      00:00:55
    192.168.20.1         110      00:00:55
  Distance: (default is 110)

Verificando o OSPF database

R1#show ip ospf database

            OSPF Router with ID (192.168.10.1) (Process ID 13)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.10.1    192.168.10.1    83          0x80000002 0xB059   3
192.168.20.1    192.168.20.1    79          0x80000002 0x9D57   3

Testando a conexão com o PING (ICMP)

R1#ping 192.168.20.1

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

Verificando a tabela de roteamento

R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     192.168.10.0/32 is subnetted, 1 subnets
O       192.168.10.1 [110/65] via 213.0.0.1, 00:01:38, Serial0/0
C    213.0.0.0/24 is directly connected, Serial0/0
C    192.168.20.0/24 is directly connected, Loopback2

Verificando o estado do protocolo de roteamento dinâmico

R2#sh ip protocols
Routing Protocol is "ospf 47"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.20.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.20.0 0.0.0.255 area 0
    213.0.0.0 0.0.0.255 area 0
  Passive Interface(s):
    Loopback2
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.10.1         110      00:01:47
    192.168.20.1         110      00:01:47
  Distance: (default is 110)

Verificando o OSPF database

R2#show ip ospf database

            OSPF Router with ID (192.168.20.1) (Process ID 47)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.10.1    192.168.10.1    138         0x80000002 0xB059   3
192.168.20.1    192.168.20.1    134         0x80000002 0x9D57   3

Testando a conexão com o PING (ICMP)

R2#ping 192.168.10.1

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

Arquivos

Category:Roteamento Category:Rotas Category:Cisco Category:Redes Category:Firewall Category:Roteador