ccna r&s-20-configuring ipv4 addresses and routes

67

Click here to load reader

Upload: amir-jafari

Post on 08-Jan-2017

2.028 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: CCNA R&S-20-Configuring IPv4 Addresses and Routes

©2015 Amir Jafari – www.amir-Jafari.com

Routing and Switching 200-120 20 - Configuring IPv4 Addresses and Routes

Page 2: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring IPv4 Addresses and Routes

©2015 Amir Jafari – www.amir-Jafari.com

Agenda

IP Routing Configuring Connected Routes Configuring Static Routes

Page 3: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IP Routing

Routers route IPv4 packets For routers to route packets, routers follow a routing process That routing process relies on information called IP routes Each IP route lists a destination—an IP network, IP subnet, or some other group of IP addresses Each route also lists instructions that tell the router where to forward packets sent to addresses in that IP network or subnet

Page 4: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IP Routing Routers use three methods to add IPv4 routes to their IPv4 routing tables: 1. Routers first learn connected routes, which are routes for subnets attached to a router

interface

2. Routers can also use static routes, which are routes created through a configuration command (ip route) that tells the router what route to put in the IPv4 routing table

3. Routers can use a routing protocol, in which routers tell each other about all their known routes, so that all routers can learn and build routes to all networks and subnets

Page 5: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IP Routing

The process requires Layer 3 logic on the routers as well, by which the routers compare the destination address in the packet to their routing tables, to decide where to forward the IP packet next The routing process also relies on data link and physical details at each link These lower-layer devices and protocols move the IP packets around the TCP/IP network by encapsulating and transmitting the packets inside data link layer frames The term “IP routing” refers to the packet-forwarding process only

Page 6: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Process Reference Based on its own opinion of the range of addresses in the local subnet, a LAN-based host acts as follows: Step 1. If the destination is local, send directly:

A. Find the destination host’s MAC address. Use the already-known Address Resolution Protocol (ARP) table entry, or use ARP messages to learn the information B. Encapsulate the IP packet in a data link frame, with the destination data link address of the destination host

Step 2. If the destination is not local, send to the default gateway: A. Find the default gateway’s MAC address. Use the already-known ARP table entry, or use ARP messages to learn the information B. Encapsulate the IP packet in a data link frame, with the destination data link address of the default gateway

Page 7: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Process Reference

Host Routing Logic Summary

Page 8: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Process Reference Routers have a little more routing work to do as compared with hosts. The five-step summary of a router’s routing logic are as follow: 1. For each received data link frame, choose whether or not to process the frame. Process it if:

A. The frame has no errors (per the data link trailer Frame Check Sequence, or FCS, field) B. The frame’s destination data link address is the router’s address (or an appropriate multicast or broadcast address)

2. If choosing to process the frame at Step 1, deencapsulate the packet from inside the data link frame

Page 9: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Process Reference 3. Make a routing decision. To do so, compare the packet’s destination IP address to the routing table and find the route that matches the destination address. This route identifies the outgoing interface of the router and possibly the next-hop router 4. Encapsulate the packet into a data link frame appropriate for the outgoing interface. When forwarding out LAN interfaces, use ARP as needed to find the next device’s MAC address 5. Transmit the frame out the outgoing interface, as listed in the matched IP route

Page 10: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Process Reference

Router Routing Logic Summary

Page 11: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

An Example of IP Routing

IPv4 Network Used to Show Five-Step Routing Example Host A (172.16.1.9) sends a packet to host B (172.16.2.9)

Page 12: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Host Forwards the IP Packet to the Default Router (Gateway)

Host A Sends Packet to Host B To send the packet, encapsulate it in an Ethernet frame. Make the destination MAC address be R1’s G0/0 MAC address (host A’s default gateway)

Page 13: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Routing Step 1: Decide Whether to Process the Incoming Frame

