[Contents] [Prev] [Next] [Index] [Report an Error]


IP Routing

The Internet is a large collection of hosts that communicate with each other and use routers as intermediate packet switches.

Routers forward a packet through the interconnected system of networks and routers until the packet reaches a router that is attached to the same network as the destination host. The router delivers the packet to the specified host on its local network.

Routing Tables

A router makes forwarding decisions based on the information that is contained in the router's routing table. Routers announce and receive route information to and from other routers. They build routing tables based on the collected information on all the best paths to all the destinations they know how to reach.

Figure 2-8 shows an example of a small network composed of four networks and three routers. The hosts that are attached to each network are not displayed, because each router makes its forwarding decisions based on the network number and not the address of each individual host. A router uses ARP to find the physical address that corresponds to the Internet address for any host or router on networks directly connected to it.


Figure 2-8 Routers in a small internet

The routing tables are shown in the following tables for routers Boston, NY, and LA. The routing tables contain one entry for each route. The columns of the routing table include:

Table 2-1 Routing table for router NY 
Destination Network
Next-Hop Router
Administrative Distance
Metric
192.10.0.0
Router NY
0
0
192.20.0.0
Router NY
1
0
192.30.0.0
192.20.0.3
110
1
192.40.0.0
192.20.0.3
120
2

Table 2-2 Routing table for router Boston 
Destination Network
Next-Hop Router
Administrative Distance
Metric
192.10.0.0
192.20.0.2
110
1
192.20.0.0
Router Boston
0
0
192.30.0.0
Router Boston
1
0
192.40.0.0
192.30.0.3
120
1

Table 2-3 Routing table for router LA  
Destination Network
Next-Hop Router
Administrative Distance
Metric
192.10.0.0
192.30.0.2
110
2
192.20.0.0
192.30.0.2
110
1
192.30.0.0
Router LA
0
0
192.40.0.0
Router LA
1
0

Setting the Administrative Distance for a Route

The administrative distance is an integer that is associated with each route known to a router. The distance represents how reliable the source of the route is considered to be. A lower value is preferred over a higher value. An administrative distance of 255 indicates no confidence in the source; routes with this distance are not installed in the routing table.

Table 2-4 shows the default distance for each type of source from which a route can be learned.

Table 2-4 Default administrative distances for route sources 
Route Source
Default Distance
Connected interface
0
Static route
1
Internal access route
2
Access route
3
External BGP
20
OSPF
110
IS-IS
115
RIP
120
Internal BGP
200
Unknown
255

If the IP routing table contains several routes to the same prefix—for example, an OSPF route and a RIP route—the route with the lowest administrative distance is used for forwarding.

To set the administrative distance for BGP routes, see Setting the Administrative Distance for a Route in ERX Routing Protocols Configuration Guide, Vol. 2, Chapter 1, Configuring BGP Routing.

To set the administrative distance for RIP, IS-IS, and OSPF, use the following distance commands in Router Configuration mode.

    distance

host1(config)#router rip
host1(config-router)#distance 100 

    distance ip

host1(config)#router isis
host1(config-router)#distance 80 ip 

Routing Operations

Routers keep track of next-hop information that enables a data packet to reach its destination through the network. A router that does not have a direct physical connection to the destination checks its routing table and forwards packets to another next-hop router that is closer to that destination. This process continues until the packet reaches its final destination.

Identifying a Router Within an Autonomous System

The router ID is commonly one of the router's defined IP addresses. Although the router ID is, by convention, formatted as an IP address, it is not required to be a configured address of the router. If you do not use the ip router-id command to assign a router ID, the system uses one of its configured IP addresses as the router ID.

    ip router-id

host1(config)#ip router-id 192.32.15.23

Establishing a Static Route

You can set a destination to receive and send traffic by a specific route through the network.

    ip route

host1(config)#ip route 192.56.15.23 255.255.255.0 192.66.0.1

Setting Up Default Routes

A router examines its routing table to find a path for each packet. If the router cannot locate a route, it must discard the packet. You can set up a default route using the special address: 0.0.0.0. If the router cannot locate a path to a destination network and a default route is defined, the system forwards the packet to the default router. For example:

host1(config)#ip route 0.0.0.0 0.0.0.0 192.56.21.3

Default routes are typically used to reduce the size of the routing table. Routing is simplified because the router can test for a few local networks or use the default route. However, a disadvantage of default routes is the possible creation of multiple paths and routing loops.

Setting Up an Unnumbered Interface

An unnumbered interface does not have an IP address assigned to it. Unnumbered interfaces are often used in point-to-point connections where an IP address is not required.

    ip unnumbered

host1(config-if)#ip unnumbered fastEthernet 0/0

Adding a Host Route to a Peer on a PPP Interface

You can enable the ability to create host access routes on a PPP interface. This feature is useful in B-RAS applications.

    ip access-routes

