Information About Configuring IP Unicast Routing
Information About Configuring IP Unicast Routing
Note In addition to IPv4 traffic, you can also enable IP Version 6 (IPv6) unicast routing and configure interfaces
to forward IPv6 traffic .
This figure shows a basic routing topology. Switch A is in VLAN 10, and Switch B is in VLAN 20. The router
Types of Routing
Routers and Layer 3 switches can route packets in these ways:
• By using default routing
• By using preprogrammed static routes for the traffic
• By dynamically calculating routes by using a routing protocol
Classless Routing
By default, classless routing behavior is enabled on the Device when it is configured to route. With classless
routing, if a router receives packets for a subnet of a network with no default route, the router forwards the
packet to the best supernet route. A supernet consists of contiguous blocks of Class C address spaces used to
simulate a single, larger address space and is designed to relieve the pressure on the rapidly depleting Class
B address space.
In the figure, classless routing is enabled. When the host sends a packet to 120.20.4.1, instead of discarding
the packet, the router forwards it to the best supernet route. If you disable classless routing and a router receives
packets destined for a subnet of a network with no network default route, the router discards the packet.
Figure 2: IP Classless Routing
In the figure , the router in network 128.20.0.0 is connected to subnets 128.20.1.0, 128.20.2.0, and 128.20.3.0.
If the host sends a packet to 120.20.4.1, because there is no network default route, the router discards the
packet.
Figure 3: No IP Classless Routing
To prevent the Device from forwarding packets destined for unrecognized subnets to the best supernet route
possible, you can disable classless routing behavior.
Address Resolution
You can control interface-specific handling of IP by using address resolution. A device using IP can have
both a local address or MAC address, which uniquely defines the device on its local segment or LAN, and a
network address, which identifies the network to which the device belongs.
The local address or MAC address is known as a data link address because it is contained in the data link
layer (Layer 2) section of the packet header and is read by data link (Layer 2) devices. To communicate with
a device on Ethernet, the software must learn the MAC address of the device. The process of learning the
MAC address from an IP address is called address resolution. The process of learning the IP address from
the MAC address is called reverse address resolution.
The Device can use these forms of address resolution:
• Address Resolution Protocol (ARP) is used to associate IP address with MAC addresses. Taking an IP
address as input, ARP learns the associated MAC address and then stores the IP address/MAC address
association in an ARP cache for rapid retrieval. Then the IP datagram is encapsulated in a link-layer
frame and sent over the network. Encapsulation of IP datagrams and ARP requests or replies on IEEE
802 networks other than Ethernet is specified by the Subnetwork Access Protocol (SNAP).
• Proxy ARP helps hosts with no routing tables learn the MAC addresses of hosts on other networks or
subnets. If the Device (router) receives an ARP request for a host that is not on the same interface as the
ARP request sender, and if the router has all of its routes to the host through other interfaces, it generates
a proxy ARP packet giving its own local data link address. The host that sent the ARP request then sends
its packets to the router, which forwards them to the intended host.
The Device also uses the Reverse Address Resolution Protocol (RARP), which functions the same as ARP
does, except that the RARP packets request an IP address instead of a local MAC address. Using RARP
requires a RARP server on the same network segment as the router interface. Use the ip rarp-server address
interface configuration command to identify the server.
Proxy ARP
Proxy ARP, the most common method for learning about other routes, enables an Ethernet host with no routing
information to communicate with hosts on other networks or subnets. The host assumes that all hosts are on
the same local Ethernet and that they can use ARP to learn their MAC addresses. If a Device receives an ARP
request for a host that is not on the same network as the sender, the Device evaluates whether it has the best
route to that host. If it does, it sends an ARP reply packet with its own Ethernet MAC address, and the host
that sent the request sends the packet to the Device, which forwards it to the intended host. Proxy ARP treats
all networks as if they are local, and performs ARP requests for every IP address.
merely keeps track of which systems are sending the data. The advantage of using IRDP is that it allows each
router to specify both a priority and the time after which a device is assumed to be down if no further packets
are received.
Each device discovered becomes a candidate for the default router, and a new highest-priority router is selected
when a higher priority router is discovered, when the current default router is declared down, or when a TCP
connection is about to time out because of excessive retransmissions.
Note You can also limit broadcast, unicast, and multicast traffic on Layer 2 interfaces
by using the storm-control interface configuration command to set traffic
suppression levels.
Routers provide some protection from broadcast storms by limiting their extent to the local cable. Bridges
(including intelligent bridges), because they are Layer 2 devices, forward broadcasts to all network segments,
thus propagating broadcast storms. The best solution to the broadcast storm problem is to use a single broadcast
address scheme on a network. In most modern IP implementations, you can set the address to be used as the
broadcast address. Many implementations, including the one in the Device, support several addressing schemes
for forwarding broadcast messages.
IP Broadcast Flooding
You can allow IP broadcasts to be flooded throughout your internetwork in a controlled fashion by using the
database created by the bridging STP. Using this feature also prevents loops. To support this capability,
bridging must be configured on each interface that is to participate in the flooding. If bridging is not configured
on an interface, it still can receive broadcasts. However, the interface never forwards broadcasts it receives,
and the router never uses that interface to send broadcasts received on a different interface.
Packets that are forwarded to a single network address using the IP helper-address mechanism can be flooded.
Only one copy of the packet is sent on each network segment.
To be considered for flooding, packets must meet these criteria. (Note that these are the same conditions used
to consider packet forwarding using IP helper addresses.)
• The packet must be a MAC-level broadcast.
• The packet must be an IP-level broadcast.
• The packet must be a TFTP, DNS, Time, NetBIOS, ND, or BOOTP packet, or a UDP specified by the
ip forward-protocol udp global configuration command.
• The time-to-live (TTL) value of the packet must be at least two.
A flooded UDP datagram is given the destination address specified with the ip broadcast-address interface
configuration command on the output interface. The destination address can be set to any address. Thus, the
destination address might change as the datagram propagates through the network. The source address is never
changed. The TTL value is decremented.
When a flooded UDP datagram is sent out an interface (and the destination address possibly changed), the
datagram is handed to the normal IP output routines and is, therefore, subject to access lists, if they are present
on the output interface.
In the Device, the majority of packets are forwarded in hardware; most packets do not go through the Device
CPU. For those packets that do go to the CPU, you can speed up spanning tree-based UDP flooding by a
factor of about four to five times by using turbo-flooding. This feature is supported over Ethernet interfaces
configured for ARP encapsulation.
Note The switch does not support tunnel interfaces for unicast routed traffic.
All Layer 3 interfaces on which routing will occur must have IP addresses assigned to them.
Note A Layer 3 switch can have an IP address assigned to each routed port and SVI.
IP host Disabled.
IRDP Disabled.
Defaults when enabled:
• Broadcast IRDP advertisements.
• Maximum interval between advertisements: 600
seconds.
• Minimum interval between advertisements: 0.75
times max interval
• Preference: 0.
IP routing Disabled.
IP subnet-zero Disabled.
Procedure
Device> enable
Step 3 interface interface-id Enters interface configuration mode, and specifies the
Layer 3 interface to configure.
Example:
Device(config-if)# no switchport
Step 5 ip address ip-address subnet-mask Configures the IP address and IP subnet mask.
Example:
Device(config-if)# no shutdown
Device(config)# end
Step 11 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 ip subnet-zero Enables the use of subnet zero for interface addresses and
routing updates.
Example:
Device(config)# ip subnet-zero
Device(config)# end
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Device(config)#no ip classless
Device(config)# end
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 arp ip-address hardware-address type Associates an IP address with a MAC (hardware) address
in the ARP cache, and specifies encapsulation type as one
Example:
of these:
Device(config)# ip 10.1.5.1 c2f3.220a.12f4 arpa • arpa—ARP encapsulation for Ethernet interfaces
• snap—Subnetwork Address Protocol encapsulation
for Token Ring and FDDI interfaces
Step 4 arp ip-address hardware-address type [alias] (Optional) Specifies that the switch respond to ARP
requests as if it were the owner of the specified IP address.
Example:
Step 5 interface interface-id Enters interface configuration mode, and specifies the
interface to configure.
Example:
Step 6 arp timeout seconds (Optional) Sets the length of time an ARP cache entry will
stay in the cache. The default is 14400 seconds (4 hours).
Example:
The range is 0 to 2147483 seconds.
Device(config-if)# arp 20000
Device(config)# end
Step 8 show interfaces [interface-id] Verifies the type of ARP and the timeout value used on
all interfaces or a specific interface.
Example:
Step 11 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 interface interface-id Enters interface configuration mode, and specifies the Layer
3 interface to configure.
Example:
Device(config)# end
Step 6 show interfaces [interface-id] Verifies ARP encapsulation configuration on all interfaces
or the specified interface.
Example:
Step 7 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 interface interface-id Enters interface configuration mode, and specifies the Layer
3 interface to configure.
Example:
Device(config-if)# ip proxy-arp
Device(config)# end
Step 6 show ip interface [interface-id] Verifies the configuration on the interface or all interfaces.
Example:
Step 7 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Proxy ARP
Proxy ARP is enabled by default. To enable it after it has been disabled, see the “Enabling Proxy ARP” section.
Proxy ARP works as long as other routers support it.
Default Gateway
Another method for locating routes is to define a default router or default gateway. All non-local packets are
sent to this router, which either routes them appropriately or sends an IP Control Message Protocol (ICMP)
redirect message back, defining which local router the host should use. The Device caches the redirect messages
and forwards each packet as efficiently as possible. A limitation of this method is that there is no means of
detecting when the default router has gone down or is unavailable.
Procedure
Device> enable
Device(config)# end
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 interface interface-id Enters interface configuration mode, and specifies the
Layer 3 interface to configure.
Example:
Device(config-if)# ip irdp
Step 6 ip irdp holdtime seconds (Optional) Sets the IRDP period for which advertisements
are valid. The default is three times the maxadvertinterval
Example:
value. It must be greater than maxadvertinterval and
cannot be greater than 9000 seconds. If you change the
Device(config-if)# ip irdp holdtime 1000
maxadvertinterval value, this value also changes.
Step 7 ip irdp maxadvertinterval seconds (Optional) Sets the IRDP maximum interval between
advertisements. The default is 600 seconds.
Example:
Step 8 ip irdp minadvertinterval seconds (Optional) Sets the IRDP minimum interval between
advertisements. The default is 0.75 times the
Example:
maxadvertinterval. If you change the maxadvertinterval,
this value changes to the new default (0.75 of
Device(config-if)# ip irdp minadvertinterval 500
maxadvertinterval).
Step 9 ip irdp preference number (Optional) Sets a device IRDP preference level. The
allowed range is –231 to 231. The default is 0. A higher
Example:
value increases the router preference level.
Device(config-if)# ip irdp preference 2
Step 10 ip irdp address address [number] (Optional) Specifies an IRDP address and preference to
proxy-advertise.
Example:
Device(config)# end
Step 13 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 interface interface-id Enters interface configuration mode, and specifies the
interface to configure.
Example:
Device(config-if)# exit
Step 6 ip forward-protocol {udp [port] | nd | sdns} Specifies which protocols and ports the router forwards
when forwarding broadcast packets.
Example:
• udp—Forward UPD datagrams.
Device(config)# ip forward-protocol nd
port: (Optional) Destination port that controls which
UDP services are forwarded.
• nd—Forward ND datagrams.
• sdns—Forward SDNS datagrams
Device(config)# end
Step 8 show ip interface [interface-id] Verifies the configuration on the interface or all interfaces
Example:
Step 10 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 interface interface-id Enters interface configuration mode, and specifies the
Layer 3 interface to configure.
Example:
Step 4 ip helper-address address Enables forwarding and specifies the destination address
for forwarding UDP broadcast packets, including BOOTP.
Example:
Device(config-if)# exit
Step 6 ip forward-protocol {udp [port] | nd | sdns} Specifies which protocols the router forwards when
forwarding broadcast packets.
Example:
Device(config)# end
Step 8 show ip interface [interface-id] Verifies the configuration on the interface or all interfaces.
Example:
Step 10 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Procedure
Device> enable
Step 3 interface interface-id Enters interface configuration mode, and specifies the
interface to configure.
Example:
Step 4 ip broadcast-address ip-address Enters a broadcast address different from the default, for
example 128.1.255.255.
Example:
Device(config-if)# ip broadcast-address
128.1.255.255
Device(config)# end
Step 7 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Flooding IP Broadcasts
Procedure
Device> enable
Step 3 ip forward-protocol spanning-tree Uses the bridging spanning-tree database to flood UDP
datagrams.
Example:
Device(config)# end
Device(config)# end
Step 11 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
clear arp-cache Clears the IP ARP cache and the fast-switching cache.
clear host {name | *} Removes one or all entries from the hostname and the
address cache.
clear ip route {network [mask] | *} Removes one or more routes from the IP routing table.
You can display specific statistics, such as the contents of IP routing tables, caches, and databases; the
reachability of nodes; and the routing path that packets are taking through the network. The Table lists the
privileged EXEC commands for displaying IP statistics.
show ip masks address Displays the masks used for network addresses and
the number of subnets using each mask.
show ip route [address [mask]] | [protocol] Displays the current state of the routing table.
show ip route summary Displays the current state of the routing table in
summary form.
Procedure
Device> enable
Device(config)# ip routing
Device(config)# end
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Device(config-router)# end
What to Do Next
You can now set up parameters for the selected routing protocols as described in these sections:
• RIP
• OSPF,
• EIGRP
• BGP
• Unicast Reverse Path Forwarding
• Protocol-Independent Features (optional)
Command Purpose
show ip route summary Displays the current state of the routing table in
summary form.
IP Unicast Routing Cisco IOS XE Everest 16.6.1 This feature was introduced