The first step in the routing process begins with a decision of whether a router should process the frame or silently discard (ignore) the frame The router makes no attempt at error recovery; that is, the router does not ask the sender to retransmit the data

Routing Step 1, on Router R1: Checking FCS and Destination MAC

Page 14: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Routing Step 2: Deencapsulation of the IP Packet

Routing Step 2 on Router R1: Deencapsulating the Packet

Page 15: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Routing Step 3: Choosing Where to Forward the Packet Routes for remote subnets typically list both an outgoing interface and next-hop router IP address. Routes for subnets that connect directly to the router list only the outgoing interface, because packets to these destinations do not need to be sent to another router

Routing Step 3 on Router R1: Matching the Routing Table

Page 16: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Routing Step 4: Encapsulating the Packet in a New Frame

Routing Step 4 on Router R1: Encapsulating the Packet

Page 17: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Routing Step 4: Encapsulating the Packet in a New Frame

Routing Step 4 on Router R1 with a LAN Outgoing Interface

Page 18: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Routing Step 5: Transmitting the Frame

After the frame has been prepared, the router simply needs to transmit the frame The router might have to wait, particularly if other frames are already waiting their turn to exit the interface

Page 19: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Potential Routing Performance Issues

Routers barely spend any processing time to route a single IP packet. In fact, even slower routers need to forward tens of thousands of packets per second (pps); to do that, the routers cannot spend a lot of effort processing each packet The process of matching a packet’s destination address with the IP routing table can actually take a lot of CPU time. Routers in the core of the Internet have hundreds of thousands of routes. Now think about a router CPU that needs to search a list 100,000 entries long, for every packet, for a router that needed to forward hundreds of thousands of packets per second! And what if the router had to do subnetting math each time, calculating the range of addresses in each subnet for each route? Those actions would take too many CPU cycles

Page 20: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Potential Routing Performance Issues

Over the years, Cisco has created several ways to optimize the internal process of how routers forward packets. Some methods tie to a specific model series of router. Layer 3 switches do the forwarding in Application Specific Integrated Circuits (ASIC), which are computer chips built for the purpose of forwarding frames or packets. All these optimizations take the basic logic from the fivestep list here, but work differently inside the router hardware and software, in an effort to use fewer CPU cycles and reduce the overhead of forwarding IP packets

Page 21: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Cisco Router Fast Switching and CEF Historically speaking, Cisco has had three major variations of internal routing logic that apply across the entire router product family: 1. First, Cisco routers used internal logic called process switching which works basically like the routing process detailed so far in this slide, without any of the extra optimizations. 2. Next, Cisco introduced alternate internal routing logic called fast switching which made a couple of optimizations compared to the older process-switching logic.

A. First, it kept another list in addition to the routing table, listing specific IP addresses for recently forwarded packets.

B. This fast-switching cache also kept a copy of the new data link headers used when forwarding packets to each destination, so rather than build a new data link header for each packet destined for a particular IP address, the router saved a little effort by copying the old data link header.

Page 22: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Cisco Router Fast Switching and CEF 3. Cisco improved over fast switching with the introduction of Cisco Express Forwarding (CEF)

CEF uses additional tables for faster searches, and it saves outgoing data link headers. However, CEF organizes its tables for all routing table destinations, ahead of time, not just for some of the specific destination IP addresses. CEF also uses much more sophisticated search algorithms and binary tree structures as compared to fast switching. As a result, the CEF table lookups that replace the routing table matches take even less time than with fast switching. And it caches the data link headers as well. Today, current models of Cisco routers, and current IOS versions, use CEF by default.

Page 23: CCNA R&S-20-Configuring IPv4 Addresses and Routes

IP Routing

©2015 Amir Jafari – www.amir-Jafari.com

Cisco Router Fast Switching and CEF

Comparisons of Packet Switching, Fast Switching, and CEF

Page 24: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Connected Routes