host1(config-if)#ip access-routes

Enabling Source Address Validation

Source address validation verifies that a packet has been sent from a valid source address. When a packet arrives on an interface, the system performs a routing table lookup using the source address. The result from the routing table lookup is an interface to which packets destined for that address are routed. This interface must match the interface on which the packet arrived. If it does not match, the system drops the packet.

    ip sa-validate

host1(config-if)#ip sa-validate

Shutting Down an IP Interface

The system lets you disable an interface at the IP level without removing it.

    ip shutdown

host1(config-if)#ip shutdown

Removing the IP Configuration

You can remove the IP configuration from an interface or subinterface.

    no ip interface

host1(config-if)#no ip interface 

Clearing IP Routes

The system enables you to clear the specified routing entries from the routing table. You must specify the IP address prefix and the mask of the IP address prefix to clear specific routes. You can later reinstall the routes you have cleared.

    clear ip routes

host1#clear ip routes *

    ip refresh-route

host1#ip refresh-route 

Clearing IP Interfaces

The system enables you to clear the counters on the specified IP interface(s).

    clear ip interface

host1#clear ip interface pos 2/0

Setting a Baseline

The system enables you to set a baseline for statistics on an IP interface.

    baseline ip interface

host1#baseline ip interface pos 2/0

Disabling Forwarding of Packets

The system allows you to disable forwarding of packets on an SRP Ethernet interface.

    ip disable-forwarding

host1(config-if)#ip disable-forwarding

Enabling Forwarding of Source-Routed Packets

IP packets are normally routed according to the destination address they contain based on the routing table at each hop through a path. The originator or source of the source-routed packets specifies the path (the series of hops) that the packets must traverse; the source makes the routing decisions. The source can specify either of the following types of source routing:

    ip source-route

host1#ip source-route

Forcing an Interface to Appear Up

The system enables you to force an IP interface to appear as if it is up, regardless of the state of the lower layers.

    ip alwaysup

host1(config-if)#ip alwaysup

Specifying a Debounce Time

You can set a debounce time that requires an IP interface to be in a given state—for example, up or down—for the specified time before the state is reported. This feature prevents a link that briefly goes up or down from causing an unnecessary topology change, for example by causing an interface down condition.

    ip debounce-time

host1(config)#ip debounce-time 5000

Adding a Description

The system enables you to add a text description or an alias to an IP interface or subinterface. Adding a description helps you identify the interface and keep track of interface connections.



Note: The ip description command is replacing the description command to assign a description to an IP interface. The description command may be removed completely for this purpose in a future release.

    ip description

host1(config-if)#ip description canada01 ip interface
host1(config-subif)#ip description montreal011 ip 
subinterface

Enabling Link Status Traps

The system allows you to enable link status traps on an interface.

    snmp trap ip link-status

host1(config-if)#snmp trap ip link-status

Configuring the Speed

The system enables you to set the speed of an IP interface.

    ip speed

host1(config-if)#ip speed 1000

Configuring Equal-Cost Multipath Load Sharing

Equal-cost multipath (ECMP) sets are formed when the system finds routing table entries for the same destination with equal cost. You can add routing table entries manually (as static routes), or they are formed as routers discover their neighbors and exchange routing tables (via OSPF, BGP, and other routing protocols). The system then balances traffic across these sets of equal-cost paths using one of the following ECMP modes:

    ip multipath round-robin

host1(config)#virtual-router router_0
host1:router_0(config)#interface serial 4/0:1/22.22
host1:router_0(config-subif)#ip multipath round-robin
host1:router_0(config-subif)#exit
host1:router_0(config)#exit
host1:router_0#show ip interface serial 4/0:1/22.22
serial4/0:1/22.22 is up, line protocol is up
  Network Protocols: IP
  Internet address is 190.121.1.1/255.255.0.0
  Broadcast address is 255.255.255.255
  Operational MTU = 1600  Administrative MTU = 0
  Operational speed = 64000  Administrative speed = 0
  Router advertisement = disabled
  Administrative debounce-time = disabled
  Operational debounce-time    = disabled
  Access routing = disabled
  Multipath mode = round-robin

  In Received Packets 0, Bytes 0
  In Policed Packets 0, Bytes 0
  In Error Packets 0
  In Invalid Source Address Packets 0
  Out Forwarded Packets 0, Bytes 0
  Out Scheduler Drops Packets 0, Bytes 0 

    maximum-paths

host1(config-router)#maximum-paths 2

Setting a TTL Value

You can use the ip ttl command to set the TTL (time-to-live) field in the IP header for all IP operations. The TTL specifies a hop count. This configured TTL value can be overridden by other commands that specify a TTL.

    ip ttl

host1(config)#ip ttl 255

[Contents] [Prev] [Next] [Index] [Report an Error]