¿Qué hace R1 con el paquete enviado desde la PC1 hacia la PC3?
R1# show ip route connected
C [Link]/24 is directly connected, Serial0/0/0
C [Link]/24 is directly connected, GigabitEthernet0/0
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Enrutamiento estático
Docente: Marco Trujillo Silva
mtrujillos@[Link]
Curso: Redes de comunicaciones II
Ingeniería Electrónica
Objetivos
• Explicar cómo se implementan las rutas estáticas
en las redes de las Pymes.
• Configurar rutas estáticas para permitir la
conectividad en la red de una Pyme.
• Explicar cómo un enrutador procesa los paquetes
cuando se configura una ruta estática.
Types of static routes
Standard Static Route
• Standard static routes are useful when connecting to a
specific remote network.
R2(config)# ip route [Link] [Link] [Link]
.2
.1 I need to reach the LAN of R1
[Link]/24.
I can simply use a static route
to reach the stub network.
5 © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Default Static Route Example
All I need to know about are my directly
connected networks. For all other
networks, I can use a default static route
Default static routes are also
going to R2. commonly used with edge
routers to connect to an ISP.
.2
.1
R1(config)# ip route [Link] [Link] [Link]
6 © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Summary Static Route
I have four static routes to reach the
remote networks [Link]/16 -
[Link]/16.
[Link]/16
[Link]/24
[Link]/16
R1
.2
[Link]/16
[Link]/16
R1(config)# ip route [Link] [Link] [Link]
R1(config)# ip route [Link] [Link] [Link]
R1(config)# ip route [Link] [Link] [Link]
R1(config)# ip route [Link] [Link] [Link]
7
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Summary Static Route But to reduce the size of my routing table, I
will replace those four static routes with one
summary static route using a /14 subnet
mask
[Link]/16
[Link]/24
[Link]/16
.2 R1
[Link]/16
[Link]/16
R1(config)# no ip route [Link] [Link] [Link]
R1(config)# no ip route [Link] [Link] [Link]
R1(config)# no ip route [Link] [Link] [Link]
R1(config)# no ip route [Link] [Link] [Link]
R1(config)#
R1(config)# ip route [Link] [Link] [Link]
8
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Floating Static Route
I can reach the HQ router
[Link]/8 LAN using the
private WAN link.
Private WAN
[Link] /30
[Link] /30
S0/0/0 S0/0/0
.2 .1
[Link] /8
Branch HQ
S0/0/1 S0/0/1
.242 .226
[Link] /29 Internet [Link] /29
.241 .225
ISP
9
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Floating Static Route
However, if that link ever fails, I will use
a floating static route connecting to the
Internet as a backup.
Private WAN
[Link] /30
[Link] /30
S0/0/0 S0/0/0
.2 .1
[Link] /8
Branch HQ
S0/0/1 S0/0/1
.242 .226
[Link] /29 Internet [Link] /29
.241 .225
ISP
10
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configuring standard static
routes
Topology
• We will assume all the interface have been configured
with an IPv4 address and are in the up/up state.
12 © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configure Next Hop Static Routes on R1
R1(config)# ip route [Link] [Link] [Link]
R1(config)# ip route [Link] [Link] [Link]
R1(config)# ip route [Link] [Link] [Link]
R1(config)#
Notice: R1 uses the same next-hop IPv4 address for all static routes.
13
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Next Hop might be a Recursive Static Route
A recursive lookup means:
Only recursive if 1. A network in the routing table
CEF is disabled looks for a match with the packet’s
destination IP address.
2. The next-hop address is looked up
in the routing table to find an exit-
interface.
R1# show ip route | begin Gateway
Gateway of last resort is not set
[Link]/16 is variably subnetted, 5 subnets, 2 masks
S [Link]/24 [1/0] via [Link] Only if CEF disabled
2 C [Link]/24 is directly connected, Serial0/0/0
L [Link]/32 is directly connected, Serial0/0/0
C [Link]/24 is directly connected, GigabitEthernet0/0
L [Link]/32 is directly connected, GigabitEthernet0/0
S [Link]/24 [1/0] via [Link]
1
14 S [Link]/24 [1/0] via [Link]
R1# © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configure Directly attached Static Routes
R1(config)# ip route [Link] [Link] s0/0/0
R1(config)# ip route [Link] [Link] s0/0/0
R1(config)# ip route [Link] [Link] s0/0/0
R1(config)#
• This is an alternative method for configuring static routes on a point-to-point network.
• Static routes with a next-hop address recommended when CEF is enabled.
15
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Note (covered more later):
Verify the Routing Table of R1 ▪ Although the routing table
entry indicates “directly
connected”, the
administrative distance of
the static route is still 1.
▪ Only a directly connected
interface can have an
admin. distance of 0.
R1# show ip route | begin Gateway
Gateway of last resort is not set
[Link]/16 is variably subnetted, 5 subnets, 2 masks
S [Link]/24 is directly connected, Serial0/0/0
C [Link]/24 is directly connected, Serial0/0/0
L [Link]/32 is directly connected, Serial0/0/0
C [Link]/24 is directly connected, GigabitEthernet0/0
L [Link]/32 is directly connected, GigabitEthernet0/0
S [Link]/24 is directly connected, Serial0/0/0
16 S [Link]/24 is directly connected, Serial0/0/0
R1# © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Fully Specified Static Routes on R1
R1(config)# ip route [Link] [Link] G0/1 [Link]
R1(config)# ip route [Link] [Link] G0/1 [Link]
R1(config)# ip route [Link] [Link] G0/1 [Link]
R1(config)#
▪ Required when CEF is disabled and on a multi-access network.
17
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verify the Routing Table of R1
R1# show ip route | begin Gateway
Gateway of last resort is not set
[Link]/16 is variably subnetted, 5 subnets, 2 masks
S [Link]/24 [1/0] via [Link], Gigabitethernet0/1
C [Link]/24 is directly connected, Gigabitethernet0/1
L [Link]/32 is directly connected, Gigabitethernet0/1
C [Link]/24 is directly connected, GigabitEthernet0/0
L [Link]/32 is directly connected, GigabitEthernet0/0
S [Link]/24 [1/0] via [Link], Gigabitethernet0/1
18 S [Link]/24 [1/0] via [Link], Gigabitethernet0/1
R1# © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configuring a Default Static Route
R1(config)# ip route [Link] [Link] [Link]
R1(config)#
⚫ Commonly used in every network to have at least one route to send
packets when the destination IP address doesn’t match a more
specific route in the routing table.
⚫ If a default route is not used and there is not a match in the routing
table, then the packet is dropped.
19
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verifying the Routing Table of R1
R1# show ip route static
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
+ - replicated route, % - next hop override
Gateway of last resort is [Link] to network [Link]
S* [Link]/0 is via [Link]
20
R1#
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configuring IPv6 Static
Routes
Configuring an IPv6 Static Route
Router(config)# ipv6 route ipv6-prefix/prefix-length {exit-
intf | ipv6-address}
Parameter Description
ipv6- • Destination IPv6 network address of the remote network to be added
prefix to the routing table.
/prefix- • Prefix length of the remote network to be added to the routing table.
length • Note: Can be modified to summarize a group of networks
• Use the outgoing interface to forward packets to the destination
exit-intf
network.
ipv6-
• Commonly referred to as the next-hop router’s IPv6 address.
address
22 © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configure Next Hop Static IPv6 Routes
R1(config)# ipv6 route [Link]/64 [Link]
R1(config)# ipv6 route [Link]/64 [Link]
R1(config)# ipv6 route [Link]/64 [Link]
R1(config)#
23
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Directly Attached Static IPv6 Routes on R1
R1(config)# ipv6 route [Link]/64 s0/0/0
R1(config)# ipv6 route [Link]/64 s0/0/0
R1(config)# ipv6 route [Link]/64 s0/0/0
R1(config)#
• This is an alternative method for configuring static routes on a point-to-point network.
24 • Next-hop address recommended when CEF is enabled.
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verify the Routing Table of R1
R1# show ipv6 route
<Output omitted>
C [Link]/64 [0/0]
via GigabitEthernet0/0, directly connected
L [Link]/128 [0/0]
via GigabitEthernet0/0, receive
S [Link]/64 [1/0]
via Serial0/0/0, directly connected
S [Link]/64 [1/0]
via Serial0/0/0, directly connected
C [Link]/64 [0/0]
via Serial0/0/0, directly connected
L [Link]/128 [0/0]
via Serial0/0/0, receive
S [Link]/64 [1/0]
via Serial0/0/0, directly connected
L FF00::/8 [0/0]
via Null0, receive
R1#
25
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Exit-interface required when link-local
address is used as next-hop address
R1(config)# ipv6 route [Link]/64 fe80::2
% Interface has to be specified for a link-local nexthop
R1(config)# ipv6 route [Link]/64 s0/0/0 fe80::2
R1(config)#
26 © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verify the Static Route on R1
R1(config)# ipv6 route [Link]/64 s0/0/0 fe80::2
R1(config)# end
R1#show ipv6 route static | begin [Link]/64
S [Link]/64 [1/0]
via FE80::2, Serial0/0/0
27
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configuring a Default Static IPv6 Route
R1(config)# ipv6 route ::/0 [Link]
R1(config)#
28
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verifying the Routing Table of R1
R1# show ipv6 route static
IPv6 Routing Table - default - 6 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user
Static route
<Output omitted>
S ::/0 [1/0]
via [Link]
29 R1#
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verifying Connectivity to the R3 LAN
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 = 28/28/28
ms
R1#
30
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configuring Floating Static
Routes
Floating Static Route
I can reach the HQ router
[Link]/8 LAN using the
private WAN link.
Private WAN
[Link] /30
[Link] /30
S0/0/0 S0/0/0
.2 .1
[Link] /8
Branch HQ
S0/0/1 S0/0/1
.242 .226
[Link] /29 Internet [Link] /29
.241 .225
ISP
32
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Floating Static Route
However, if that link ever fails, I will use
a floating static route connecting to the
Internet as a backup.
Private WAN
[Link] /30
[Link] /30
S0/0/0 S0/0/0
.2 .1
[Link] /8
Branch HQ
S0/0/1 S0/0/1
.242 .226
[Link] /29 Internet [Link] /29
.241 .225
ISP
33
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configuring a Floating Static Route to R3
Backup
R1(config)# ip route [Link] [Link] [Link]
R1(config)# ip route [Link] [Link] [Link] 5
R1(config)#
34
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verifying the Routing Table of R1
Only the primary (best) route is in
the routing table.
The backup route with the higher
administrative distance is not in
the routing table.
Backup
R1# show ip route static | begin Gateway
Gateway of last resort is [Link] to network [Link]
S* [Link]/0 [1/0] via [Link]
R1#
35
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verify the Path to the R3 LAN
R1# traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 4 msec 4 msec 8 msec
2 [Link] 12 msec * 12 msec
36 R1#
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Simulate a Router Failure on R2
X X
R2(config)# int s0/0/0
R2(config-if)# shutdown
*Feb 21 [Link].939: %LINK-5-CHANGED: Interface Serial0/0/0, changed state to administratively
down
*Feb 21 [Link].939: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state
to down
R2(config-if)# int s0/0/1
R2(config-if)# shutdown
R2(config-if)#
*Feb 21 [Link].543: %LINK-5-CHANGED: Interface Serial0/0/1, changed state to administratively
down
37 *Feb 21 [Link].543: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state
to down © 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verify the Default Route on R1
X X
Primary
R1# show ip route static | begin Gateway
Gateway of last resort is [Link] to network
[Link]
S* [Link]/0 [5/0] via [Link]
38 R1#
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Verify the Path to the R3 LAN
If the links come back up, the
backup route is removed and the
primary route with the lower default
administrative distance of 1 is
reinstalled into the routing table.
X X
R1# traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
39 1 [Link] 4 msec 4 msec *
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Configurar Rutas de Host Estáticas
Rutas de Host
Una ruta de host es una dirección IPv4 con una máscara de 32 bits o una dirección IPv6 con una
máscara de 128 bits. A continuación, se muestra tres maneras de agregar una ruta de host a una
tabla de routing:
• Instalarla automáticamente cuando se configura una dirección IP en el router.
• Configurarla como una ruta de host estático.
Configurar Rutas de Host Estáticas
Rutas de Host Instaladas Automáticamente
• El IOS de Cisco instala automáticamente una ruta de host, también conocida como ruta de
host local, cuando se configura una dirección de interfaz en el router. Una ruta host permite
un proceso más eficiente para los paquetes que se dirigen al router mismo, en lugar del envío
de paquetes.
• Esto se suma a la ruta conectada, designada con una C en la tabla de enrutamiento para la
dirección de red de la interfaz.
• Las rutas locales se marcan con L en el resultado de la tabla de enrutamiento.
Configurar Rutas de Host Estáticas
Rutas Estaticas de Host
Una ruta de host puede ser una ruta estática configurada manualmente para dirigir el tráfico a un
dispositivo de destino específico, como un servidor de autenticación. La ruta estática utiliza una
dirección IP de destino y una máscara [Link] (/32) para las rutas de host IPv4 y una
longitud de prefijo /128 para las rutas de host IPv6.
El ejemplo muestra la configuración de la ruta de host estática IPv4 e IPv6 en el router Branch para
acceder al servidor.
Branch(config)# ip route [Link] [Link] [Link]
Branch(config)# ipv6 route [Link]/128 [Link]
Configurar rutas de host estáticas
Verificar rutas de host estáticas
Una revisión de las tablas de rutas IPv4 e IPv6 verifica que las rutas estén activas.
Configurar rutas de host estáticas
Configurar ruta de host estática IPv6 con Link-Local de siguiente salto
Para rutas estáticas IPv6, la dirección del siguiente salto puede ser la dirección link-local del router
adyacente. Sin embargo, debe especificar un tipo de interfaz y un número de interfaz cuando usa
una dirección link-local como siguiente salto, como se muestra en el ejemplo. En primer lugar, se
elimina la ruta de host estática IPv6 original y, a continuación, se configura una ruta
completamente especificada con la dirección IPv6 del servidor y la dirección local del vínculo IPv6
del enrutador ISP.
Actividad: Construye la topología de la red
Para complementar la información de clase y reforzar el
conocimiento adquirido, se solicita elaborar la topología de
red a partir de las tablas de enrutamiento mostradas
#show ip route
C [Link] _________, Ethernet0
C [Link] _________, Ethernet1
S [Link] [1/1] via [Link], [Link], Serial0
[1/1] via [Link], [Link], Serial1
C 191.108.16.0________, Serial0
C 192.108.16.0________, Serial1
S [Link] [1/1] via [Link], [Link], Serial0
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
Preguntas
© 2016 Cisco y/o sus filiales. Todos los derechos reservados. Información confidencial de Cisco.
CIERRE
¿Qué aprendí en este módulo?
• Un host envía un paquete a otro host y lo envía a la dirección de puerta de enlace predeterminada.
• Cuando el paquete llega a una interfaz del router, des-encapsulará el paquete y buscará en la tabla de
enrutamiento una entrada de red de destino que coincida.
• Si la dirección IP de destino:
• Coincide con una entrada de ruta estática, el router usará la ruta estática para identificar
la dirección IP de salto siguiente o la interfaz de salida.
• No coincide con una ruta específica a la red de destino, entonces el router utilizará la
ruta estática predeterminada (si está configurada).
• No coincide con una entrada de la tabla de rutas, entonces el router descartará el
paquete y enviará un mensaje ICMP de vuelta al origen.
• Si el router coincide con una entrada de tabla de enrutamiento, entonces el router encapsula el
paquete y lo reenvía fuera de la interfaz adecuada.
• El paquete se reenvía de router a router hasta que llega a su red de destino.
CIERRE
¿Qué aprendió en este módulo? (Cont.)
• Cuando el paquete llegue a la red de destino, ese router buscará una coincidencia en la tabla de
enrutamiento.
• Cuando la dirección IP de destino coincide con una interfaz Ethernet conectada directamente, el
router busca en la tabla ARP la dirección MAC de Capa 2 de la dirección IP de destino.
• Si no existe ninguna entrada ARP, el router envía una solicitud ARP fuera de la interfaz Ethernet
• El host de destino responde con una respuesta ARP que contiene su dirección MAC.
• El router encapsula el paquete en una nueva trama. Utiliza la dirección MAC del host de destino como
dirección MAC de destino de la trama y la dirección MAC de la interfaz Ethernet del router como
dirección MAC de origen en la trama.
• La trama se reenvía a través de la interfaz apropiada.
• El paquete llega a la interfaz de la tarjeta de interfaz de red (NIC) de dispositivo destino y es
procesado.