Cisco routers enable IPv4 routing globally, by default Then, to make the router be ready to route packets on a particular interface, the router must be configured with an IP address and the interface must be configured such that it comes up, reaching a “line status up, line protocol up” state Only at that point can routers route IP packets in and out a particular interface After a router can route IP packets out one or more interfaces, the router needs some routes

Page 25: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Connected Routes Routers can add routes to their routing tables through three methods: 1. Connected routes: Added because of the configuration of the ip address interface

subcommand on the local router

2. Static routes: Added because of the configuration of the ip route global command on the local router

3. Routing protocols: Added as a function by configuration on all routers, resulting in a process by which routers dynamically tell each other about the network so that they all learn routes

Page 26: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Connected Routes and the ip address Command A Cisco router automatically adds a route to its routing table for the subnet connected to each interface, assuming that the following two facts are true:

The interface is in a working state—in other words, the interface status in the show interfaces command lists a line status of up and a protocol status of up The interface has an IP address assigned through the ip address interface subcommand

Page 27: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Connected Routes and the ip address Command

Sample Network to Show Connected Routes

Page 28: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Connected Routes and the ip address Command

Connected and Local Routes on Router R1

Page 29: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Connected Routes and the ip address Command

Page 30: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Connected Routes and the ip address Command

The router also automatically produces a different kind of route, called a local route The local routes define a route for the one specific IP address configured on the router interface Each local route has a /32 prefix length, defining a host route, which defines a route just for that one IP address Routers use these local routes that list their own local IP addresses to more efficiently forward packets sent to the router itself

Page 31: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Routing Between Subnets on VLANs

To route IP packets in and out of those VLANs, some router needs to have an IP address in each subnet and have a connected route to each of those subnets Then the hosts in each subnet can use the router IP addresses as their default gateways, respectively Three options exist for connecting a router to each subnet on a VLAN: 1. Use a router, with one router LAN interface and cable connected to the switch for

each and every VLAN (typically not used) 2. Use a router, with a VLAN trunk connecting to a LAN switch 3. Use a Layer 3 switch

Page 32: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Routing Between Subnets on VLANs

Subinterfaces on Router R1

Page 33: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

When discussing how to route packets to subnets associated with VLANs connected to a router 802.1Q trunk, the networking world has name for this feature: Router on a Stick (ROAS) ROAS uses router VLAN trunking configuration to give the router a logical router interface connected to each VLAN, and therefore each subnet that sits on a separate VLAN The router needs to have an IP address/mask associated with each VLAN on the trunk However, the router uses only one physical interface on which to configure the ip address command Cisco solves this problem by creating multiple virtual router interfaces, one associated with each VLAN on that trunk. Cisco calls these virtual interfaces subinterfaces That trunking configuration revolves around subinterfaces

Page 34: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

Subinterfaces on Router B1

Page 35: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

Cisco routers do not attempt to negotiate trunking, so both the router and switch need to manually configure trunking. These steps detail how to configure 802.1Q trunking on a router: Step 1. Create a unique subinterface for each VLAN that needs to be routed (interface type number.subint) Step 2. Enable 802.1Q, and associate one specific VLAN with the subinterface in subinterface config mode (encapsulation dot1q vlan_id) Step 3. Configure IP settings (address and mask) in subinterface config mode (ip address address mask)

Page 36: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

Router Configuration for the 802.1Q Encapsulation

Page 37: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

The subinterface number begins with the period, like .10 and .20 in this case. These numbers can be any number from 1 up through a very large number (over 4 billion) The number just needs to be unique among all subinterfaces associated with this one physical interface In fact, the subinterface number does not even have to match the associated VLAN ID If the physical Ethernet interface reaches an up/up state, the subinterface should as well, which would then let the router add the connected routes The ISL configuration on the same router would be practically identical. Just substitute the keyword isl instead of dot1q in each case

Page 38: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

Each 802.1Q trunk has one native VLAN, and when used, the configuration to use that native VLAN differs, with two options for the router side of the configuration:

