Table Of Contents
DHCP—Statically Configured Routes Using a DHCP Gateway
Prerequisites for DHCP—Statically Configured Routes Using a DHCP Gateway
Information About DHCP—Statically Configured Routes Using a DHCP Gateway
Feature Design of DHCP—Statically Configured Routes Using a DHCP Gateway
Dynamic Host Configuration Protocol
Cisco IOS DHCP Server and Client
How to Configure DHCP—Statically Configured Routes Using a DHCP Gateway
Configuring Static Routes to Point to a Dynamically Learned Default Gateway
Verifying Assigned Static Routes
Configuration Examples for DHCP—Statically Configured Routes Using a DHCP Gateway
Static IP Configuration: Example
DHCP—Statically Configured Routes Using a DHCP Gateway
The DHCP—Statically Configured Routes Using a DHCP Gateway feature enables the configuration of static routes that point to an assigned DHCP next-hop router (provided by DHCP option 3). The static routes are active only when the DHCP server provides the next-hop IP address. The routes remain in the routing table until the DHCP lease expires at which time the routes are removed.
The benefit of this feature is that it eliminates the need to configure static routes to an outside interface and the configuration of a next-hop router.
Feature History for the DHCP—Statically Configured Routes Using a DHCP Gateway Feature
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•Prerequisites for DHCP—Statically Configured Routes Using a DHCP Gateway
•Information About DHCP—Statically Configured Routes Using a DHCP Gateway
•How to Configure DHCP—Statically Configured Routes Using a DHCP Gateway
•Configuration Examples for DHCP—Statically Configured Routes Using a DHCP Gateway
Prerequisites for DHCP—Statically Configured Routes Using a DHCP Gateway
•DHCP should be enabled on an interface.
•IP routing should be enabled.
•Your DHCP server should be configured and working properly which includes the following:
–Server properties
–Policies
–Associated options
–Option 3 (valid default gateway router address)
Information About DHCP—Statically Configured Routes Using a DHCP Gateway
To configure the DHCP—Statically Configured Routes Using a DHCP Gateway feature, you should understand the following concepts:
•Feature Design of DHCP—Statically Configured Routes Using a DHCP Gateway
•Dynamic Host Configuration Protocol
•Cisco IOS DHCP Server and Client
Feature Design of DHCP—Statically Configured Routes Using a DHCP Gateway
The DHCP—Statically Configured Routes Using a DHCP Gateway feature is designed to use a DHCP default gateway as the next-hop router for statically configured routes. This was not possible prior to the introduction of this feature, because the gateway IP address is not known until after the DHCP address assignment. A static route could not be configured with the command line interface (CLI) that used that DHCP-supplied address.
With the DHCP—Statically Configured Routes Using a DHCP Gateway feature, static routes are installed in a routing table with the destination next-hop IP address set to the IP address supplied by DHCP option 3, which is obtained from the DHCP server.
When a DHCP client releases an address, the corresponding static route (the route configured with the dhcp keyword) is automatically removed from the routing table. If the DHCP router option (option 3) changes during the client renewal, the routes change the next-hop to a new IP address supplied in the renewal.
Figure 1 shows a DHCP gateway and server.
Figure 1 DHCP Gateway and Server
This feature is particularly useful for Virtual Private Network (VPN) deployments.
Figure 2 shows a Dynamic Multipoint VPN (DMVPN) network. In this case, Spoke A and Spoke B have obtained dynamic IP addresses from a virtual router (172.17.0.1) using dynamic, but permanent IPsec and GRE tunnels.
Figure 2 Statically Configured Routes in a DMVPN
Dynamic Host Configuration Protocol
As explained in RFC 2131, Dynamic Host Configuration Protocol, DHCP provides configuration parameters to Internet hosts. DHCP consists of two components: a protocol for delivering host-specific configuration parameters from a DHCP server to a host and a mechanism for allocating network addresses to hosts. DHCP is built on a client and server model, in which designated DHCP server hosts allocate network addresses and deliver configuration parameters to dynamically configured hosts.
DHCP supports three mechanisms for IP address allocation:
•Automatic allocation—DHCP assigns a permanent IP address to a client.
•Dynamic allocation—DHCP assigns an IP address to a client for a limited period of time (or until the client explicitly relinquishes the address).
•Manual allocation—The network administrator assigns an IP address to a client and DHCP is used simply to convey the assigned address to the client.
Cisco IOS DHCP Server and Client
The Cisco IOS DHCP server assigns and manages IP addresses from specified address pools within the router to DHCP clients. If the Cisco IOS DHCP server cannot satisfy a DHCP request from its own database, it forwards the request to one or more secondary DHCP servers defined by the network administrator.
The Cisco IOS DHCP client enables you to obtain an IP address from a DHCP server dynamically using the DHCP protocol as specified in RFC 2131. A DHCP client may receive offers from multiple DHCP servers and can accept any one of the offers; however, the client usually accepts the first offer it receives. Additionally, the offer from the DHCP server is not a guarantee that the IP address will be allocated to the client; however, the server usually reserves the address until the client has had a chance to formally request the address.
The client returns a formal request for the offered IP address to the DHCP server in a DHCPREQUEST broadcast message. The DHCP server confirms that the IP address has been allocated to the client by returning a DHCPACK unicast message to the client.
Figure 3 shows the basic steps that occur when a DHCP client requests an IP address from a DHCP server. The client, Host A, sends a DHCPDISCOVER broadcast message to locate a Cisco IOS DHCP server. A DHCP server offers configuration parameters (such as an IP address, a MAC address, a domain name, and a lease for the IP address) to the client in a DHCPOFFER unicast message.
Figure 3 DHCP Request for an IP Address from a DHCP Server
How to Configure DHCP—Statically Configured Routes Using a DHCP Gateway
This section contains the following procedure:
•Configuring Static Routes to Point to a Dynamically Learned Default Gateway (required)
•Verifying Assigned Static Routes (optional)
Configuring Static Routes to Point to a Dynamically Learned Default Gateway
Perform this task to configure a static route to point to a dynamically learned default gateway.
Prerequisites
Verify all DHCP client and server configuration steps. Ensure that the DHCP client and server are properly defined to supply a DHCP router option 3.
Restrictions
•If the DHCP client is not able to obtain an IP address or default router IP address, the static route is not installed in the routing table.
•If the lease has expired and the DHCP client cannot renew the address, the DHCP IP address assigned to the client is released and any associated static routes are removed from the routing table.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip route prefix mask {ip-address | interface-type interface-number [ip-address]} dhcp [distance]
4. exit
DETAILED STEPS
Verifying Assigned Static Routes
To verify the assigned routes, perform the following steps.
SUMMARY STEPS
1. show ip route
2. debug dhcp detail
3. show ip route
4. show running-config | inc dhcp
DETAILED STEPS
Step 1 show ip route
Use this command to display assigned static routes once the DHCP client obtains an address and a default router address from the DHCP server, for example:
Router# show ip route
209.165.200.224 is subnetted, 2 subnets209.165.200.225 [1/0] via 10.10.10.1209.165.200.226 [20/0] via 10.11.11.2Step 2 debug dhcp detail
Use this command to verify the DHCP assignment of static routes, for example:
Router# debug dhcp detail
*Oct 2 06:22:24: Setting default_gateway to 10.8.8.1 ! This is the option 3 default gateway.*Oct 2 06:22:24: Adding default route 10.8.8.1*Oct 2 06:22:24: DHCP: Adding static route to 10.3.2.1 255.255.255.255 via 10.8.8.1*Oct 2 06:22:24: DHCP: Adding static route to 10.1.1.1 255.255.255.255 via 10.8.8.1*Oct 2 06:22:24: DHCP: Adding static route to 10.2.2.2 255.255.255.255 via 10.8.8.1The output shows that the default gateway (option 3) was assigned a static IP address that is the default route and static routes were added from the DHCP server.
Step 3 show ip route
Use this command to verify that the routes are static, for example:
Router# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 10.0.19.14 to network 0.0.0.010.0.0.0/24 is subnetted, 1 subnetsC 10.8.8.0 is directly connected, Ethernet110.0.0.0/32 is subnetted, 1 subnetsS 10.1.1.1 [1/0] via 10.8.8.110.0.0.0/32 is subnetted, 1 subnetsS 10.3.2.1 [24/0] via 10.8.8.110.0.0.0/32 is subnetted, 1 subnetsS 10.2.2.2 [1/0] via 10.8.8.110.0.0.0/28 is subnetted, 1 subnetsC 10.0.19.0 is directly connected, Ethernet010.0.0.0/24 is subnetted, 1 subnetsC 10.15.15.0 is directly connected, Loopback0S* 0.0.0.0/0 [1/0] via 10.0.19.14The output shows that route 10.1.1.1 [1/0], 10.3.2.1 [24/0], and 10.2.2.2 [1/0] are static, and route 10.0.0.0/0 is a default route candidate. Route 10.8.8.0 is the default gateway.
Step 4 show running-config | inc dhcp
Use this command to display the DHCP static routes only (as shown above), for example:
Router# show running-config | inc dhcp
ip address dhcpip route 10.3.2.1 255.255.255.255 Ethernet1 dhcp 24ip route 10.1.1.1 255.255.255.255 dhcpip route 10.2.2.2 255.255.255.255 dhcp
Configuration Examples for DHCP—Statically Configured Routes Using a DHCP Gateway
The section provides the following example:
•Static IP Configuration: Example
Static IP Configuration: Example
The following example shows how to configure two Ethernet interfaces to obtain the next-hop router IP address from the DHCP server:
ip route 209.165.200.225 255.255.255.255 ether1 dhcp
ip route 209.165.200.226 255.255.255.255 ether2 dhcp 20
To verify the configuration above, use the show ip route command. The output is as follows:
209.165.200.224 is subnetted, 2 subnets
209.165.200.225 [1/0] via 10.10.10.1
209.165.200.226 [20/0] via 10.11.11.2
Additional References
The following sections provide references related to the DHCP—Statically Configured Routes Using a DHCP Gateway feature.
Related Documents
Related Topic Document TitleIP routing protocols overview and configuration
•Cisco IOS IP Configuration Guide
•Cisco IOS IP Command Reference, Volume 2 of 4: Routing Protocols, Release 12.3 T
IP addressing overview and configuration
•Cisco IOS IP Configuration Guide
•Cisco IOS IP Command Reference, Volume 1 of 4: Addressing and Services, Release 12.3 T
DHCP overview and configuration
•"Configuring DHCP" chapter in the Cisco IOS IP Configuration Guide
•"Configuring DHCP Servers" chapter in the Network Registrar User's Guide
•RFC 2131, Dynamic Host Configuration Protocol
DMVPN overview and configuration
Dynamic Multipoint VPN, Release 12.2(13)T
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
MIBs
RFCs
RFCs TitleNo new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.
—
Technical Assistance
Command Reference
This section documents modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3 T command reference publications.
debug dhcp
To display debugging information about the Dynamic Host Configuration Protocol (DHCP) client activities and to monitor the status of DHCP packets, use the debug dhcp command in privileged EXEC mode. To disable debugging output, use the no form of this command.
debug dhcp [detail]
no debug dhcp [detail]
Syntax Description
Command Modes
Privileged EXEC
Command History
Usage Guidelines
You can also use the debug dhcp command to monitor the subnet allocation and releasing for on-demand address pools.
For debugging purposes, the debug dhcp detail command provides the most useful information such as the lease entry structure of the client and the state transitions of the lease entry. The debug output shows the scanned option values from received DHCP messages that are replies to a router request. The values of the op, htype, hlen, hops, server identifier option, xid, secs, flags, ciaddr, yiaddr, siaddr, and giaddr fields of the DHCP packet are shown in addition to the length of the options field.
Examples
The following examples show and explain some of the typical debugging messages you may see when using the debug dhcp detail command.
The following sample output shows when a DHCP client sends a DHCPDISCOVER broadcast message to find its local DHCP server:
Router# debug dhcp detail00:07:16:DHCP:DHCP client process started:1000:07:16:RAC:Starting DHCP discover on Ethernet200:07:16:DHCP:Try 1 to acquire address for Ethernet200:07:16:%SYS-5-CONFIG_I:Configured from console by console00:07:19:DHCP:Shutting down from get_netinfo()00:07:19:DHCP:Attempting to shutdown DHCP Client00:07:21:DHCP:allocate request00:07:21:DHCP:new entry. add to queue00:07:21:DHCP:SDiscover attempt # 1 for entry:The first seven lines of the following output show the current values stored in the lease entry structure for the client:
00:07:21:Temp IP addr:255.255.255.224 for peer on Interface:Ethernet200:07:21:Temp sub net mask:255.255.255.22400:07:21: DHCP Lease server:255.255.255.224, state:1 Selecting00:07:21: DHCP transaction id:58200:07:21: Lease:0 secs, Renewal:0 secs, Rebind:0 secs00:07:21: Next timer fires after:00:00:0300:07:21: Retry count:1 Client-ID:cisco-0010.7b6e.afd8-Et200:07:21:DHCP:SDiscover:sending 308 byte length DHCP packet00:07:21:DHCP:SDiscover 308 bytes00:07:21: B'cast on Ethernet2 interface from 255.255.255.224The following output shows the offered addresses and parameters sent to the DHCP client by the DHCP server via a DHCPOFFER message. The messages containing the Scan field indicate the options that were scanned from the received BOOTP packet and the corresponding values:
00:07:23:DHCP:Received a BOOTREP pkt00:07:23:DHCP:Scan:Message type:DHCP Offer00:07:23:DHCP:Scan:Server ID Option:10.1.1.1 = A01010100:07:23:DHCP:Scan:Lease Time:18000:07:23:DHCP:Scan:Renewal time:9000:07:23:DHCP:Scan:Rebind time:15700:07:23:DHCP:Scan:Subnet Address Option:255.255.255.0The following output shows selected fields in the received BOOTP packet:
00:07:23:DHCP:rcvd pkt source:10.1.1.1, destination: 255.255.255.25500:07:23: UDP sport:43, dport:44, length:30800:07:23: DHCP op:2, htype:1, hlen:6, hops:000:07:23: DHCP server identifier:10.1.1.100:07:23: xid:582, secs:0, flags:800000:07:23: client:255.255.255.224, your:10.1.1.200:07:23: srvr: 255.255.255.224, gw:255.255.255.22400:07:23: options block length:6000:07:23:DHCP Offer Message Offered Address:10.1.1.200:07:23:DHCP:Lease Seconds:180 Renewal secs: 90 Rebind secs:15700:07:23:DHCP:Server ID Option:10.1.1.100:07:23:DHCP:offer received from 10.1.1.1The following output shows when the DHCP client sends a DHCPREQUEST broadcast message to the DHCP server to accept the offered parameters:
00:07:23:DHCP:SRequest attempt # 1 for entry:00:07:23:Temp IP addr:10.1.1.2 for peer on Interface:Ethernet200:07:23:Temp sub net mask:255.255.255.000:07:23: DHCP Lease server:10.1.1.1, state:2 Requesting00:07:23: DHCP transaction id:58200:07:23: Lease:180 secs, Renewal:0 secs, Rebind:0 secs00:07:23: Next timer fires after:00:00:0200:07:23: Retry count:1 Client-ID:cisco-0010.7b6e.afd8-Et200:07:23:DHCP:SRequest- Server ID option:10.1.1.100:07:23:DHCP:SRequest- Requested IP addr option:10.1.1.200:07:23:DHCP:SRequest placed lease len option:18000:07:23:DHCP:SRequest:326 bytes00:07:23:DHCP:SRequest:326 bytes00:07:23: B'cast on Ethernet2 interface from 255.255.255.224The following output shows when the DHCP server sends a DHCPACK message to the client with the full set of configuration parameters:
00:07:23:DHCP:Received a BOOTREP pkt00:07:23:DHCP:Scan:Message type:DHCP Ack00:07:23:DHCP:Scan:Server ID Option:10.1.1.1 = A01010100:07:23:DHCP:Scan:Lease Time:18000:07:23:DHCP:Scan:Renewal time:9000:07:23:DHCP:Scan:Rebind time:15700:07:23:DHCP:Scan:Subnet Address Option:255.255.255.000:07:23:DHCP:rcvd pkt source:10.1.1.1, destination: 255.255.255.25500:07:23: UDP sport:43, dport:44, length:30800:07:23: DHCP op:2, htype:1, hlen:6, hops:000:07:23: DHCP server identifier:10.1.1.100:07:23: xid:582, secs:0, flags:800000:07:23: client:255.255.255.224, your:10.1.1.200:07:23: srvr: 255.255.255.224, gw:255.255.255.22400:07:23: options block length:6000:07:23:DHCP Ack Message00:07:23:DHCP:Lease Seconds:180 Renewal secs: 90 Rebind secs:15700:07:23:DHCP:Server ID Option:10.1.1.1Interface Ethernet2 assigned DHCP address 10.1.1.2, mask 255.255.255.000:07:26:DHCP Client Pooling:***Allocated IP address:10.1.1.200:07:26:Allocated IP address = 10.1.1.2 255.255.255.0The following output shows when the default gateway (option 3) is assigned a static IP address that is the default route and then static routes are added from the DHCP server:
*Oct 2 06:22:24: Setting default_gateway to 10.20.19.18 ! This is the option 3 default gateway.*Oct 2 06:22:24: Adding default route 10.20.19.18*Oct 2 06:22:24: DHCP: Adding static route to 10.3.2.1 255.255.255.255 via 10.20.19.18*Oct 2 06:22:24: DHCP: Adding static route to 10.1.1.1 255.255.255.255 via 10.20.19.18*Oct 2 06:22:24: DHCP: Adding static route to 10.2.2.2 255.255.255.255 via 10.20.19.18Most fields are self-explanatory; however, fields that may need further explanation are described in Table 1.
Related Commands
Command Descriptiondebug ip dhcp server
Enables DHCP server debugging.
show dhcp lease
Displays DHCP addresses leased from a server.
ip route (global)
To establish static routes, use the ip route command in global configuration mode. To remove static routes, use the no form of this command.
ip route prefix mask {ip-address | interface-type interface-number [ip-address]} [dhcp] [distance] [name] [permanent] [tag tag]
no ip route prefix mask
Syntax Description
Defaults
No static routes are established.
Command Modes
Global configuration
Command History
Usage Guidelines
When you specify a DHCP server to assign a static route, the interface type and number and administrative distance may be configured also.
Routing Protocols
If you specify an administrative distance, you are flagging a static route that can be overridden by dynamic information. For example, IGRP-derived routes have a default administrative distance of 100. To have a static route that would be overridden by an IGRP dynamic route, specify an administrative distance greater than 100. Static routes have a default administrative distance of 1.
Static routes that point to an interface on a connected router will be advertised by way of Routing Information Protocol (RIP), Interior Gateway Routing Protocol (IGRP), and Exterior Gateway Routing Protocol (EIGRP) regardless of whether redistribute static commands were specified for those routing protocols. This situation occurs because static routes that point to an interface are considered in the routing table to be connected and hence lose their static nature.
Also, the target of the static route should be included in the network command. If this condition is not met, no dynamic routing protocol will advertise the route unless a redistribute static command is specified for these protocols. With the following configuration:
rtr1 (serial 10.16..188.1/30)--------------> rtr2(Fast Ethernet 10.31.1.1/30) ------>router [rip | eigrp | igrp]net 10.16..188.0net 10.31.0.0•RIP and IGRP redistribute the route if the route is pointing to the Fast Ethernet interface:
ip route 172.16..188.252 255.255.255.252 FastEthernet0/0RIP and IGRP do not redistribute the route with the following ip route command because of the split horizon algorithm:
ip route 10.16..188.252 255.255.255.252 s2/1•EIGRP redistributes the route with both of the following commands:
ip route 10.16..188.252 255.255.255.252 FastEthernet0/0ip route 10.16..188.252 255.255.255.252 s2/1With Open Shortest Path First (OSPF), static routes that point to an interface are not advertised unless a redistribute static command is specified.
Adding a static route to an Ethernet or other broadcast interface (for example, ip route 255.255.255.224 255.255.255.224 Ethernet 1/2) will cause the route to be inserted into the routing table only when the interface is up. This configuration is not generally recommended. When the next hop of a static route points to an interface, the router considers each of the hosts within the range of the route to be directly connected through that interface, and therefore it will send ARP requests to any destination addresses that route through the static route.
The practical implication of configuring "ip route 255.255.255.224 255.255.255.224 Ethernet 1/2" is that the router will consider all of the destinations that the router does not know how to reach through some other route as directly connected to Ethernet 1/2. So the router will send an ARP request for each host for which it receives packets on this network segment. This configuration can cause high processor utilization and a very large ARP cache (along with attendant memory allocation failures). Configuring a default route or other static route that directs the router to forward packets for a large range of destinations to a connected broadcast network segment can cause your router to reload.
Specifying a numerical next hop that is on a directly connected interface will prevent the router from using Proxy ARP. However, if the interface with the next hop goes down and the numerical next hop can be reached through a recursive route, you may specify both the next hop and interface (for example "ip route 255.255.255.224 255.255.255.224 Ethernet1/2 10.1.2.3") with a static route to prevent routes from passing through an unintended interface.
Static Routes Using a Default DHCP Gateway
With Cisco IOS Release 12.3(8)T, static routes using a default DHCP gateway can be configured. The dhcp keyword enables this functionality.
Examples
The following example chooses an administrative distance of 110. In this case, packets for network 10.0.0.0 will be routed through to a router at 10.31.3.4 if dynamic information with administrative distance less than 110 is not available.
ip route 10.0.0.0 255.0.0.0 10.31.3.4 110
Note Specifying the next hop without specifying an interface when configuring a static route can cause traffic to pass through an unintended interface if the default interface goes down.
The following example routes packets for network 10.31.0.0 to a router at 10.31.6.6:
ip route 10.31.0.0 255.255.0.0 10.31.6.6The following example routes packets for network 10.168.1.0 directly to the next hop at 10.1.2.3. If the interface goes down, this route is removed from the routing table and will not be restored unless the interface comes back up.
ip route 10.168.1.0 255.255.0.0 Ethernet0 10.1.2.3The following example shows that using the dhcp keyword in a configuration of Ethernet interfaces 1 and 2 enables the interfaces to obtain the next-hop router IP addresses dynamically from a DHCP server:
ip route 209.165.200.225 255.255.255.255 ether1 dhcpip route 209.165.200.226 255.255.255.255 ether2 dhcp 20Related Commands
show ip route
To display the current state of the routing table, use the show ip route command in user EXEC or privileged EXEC mode.
show ip route [[ip-address [mask] [longer-prefixes]] | [protocol [process-id]] | [list access-list-number | access-list-name] | [static download]]
Syntax Description
Command Modes
User EXEC
Privileged EXECCommand History
Usage Guidelines
The show ip route static download command provides a way to display all dynamic static routes with name and distance information, including active and inactive ones. You can display all active dynamic static routes with both the show ip route and show ip route static commands after these active routes are added in the main routing table.
Examples
Routing Table Examples
The following examples show the standard routing tables displayed by the show ip route command. Use the codes displayed at the beginning of each report and the information in Table 2 to understand the type of route.
The following is sample output from the show ip route command when entered without an address:
Router# show ip routeCodes: I - IGRP derived, R - RIP derived, O - OSPF derived,C - connected, S - static, E - EGP derived, B - BGP derived,* - candidate default route, IA - OSPF inter area route,i - IS-IS derived, ia - IS-IS, U - per-user static route,o - on-demand routing, M - mobile, P - periodic downloaded static route,D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,N2 - OSPF NSSA external type 2 routeGateway of last resort is 10.119.254.240 to network 10.140.0.0O E2 10.110.0.0 [160/5] via 10.119.254.6, 0:01:00, Ethernet2E 10.67.10.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2O E2 10.68.132.0 [160/5] via 10.119.254.6, 0:00:59, Ethernet2O E2 10.130.0.0 [160/5] via 10.119.254.6, 0:00:59, Ethernet2E 10.128.0.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2E 10.129.0.0 [200/129] via 10.119.254.240, 0:02:22, Ethernet2E 10.65.129.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2E 10.10.0.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2E 10.75.139.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2E 10.16.208.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2E 10.84.148.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2E 10.31.223.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2E 10.44.236.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2E 10.141.0.0 [200/129] via 10.119.254.240, 0:02:22, Ethernet2E 10.140.0.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2The following is sample output that includes IS-IS Level 2 routes learned:
Router# show ip routeCodes: I - IGRP derived, R - RIP derived, O - OSPF derived,C - connected, S - static, E - EGP derived, B - BGP derived,* - candidate default route, IA - OSPF inter area route,i - IS-IS derived, ia - IS-IS, U - per-user static route,o - on-demand routing, M - mobile, P - periodic downloaded static route,D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,N2 - OSPF NSSA external type 2 routeGateway of last resort is not set10.89.0.0 is subnetted (mask is 255.255.255.0), 3 subnetsC 10.89.64.0 255.255.255.0 is possibly down,routing via 255.255.255.224, Ethernet0i L2 10.89.67.0 [115/20] via 10.89.64.240, 0:00:12, Ethernet0i L2 10.89.66.0 [115/20] via 10.89.64.240, 0:00:12, Ethernet0The following is sample output using the longer-prefixes keyword. When the longer-prefixes keyword is included, the address and mask pair becomes the prefix, and any address that matches that prefix is displayed. Therefore, multiple addresses are displayed.
In the following example, the logical AND operation is performed on the source address 10.0.0.0 and the mask 10.0.0.0, resulting in 10.0.0.0. Each destination in the routing table is also logically ANDed with the mask and compared to that result of 10.0.0.0. Any destinations that fall into that range are displayed in the output.
Router# show ip route 10.0.0.0 10.0.0.0 longer-prefixesCodes: I - IGRP derived, R - RIP derived, O - OSPF derived,C - connected, S - static, E - EGP derived, B - BGP derived,* - candidate default route, IA - OSPF inter area route,i - IS-IS derived, ia - IS-IS, U - per-user static route,o - on-demand routing, M - mobile, P - periodic downloaded static route,D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,N2 - OSPF NSSA external type 2 routeGateway of last resort is not setS 10.134.0.0 is directly connected, Ethernet0S 10.10.0.0 is directly connected, Ethernet0S 10.129.0.0 is directly connected, Ethernet0S 10.128.0.0 is directly connected, Ethernet0S 10.49.246.0 is directly connected, Ethernet0S 10.160.97.0 is directly connected, Ethernet0S 10.153.88.0 is directly connected, Ethernet0S 10.76.141.0 is directly connected, Ethernet0S 10.75.138.0 is directly connected, Ethernet0S 10.44.237.0 is directly connected, Ethernet0S 10.31.222.0 is directly connected, Ethernet0S 10.16.209.0 is directly connected, Ethernet0S 10.145.0.0 is directly connected, Ethernet0S 10.141.0.0 is directly connected, Ethernet0S 10.138.0.0 is directly connected, Ethernet0S 10.128.0.0 is directly connected, Ethernet010.19.0.0 255.255.255.0 is subnetted, 1 subnetsC 10.19.64.0 is directly connected, Ethernet010.69.0.0 is variably subnetted, 2 subnets, 2 masksC 10.69.232.32 255.255.255.240 is directly connected, Ethernet0S 10.69.0.0 255.255.0.0 is directly connected, Ethernet0The following examples display all downloaded static routes. A P designates which route was installed using AAA route download.
Router# show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static route, o - ODR, P - periodic downloaded static routeT - traffic engineered routeGateway of last resort is 172.21.17.1 to network 255.255.255.224172.31.0.0/32 is subnetted, 1 subnetsP 172.31.229.41 is directly connected, Dialer1 20.0.0.0/24 is subnetted, 3 subnetsP 10.1.1.0 [200/0] via 172.31.229.41, Dialer1P 10.1.3.0 [200/0] via 172.31.229.41, Dialer1P 10.1.2.0 [200/0] via 172.31.229.41, Dialer1Router# show ip route static172.27.4.0/8 is variably subnetted, 2 subnets, 2 masksP 172.1.1.1/32 is directly connected, BRI0P 172.27.4.0/8 [1/0] via 103.1.1.1, BRI0S 172.31.0.0/16 [1/0] via 172.21.114.65, Ethernet0S 10.0.0.0/8 is directly connected, BRI0P 10.0.0.0/8 is directly connected, BRI0172.21.0.0/16 is variably subnetted, 5 subnets, 2 masksS 172.21.114.201/32 is directly connected, BRI0S 172.21.114.205/32 is directly connected, BRI0S 172.21.114.174/32 is directly connected, BRI0S 172.21.114.12/32 is directly connected, BRI0P 10.0.0.0/8 is directly connected, BRI0P 10.1.0.0/8 is directly connected, BRI0P 10.2.2.0/8 is directly connected, BRI0S* 255.255.255.224/0 [1/0] via 172.21.114.65, Ethernet0S 172.29.0.0/16 [1/0] via 172.21.114.65, Ethernet0The following example shows how to use the show ip route static download command to display all active and inactive routes installed using AAA route download:
Router# show ip route static downloadConnectivity: A - Active, I - InactiveA 10.10.0.0 255.0.0.0 BRI0A 10.11.0.0 255.0.0.0 BRI0A 10.12.0.0 255.0.0.0 BRI0A 10.13.0.0 255.0.0.0 BRI0I 10.20.0.0 255.0.0.0 172.21.1.1I 10.22.0.0 255.0.0.0 Serial0I 10.30.0.0 255.0.0.0 Serial0I 10.31.0.0 255.0.0.0 Serial1I 10.32.0.0 255.0.0.0 Serial1A 10.34.0.0 255.0.0.0 103.1.1.1A 10.36.1.1 255.255.255.255 BRI0 200 name remote1I 10.38.1.9 255.255.255.0 104.21.69.1
Specific Route Information
When you specify that you want information about a specific network displayed, more detailed statistics are shown. The following is sample output from the show ip route command when entered with the address 10.0.0.1:
Router# show ip route 10.0.0.1Routing entry for 10.0.0.1/32Known via "isis", distance 115, metric 20, type level-1Redistributing via isisLast update from 10.191.255.251 on Fddi1/0, 00:00:13 agoRouting Descriptor Blocks:* 10.22.22.2, from 10.191.255.247, via Serial2/3Route metric is 20, traffic share count is 110.191.255.251, from 10.191.255.247, via Fddi1/0Route metric is 20, traffic share count is 1When an IS-IS router advertises its link-state information, it includes one of its own IP addresses to be used as the originator IP address. When other routers calculate IP routes, they can store the originator IP address with each route in the routing table.
The example above shows the output from the show ip route command when looking at an IP route generated by IS-IS. Each path that is shown under the Routing Descriptor Blocks report displays two IP addresses. The first address (10.22.22.2) is the next hop address. The second is the originator IP address from the advertising IS-IS router. This address helps you determine where a particular IP route has originated in your network. In the example the route to 10.0.0.1/32 was originated by a router with IP address 10.191.255.247.
Table 81 describes the significant fields shown when using the show ip route command with an IP address (previous displays).
The following is sample output using the longer-prefixes keyword. When the longer-prefixes keyword is included, the address and mask pair becomes the prefix, and any address that matches that prefix is displayed. Therefore, multiple addresses are displayed.
In the following example, the logical AND operation is performed on the source address 10.0.0.0 and the mask 10.0.0.0, resulting in 10.0.0.0. Each destination in the routing table is also logically ANDed with the mask and compared to that result of 10.0.0.0. Any destinations that fall into that range are displayed in the output.
Router# show ip route 10.0.0.0 10.0.0.0 longer-prefixesCodes: I - IGRP derived, R - RIP derived, O - OSPF derived,C - connected, S - static, E - EGP derived, B - BGP derived,* - candidate default route, IA - OSPF inter area route,i - IS-IS derived, ia - IS-IS, U - per-user static route,o - on-demand routing, M - mobile, P - periodic downloaded static route,D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,N2 - OSPF NSSA external type 2 routeGateway of last resort is not setS 10.134.0.0 is directly connected, Ethernet0S 10.10.0.0 is directly connected, Ethernet0S 10.129.0.0 is directly connected, Ethernet0S 10.128.0.0 is directly connected, Ethernet0S 10.49.246.0 is directly connected, Ethernet0S 10.160.97.0 is directly connected, Ethernet0S 10.153.88.0 is directly connected, Ethernet0S 10.76.141.0 is directly connected, Ethernet0S 10.75.138.0 is directly connected, Ethernet0S 10.44.237.0 is directly connected, Ethernet0S 10.31.222.0 is directly connected, Ethernet0S 10.16.209.0 is directly connected, Ethernet0S 10.145.0.0 is directly connected, Ethernet0S 10.141.0.0 is directly connected, Ethernet0S 10.138.0.0 is directly connected, Ethernet0S 10.128.0.0 is directly connected, Ethernet010.19.0.0 255.255.255.0 is subnetted, 1 subnetsC 10.19.64.0 is directly connected, Ethernet010.69.0.0 is variably subnetted, 2 subnets, 2 masksC 10.69.232.32 255.255.255.240 is directly connected, Ethernet0S 10.69.0.0 255.255.0.0 is directly connected, Ethernet0The following output includes the tag 120 applied to the route 10.22.0.0/16. You must specify an IP prefix in order to see the tag value.
Router# show ip route 10.22.0.0Routing entry for 10.22.0.0/16Known via "isis", distance 115, metric 12Tag 120, type level-1Redistributing via isisLast update from 172.19.170.12 on Ethernet2, 01:29:13 agoRouting Descriptor Blocks:* 172.19.170.12, from 3.3.3.3, via Ethernet2Route metric is 12, traffic share count is 1Route tag 120Static Routes Using a DHCP Gateway Examples
The following example shows that IP route 10.8.8.0 is directly connected to the Internet and is the next-hop (option 3) default gateway. Routes 10.1.1.1 [1/0], 10.3.2.1 [24/0], and 10.2.2.2 [1/0] are static, and route 255.255.255.224/0 is a default route candidate.:
Router# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 10.0.19.14 to network 255.255.255.22468.0.0.0/24 is subnetted, 1 subnetsC 10.8.8.0 is directly connected, Ethernet110.0.0.0/32 is subnetted, 1 subnetsS 10.1.1.1 [1/0] via 10.8.8.110.3.3.3/32 is subnetted, 1 subnetsS 10.3.2.1 [24/0] via 10.8.8.110.10.10.10/32 is subnetted, 1 subnetsS 10.2.2.2 [1/0] via 10.8.8.110.0.0.0/28 is subnetted, 1 subnetsC 10.0.19.0 is directly connected, Ethernet010.2.2.2/24 is subnetted, 1 subnetsC 15.15.15.0 is directly connected, Loopback0S* 255.255.255.224/0 [1/0] via 10.0.19.14Related Commands
Glossary
DHCP server—A server that manages IP addresses from specified address pools within the router to DHCP clients. The Cisco IOS DHCP server is a full DHCP server implementation that assigns and manages IP addresses from specified address pools within the router to DHCP clients. If the Cisco IOS DHCP server cannot satisfy a DHCP request from its own database, it can forward the request to one or more secondary DHCP servers defined by the network administrator.
DHCP client—The Cisco IOS DHCP client can obtain an IP address from a DHCP server dynamically using the DHCP protocol as specified in RFC 2131.
Dynamic Host Configuration Protocol (DHCP)—A protocol that provides a mechanism for dynamically allocating IP addresses, so that addresses can be reused when hosts no longer need them.
Note Refer to Internetworking Terms and Acronyms for terms not included in this glossary.
Copyright © 2004, 2005 Cisco Systems, Inc. All rights reserved.