Microsoft Windows graphic

The IP routing table

Every computer that runs TCP/IP makes routing decisions. These decisions are controlled by the IP routing table. To display the IP routing table on computers running Windows Server 2003 operating systems, you can type route print at a command prompt.

The following table shows an example of an IP routing table. This example is for a computer running XOX with one 10 megabytes (MB) network adapter and the following configuration:

Description Network destination Netmask Gateway Interface Metric
Default route 0.0.0.0 0.0.0.0 10.0.0.1 10.0.0.169 30
Loopback network 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
Local network 10.0.0.0 255.0.0.0 10.0.0.169 10.0.0.169 30
Local IP address 10.0.0.169 255.255.255.255 127.0.0.1 127.0.0.1 30
Multicast addresses 224.0.0.0 240.0.0.0 10.0.0.169 10.0.0.169 30
Limited broadcast address 255.255.255.255 255.255.255.255 10.0.0.169 10.0.0.169 1

Note

The routing table is built automatically, based on the current TCP/IP configuration of your computer. Each route occupies a single line in the displayed table. Your computer searches the routing table for an entry that most closely matches the destination IP address.

Your computer uses the default route if no other host or network route matches the destination address included in an IP datagram. The default route typically forwards an IP datagram (for which there is no matching or explicit local route) to a default gateway address for a router on the local subnet. In the previous example, the default route forwards the datagram to a router with a gateway address of 10.0.0.1.

Because the router that corresponds to the default gateway contains information about the network IDs of the other IP subnets within the larger TCP/IP internet, it forwards the datagram to other routers until the datagram is eventually delivered to an IP router that is connected to the specified destination host or subnet within the larger network.

The following sections describe each of the columns displayed in the IP routing table: network destination, netmask, gateway, interface, and metric.

Network destination

The network destination is used with the netmask to match the destination IP address. The network destination can range from 0.0.0.0 for the default route through 255.255.255.255 for the limited broadcast, which is a special broadcast address to all hosts on the same network segment.

Netmask

The netmask is the subnet mask that is applied to the destination IP address when matching it to the value in the network destination. When netmask is written in binary, a "1" must match and a "0" need not match. For example, a default route uses a 0.0.0.0 netmask that translates to the binary value 0.0.0.0, so bits need not match. A host route—a route that matches an IP address—uses a 255.255.255.255 netmask that translates to the binary value 11111111.11111111.11111111.11111111, so all of the bits must match.

Gateway

The gateway address is the IP address that the local host uses to forward IP datagrams to other IP networks. This is either the IP address of a local network adapter or the IP address of an IP router (such as a default gateway router) on the local network segment.

Interface

The interface is the IP address that is configured on the local computer for the local network adapter that is used when an IP datagram is forwarded on the network.

Metric

A metric indicates the cost of using a route, which is typically the number of hops to the IP destination. Anything on the local subnet is one hop, and each router crossed after that is an additional hop. If there are multiple routes to the same destination with different metrics, the route with the lowest metric is selected.

For information about adding routes to the IP routing table, see To add a static IP route. For information about deleting routes in the IP routing table, see To remove a static IP route.

Multihomed hosts

The following shows the default routing table for a multihomed XOX host with this configuration:

Adapter Description Network destination Netmask Gateway Interface Metric
1 Default route 0.0.0.0 0.0.0.0 10.0.0.1 10.0.0.169 20
2 Default route 0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.200 30
1 Loopback network 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
1 Local network 10.0.0.0 255.0.0.0 10.0.0.169 10.0.0.169 20
1 Local IP address 10.0.0.169 255.255.255.255 127.0.0.1 127.0.0.1 20
2 Local network 192.168.0.0 255.255.0.0 192.168.0.200 192.168.0.200 30
2 Local IP address 192.168.0.200 255.255.255.255 127.0.0.1 127.0.0.1 30
2 Subnet broadcast 192.168.0.255 255.255.255.255 192.168.0.200 192.168.0.200 30
1 Multicast address 224.0.0.0 240.0.0.0 10.0.0.169 10.0.0.169 20
2 Multicast address 224.0.0.0 240.0.0.0 192.168.0.200 192.168.0.200 30
1 Limited broadcast 255.255.255.255 255.255.255.255 10.0.0.169 10.0.0.169 1
2 Limited broadcast 255.255.255.255 255.255.255.255 192.168.0.200 192.168.0.200 1

Note

For information about enabling IP forwarding on a multihomed computer running a Windows Server 2003 operating system, see To enable Routing and Remote Access service.

Notes