Configure the ip address command on the physical interface, but without an encapsulation command; the router considers this physical interface to be using the native VLAN Configure the ip address command on a subinterface, and use the encapsulation...native subcommand.

Besides just scanning the configuration, the show vlans command on a router spells out which router trunk interfaces use which VLANs, which VLAN is the native VLAN, plus some packet statistics

Page 39: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

Router Configuration Using Native VLAN 10 on Router B1

Page 40: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

Page 41: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs using 802.1Q on Routers

show vlans Command to Match Sample Router Trunking Configuration

Page 42: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs Using a Layer 3 Switch A Layer 3 switch is one device that does two primary functions: Layer 2 LAN switching and Layer 3 IP routing The configuration of a Layer 3 switch mostly looks like the Layer 2 switching configuration with a small bit of configuration added for the Layer 3 functions The Layer 3 switching function needs a virtual interface connected to each VLAN internal to the switch These VLAN interfaces act like router interfaces, with an IP address and mask The Layer 3 switch has an IP routing table, with connected routes off each of these VLAN interfaces. (These interfaces are also referred to as Switched Virtual Interfaces [SVI].)

Page 43: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs Using a Layer 3 Switch

Routing on VLAN Interfaces in a Layer 3 Switch

Page 44: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs Using a Layer 3 Switch The following steps show how to configure Layer 3 switching: Step 1. Enable hardware support for IPv4 routing. For example, on 2960 switches, configure the sdm prefer lanbase-routing global command and reload the switch Step 2. Enable IPv4 routing globally (ip routing) Step 3. Create VLAN interfaces for each VLAN for which the Layer 3 switch is routing packets (interface vlan vlan_id) Step 4. Configure an IP address and mask on the VLAN interface (in interface configuration mode for that interface), enabling IPv4 on that VLAN interface (ip address address mask) Step 5. If the switch defaults to place the VLAN interface in a disabled (shutdown) state, enable the interface (no shutdown)

Page 45: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs Using a Layer 3 Switch

VLAN Interface Configuration for Layer 3 Switching

Page 46: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Configuring Routing to VLANs Using a Layer 3 Switch

To support the routing of packets, the switch adds connected IP routes. Each route is listed as being connected to a different VLAN interface.

Connected Routes on a Layer 3 Switch

Page 47: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Secondary IP Addressing Imagine that you planned your IP addressing scheme for a network. Later, a particular subnet grows, and you have used all the valid IP addresses in the subnet. Three main options exist which you can do: 1. Make the existing subnet larger, by choosing a mask with more host bits. Existing hosts

have to change their subnet mask settings, and new hosts can use IP addresses from the expanded address range

2. Migrate to a completely new (larger) subnet. All existing devices change their IP addresses

3. Add a second subnet in the same location, using secondary addressing. The third option uses a Cisco router feature called secondary IP addressing. Secondary addressing uses multiple networks or subnets on the same data link

Page 48: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Secondary IP Addressing

TCP/IP Network with Secondary Addresses

Page 49: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Secondary IP Addressing

Secondary addressing allows some hosts to have addresses in one IP subnet, others to have addresses in a second IP subnet, and the router to have addresses in both Both IP subnets would be in the same Layer 2 broadcast domain (VLAN). As a result, the router will have connected routes for both the subnets, so the router can route packets to both subnets and even between both subnets Secondary addressing does have one negative: Traffic between hosts on the same VLAN, but in different subnets, requires a trip through the router

Page 50: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Secondary IP Addressing

Secondary IP Addressing Configuration and the show ip route Command

Page 51: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Supporting Connected Routes to Subnet Zero

IOS can restrict a router from configuring an ip address command with an address inside the zero subnet The zero subnet (or subnet zero) is the one subnet in each classful network that has all binary 0s in the subnet part of the binary version of the subnet number In decimal, the zero subnet happens to be the same number as the classful network number IOS allows the network engineer to tell a router to either allow addresses in the zero subnet or not With the ip subnet-zero command configured, IOS allows the zero subnet with no restrictions

