Configuring IPv4 and IPv6 routing

The term "router" in this chapter refers to both routers and Layer 3 switches.

Overview

A router selects an appropriate route according to the destination address of a received packet and forwards the packet to the next router. The last router on the path is responsible for sending the packet to the destination host. Routing provides the path information that guides the forwarding of packets.

Routing table

A router selects optimal routes from the routing table, and sends them to the forwarding information base (FIB) table to guide packet forwarding. Each router maintains a routing table and a FIB table.

Routes discovered by different routing protocols are available in a routing table and they can be divided into the following categories by origin:

Direct routes—Routes discovered by data link protocols, also known as "interface routes."

Static routes—Manually configured routes. Static routes are easy to configure and require fewer system resources. They work well in small and stable networks, but cannot adjust to network changes, so you must manually configure the routes again whenever the network topology changes.

Dynamic routes—Routes that are discovered dynamically by routing protocols.

Each entry in the FIB table specifies a physical interface that packets destined for a certain address should go out to reach the next hop—the next router—or the directly connected destination.

A route entry includes the following items:

Destination IP address—Destination IP address or destination network.

Mask (IPv4)/prefix length (IPv6)—Specifies, together with the destination address, the address of the destination network. A logical AND operation between the destination address and the network mask/prefix length yields the address of the destination network.

Preference—Routes to the same destination might be discovered by various routing protocols or manually configured, and routing protocols and static routes have different preferences configured. The route with the highest preference (the smallest value) is optimal.

Outbound interface—Specifies the interface through which a matching IP packet is to be forwarded.

Next hop—Specifies the address of the next hop router on the path.

Static route

Static routes are manually configured. If a network's topology is simple, you only need to configure static routes for the network to work correctly.

278