REDES DE COMUNICACIONES
Tema 7. Rutas Estáticas con
IPv4
Alberto Arellano A. Ing. Msc.
[email protected] CCNA – CCNP - CCSP
Router Functions
• Routers connect multiple networks.
• Routers typically have multiple interfaces, each on a different IP
network.
Best Path
Decision
The primary responsibility of a router is :
Determine the best path to send packets
Forward packets toward their destination
Best Path
Decision
192.168.1.10/24
Source Destination
192.168.1.10 192.168.3.22
192.168.3.22/24
192.168.2.0/24
192.168.1.0/24 192.168.3.0/24
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Serial0/0/0
S 192.168.3.0/24 [1/0] via 192.168.2.2
S 192.168.1.0/24 [1/0] via 192.168.2.1
C 192.168.2.0/24 is directly connected, Serial0/0/0
C 192.168.3.0/24 is directly connected, FastEthernet0/0
Routers use routing tables to determine the best path to send packets.
Routers encapsulate the packet (in the proper layer 2 frame – Ethernet,
PPP, Frame Relay, HDLC) and forward it to the interface indicated in
routing table.
Best Path
Decision
Routing tables can be populated with network learned via:
Directly connected networks
Manually with static routes
Dynamically with routing protocols
Best Path Decisions
The router uses its routing table to determine the best
path to forward the packet.
When the router receives a packet, it examines its
destination IP address and searches for the best
network address match in the routing table.
The routing table entries also includes the interface
to be used to forward the packet.
Once a match is found, the router encapsulates the
IP packet into the data link frame of the outgoing or
exit interface.
The packet is then forwarded toward its destination.
Static Routing
Static Routing is a routing mechanism that is handled by
the Internet Protocol (IP) and that depends on manually
configured routing tables.
Static Routing
Features
More secure since they are not advertised over the network.
More efficient since they use less bandwidth than dynamic routing
protocols.
No CPU cycles are used to calculate and communicate routes.
Predictable as the path a static route uses to send data always the
Static Routing
Disadvantages
Initial configuration and
maintenance is time-
consuming.
Configuration is error-
prone, especially in large
networks.
Administrator
intervention is required
to maintain changing
route information.
Does not scale well with
growing networks;
maintenance becomes
cumbersome.
Requires complete
knowledge of the whole
network for proper
implementation.
Static Routing Versus
Dynamic Routing
Dynamic Routing Static Routing
Configuration Generally independent of the
Increases with network size
Complexity network size
Topology Automatically adapts to topology
Administraion intervention required
Changes changes
Suitable for simple and complex
Scaling Suitable for simple topologies
topologies
Security Less secure More seure
Resource Uses CPU, memory, and link
No extra resources required
Usage bandwidth
Route depends on the current Route to destination is always the
Predictability
topology same
When to Use Static Routes
In small networks that are not expected to grow significantly.
To route traffic to and from stub networks.
A stub network is a network
accessed by a single route.
A stub router has only one
upstream neighbor.
11
Components of Static
Routes
Destination IP network
Netmask
Next hop address
Components of Static
Routes
Router Network ID Netmask Next Hop
R1 192.168.12.0 255.255.255. 192.168.1.2
0
192.168.15.0 255.255.255. 192.168.2.2
0
R2 192.168.10.0 255.255.255. 192.168.1.1
0
192.168.15.0 255.255.255. 192.168.1.1
0
R3 192.168.10.0 255.255.255. 192.168.2.1
Types of Static
Routes
There are the following types of static routes
in IPv4 and IPv6
Standard static route
Default static route
Summary static route
Floating static route
Router(config)# ip route network_id netmask next-hop
Standard Static
Route
Standard static routes are useful when connecting
to a specific remote network.
.2
No need to use a dynamic
.1 routing protocol with R1 to
reach 172.16.3.0/24.
I can simply use a static
route to reach the stub
network.
Static Route - Example
Static Route - Example
Default Static Route
A default static route is a “catch-all” route that matches all
networks that is not in the routing table.
It is configured with a 0.0.0.0/0 “quad zero” destination
address.
It creates a “Gateway of Last Resort” in the routing table
Using when no other routes in the routing table match the
packet destination IP address.
In other words, when a “more specific” match does not
exist.
A common use is when connecting a company's
edge router to the ISP network.
When a stub router connects to only one upstream router.
Default Static Route Example
All I need to know about are my
directly connected networks. For all
other networks, I can use a default Default static routes are also
static route going to R2. commonly used with edge
routers to connect to an ISP.
.2
.1
Default Static Route
Example
RouterB(config)# ip route 0.0.0.0 0.0.0.0 172.16.2.2
RouterA(config)# ip route 10.0.0.0 255.255.255.0 172.16.2.1
Summary Static
Route I have four static routes to reach
the remote networks 172.20.0.0/16
- 172.23.0.0/16.
172.21.0.0/16
10.0.0.0/24
172.20.0.0/16
.2 R1
172.22.0.0/16
172.23.0.0/16
Used to reduce the number of routing table entries.
Multiple static routes can be summarized into a single static
route if:
The destination networks are contiguous and can be
summarized into a single network address.
The destination networks are all reachable using the
same exit interface or next-hop IP address.
Summary Static Route
Example
R1
Router(config)# ip route 172.20.0.0 255.248.0.0 192.168.1.2
Floating Static Route
Private WAN
172.16.1.0 /30
172.16.1.0 /30
S0/0/0 S0/0/0
.2 .1
10.0.0.0 /8
Branch UIO
S0/0/1 S0/0/1
.242 .226
209.165.200.240 /29 Internet 209.165.200.224 /29
.241 .225
ISP
Floating static routes are static routes used to provide a backup
path to a primary static or dynamic route, in the event of a link
failure.
The floating static route is only used when the primary route
is not available.
Floating Static Route
Private WAN
172.16.1.0 /30
172.16.1.0 /30
S0/0/0 S0/0/0
.2 .1
10.0.0.0 /8
Branch HQ
S0/0/1 S0/0/1
.242 .226
209.165.200.240 /29 Internet 209.165.200.224 /29
.241 .225
ISP
Accomplished by configuring the static route with a higher administrative
distance than the primary route.
Administrative distance represents the trustworthiness of a route.
If multiple paths to the destination exist, the router will choose the
path with the lowest administrative distance o preference.
Administrative Distance or
Preference
Administrative distance (AD) is a number of arbitrary
unit assigned to dynamic routes, static routes and directly-
connected routes. The value is used by vendor-specific routers to
rank routes from most preferred (low administrative distance
value) to least preferred (high administrative distance value)
Default Administrative
Distance
Floating Routes Example
R1(config)# ip route 192.168.2.0 255.255.255.0 10.10.10.2
R1(config)# ip route 192.168.2.0 255.255.255.0 172.16.2.2 5
Lab 1 – Static
Routes
R1 Config – IP
Address
enable
configure terminal
hostname R1
int gi0/0/0
description ConexionLAN
ip add 192.168.10.1 255.255.255.0
no shutdown
exit
int gi0/0/1
description Conexión-R3
ip add 192.168.2.1 255.255.255.0
no shutdown
exit
R1 Config – IP
Address
int gi0/0/2
description ConexionFibraOptica
ip add 192.168.1.1 255.255.255.0
no shutdown
exit
R2 Config – IP
Address
enable
configure terminal
hostname R2
int gi0/0/0
description ConexionLAN
ip add 192.168.12.1 255.255.255.0
no shutdown
exit
int gi0/0/2
description ConexiónFibraOptica
ip add 192.168.1.2 255.255.255.0
no shutdown
exit
R3 Config – IP
Address
enable
configure terminal
hostname R1
int gi0/0/0
description ConexionLAN
ip add 192.168.15.1 255.255.255.0
no shutdown
exit
int gi0/0/1
description Conexión-R1
ip add 192.168.2.2 255.255.255.0
no shutdown
exit
Configure Static Route on
R1,R2 & R3
R1
ip route 192.168.12.0 255.255.255.0 192.168.1.2
ip route 192.168.15.0 255.255.255.0 192.168.2.2
R2
ip route 192.168.10.0 255.255.255.0 192.168.1.1
ip route 192.168.15.0 255.255.255.0 192.168.1.1
R3
ip route 192.168.10.0 255.255.255.0 192.168.2.1
ip route 192.168.12.0 255.255.255.0 192.168.2.1
WAN Connections
• Cable Modem (38 Mbps)
• DSL (9 Mbps)
• Serial (54 Mbps)
• HDLC or PPP
• Frame Relay
Lab 2 Static Routes – Cable
Modem
WAN Connections – Cable
Modem
R1 Config – IP
Address
enable
configure terminal
hostname R1
int gi0/0/0
description ConexionFibraOptica
ip add 192.168.1.3 255.255.255.0
no shutdown
exit
int gi0/0
ip add 192.168.11.1 255.255.255.0
no shutdown
exit
R2 Config – IP
Address
enable
configure terminal
hostname R2
int gi0/0
description ConexionCableModem
ip add 192.168.1.1 255.255.255.0
no shutdown
exit
int gi0/1
ip add 192.168.10.1 255.255.255.0
no shutdown
exit
R3 Config – IP
Address
enable
configure terminal
hostname R3
int gi0/0
description ConexionCableModem
ip add 192.168.1.2 255.255.255.0
no shutdown
exit
int gi0/0
ip add 192.168.12.1 255.255.255.0
no shutdown
exit
Display IP Address
Configure Static Route on
R1,R2 & R3
R1
ip route 192.168.10.0 255.255.255.0 192.168.1.1
ip route 192.168.12.0 255.255.255.0 192.168.1.2
R2
ip route 192.168.11.0 255.255.255.0 192.168.1.3
ip route 192.168.12.0 255.255.255.0 192.168.1.3
R3
ip route 192.168.10.0 255.255.255.0 192.168.1.3
ip route 192.168.11.0 255.255.255.0 192.168.1.3
Display Routing
Table
PC2 – Ping to PC1 & PC3
WAN Connections HDLC& PPP
• HDLC&PPP are protocols of the data link layer of the OSI
model that are used in WAN connections point to point.
WAN Connections HDLC& PPP
WAN Connections HDLC& PPP
WAN Connections HDLC&
PPP
WAN Connections
Frame Relay
Frame Relay is a protocol standard of data link layer, for WAN
internetworking which provides a fast and efficient method of
transmitting packets through the network.
• traffic between users is transmitted through permanent virtual
circuits (PVC).
• PVCs are identified by a DLCI that can be between 16 to 1007.
• Control of communication between the frame relay cloud and
routers is performed by a protocol called LMI (cisco, ansi, q933).
SPOKE-1
HUB
SPOKE-2
WAN Connections
Frame Relay
Int IN DLCI Int OUT DLCI IPv4 Add
Ser0 102 Ser1 201 192.168.1.0/24
Ser0 103 Ser2 301 192.168.2.0/24
Ser1 203 Ser2 301 192.168.3.0/24
Cloud
Frame Relay
1. Configure DLCI on Serial 0
Cloud
Frame Relay
2. Configure DLCI on Serial 1
Cloud
Frame Relay
3. Configure DLCI on Serial 2
Cloud
Frame Relay
4. Configure Mapping of connections Frame Relay
Frame Relay
Routers
5. Configure R1
Frame Relay
Routers
6. Configure R2
Frame Relay
Routers
7. Configure R3