Page 52: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Supporting Connected Routes to Subnet Zero

With the no ip subnet-zero command configured, the router rejects any ip address command that uses an address/mask combination for the zero subnet For many of the more recent IOS versions, IOS allows the use of the zero subnet no ip subnet-zero command affects the local router’s ip address commands, as well as the local router’s ip route commands (which define static routes) However, it does not affect the local router’s routes as learned with a routing protocol For example, R1 could be configured with no ip subnet-zero, but still learn a route for a zero subnet using a routing protocol

Page 53: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Connected Routes

©2015 Amir Jafari – www.amir-Jafari.com

Supporting Connected Routes to Subnet Zero

Effects of [no] ip subnet-zero on a Local Router

Page 54: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Route Configuration

IOS allows the definition of individual static routes using the ip route global configuration command Every ip route command defines a destination that can be matched, usually with a subnet ID and mask The command also lists the forwarding instructions, typically listing either the outgoing interface or the next-hop router’s IP address IOS then takes that information and adds that route to the IP routing table

Page 55: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Route Configuration

Static Route Configuration Concept

Page 56: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Route Configuration

Sample Network Used in Static Route Configuration Examples

Page 57: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Route Configuration

Static Routes Added to R1

Page 58: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Route Configuration

IOS adds and removes these static routes dynamically over time, based on whether the outgoing interface is working or not. Later, when the interface comes up again, IOS adds the route back to the routing table. Also, note that the ip route command also supports the permanent keyword, which tells IOS to leave the static route in the routing table, even when the associated interface fails. Finally, if using static routes, and not using any dynamic routing protocols at all, all routers would need to have some static routes configured

Page 59: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Default Routes

When a router tries to route a packet, the router might not match the packet’s destination IP address with any route. When that happens, the router normally just discards the packet Routers can be configured so that they use either a statically configured or dynamically learned default route The default route matches all packets, so that if a packet does not match any other more specific route in the routing table, the router can at least forward the packet based on the default route

Page 60: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Default Routes

One classic example in which companies might use static default routes in their enterprise TCP/IP networks is when the company has many remote sites, each with a single, relatively slow WAN connection. Each remote site has only one possible physical route to use to send packets to the rest of the network. So, rather than use a routing protocol, which sends messages over the WAN and uses precious WAN bandwidth, each remote route might use a default route that sends all traffic to the central site IOS allows the configuration of a static default route by using special values for the subnet and mask fields in the ip route command: 0.0.0.0 and 0.0.0.0

Page 61: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Default Routes

Use of Static Default Routes at 1000 Low-Speed Remote Sites

Page 62: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Default Routes

Page 63: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring Static Routes

©2015 Amir Jafari – www.amir-Jafari.com

Static Default Routes

The output of the show ip route command lists a few new and interesting facts. First, it lists the route with a code of “S,” meaning static, but also with a *, meaning it is a candidate default route A router can learn about more than one default route, and the router then has to choose which one to use The * means that it is at least a candidate to become the default route Just above, the “Gateway of Last Resort” refers to the chosen default route, which in this case is the just-configured static route with outgoing interface S0/0/1

Page 64: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Command Reference

©2015 Amir Jafari – www.amir-Jafari.com

Command Reference

Page 65: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Command Reference

©2015 Amir Jafari – www.amir-Jafari.com

Command Reference

Page 66: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Command Reference

©2015 Amir Jafari – www.amir-Jafari.com

Command Reference

Page 67: CCNA R&S-20-Configuring IPv4 Addresses and Routes

Configuring IPv4 Addresses and Routes

©2015 Amir Jafari – www.amir-Jafari.com

References 1) Cisco Systems, Inc, www.cisco.com/ 2) Wendell Odom ,”Cisco CCENT/CCNA ICND1 100-101 Official Cert Guide”, Cisco Press, USA, 2013