Configure Local IP Routing Table
A Windows 2000 Professional computer uses its local IP routing table to determine how to forward an IP packet to reach a designated host. The local routing table can be configured in the following ways:
The routing table is manually maintained at the Windows 2000 Professional-based computer.
The routing table that is automatically maintained at the Windows 2000 Professional-based computer by means of Routing Information Protocol (RIP) broadcasts from routers on the subnet.
The default gateway is manually configured, or specified through the Dynamic Host Configuration Protocol (DHCP).
The default gateway is automatically configured and maintained through Internet Control Message Protocol (ICMP) Router Discovery.
Determine the methods needed to identify gateways and manage routing paths. In an enterprise with multiple subnets, a route to non-local destinations must exist to communicate with hosts in other networks. Windows 2000 Professional supports manual entry of the default gateways and the use of ICMP Router Discovery to find and specify default gateways. Routing is supported by means of manual configuration of the routing table and a Routing Information Protocol (RIP) Listener to permit manual and automated maintenance of the local routing table. Select the methods that reflect your network configuration. See "Overview of IP Routing" later in this chapter.
Configure default gateways. Specify the default gateways to be used to direct IP packets if ICMP Router Discovery-enabled routers or RIP-enabled routers are not available in your network. For multihomed computers, the default gateways are used for all adapters, and you might need to manually configure the local route table for separate default gateways. See "Configure Default Gateways" later in this chapter.
Configure ICMP Router Discovery, if ICMP-enabled routers are available. ICMP Router Discovery automates the discovery and configuration of the default gateways for a Windows 2000 Professional-based client. If ICMP-enabled routers are used within the network, use this method of specifying default gateways. See "Configure ICMP Router Discovery" later in this chapter.
Manually edit the routing table, if necessary. If you want to manually specify the optimal route for IP packets, or have a multihomed computer and need to maintain separate default gateways, use the route command to display, add, and edit the local route tables for your Windows 2000 Professional-based computer. See "Manually Edit the Route Table" later in this chapter.
Install RIP listening support, if RIP-enabled routers are available. RIP-enabled routers simplify administration of the routing tables of Windows 2000 Professional-based clients by automatically updating the routing table as necessary. Enable RIP listening support on the client when RIP is supported in your network. See "Configure RIP Listening Support" later in this chapter.
Multiple TCP/IP networks are interconnected by routers, devices that forward IP packets from one subnet to another.
When IP prepares to send a packet, it inserts the local (source) IP address and the destination address of the packet in the IP header. It then examines the destination address, compares it to a locally maintained route table, and takes appropriate action based on what it finds. There are three possible actions:
IP can pass the packet up to a protocol layer above IP on the local host.
The packet can be forwarded through one of the locally attached network adapters.
The packet can be discarded.
IP finds a match of the destination address in the routing table from the specific to the general in the following order:
An exact match (host route).
A match for the locally attached subnet (subnet route).
A match for the default gateway (default route)
If a default gateway has not been specified, the packet is discarded.
Because the default gateway contains information about the network IDs of the other networks in the internetwork, it can forward the packet to other routers until the packet is eventually delivered to a router connected to the subnet of the destination. This process is known as routing and is illustrated in Figure 22.16.
Figure 22.16 Routing
For each Windows 2000 Professional-based computer on a TCP/IP network, you can maintain a table with an entry for every other computer or network with which the local computer communicates. For a limited number of IP hosts, this method can be used for network interconnectivity. But for most networks this is not a practical solution, due to the large number of IP hosts and networks that must be listed and maintained in the route table. Instead, you can configure other methods to direct IP packets:
IP packets are forwarded to an IP address by using a route table maintained by Router Information Protocol (RIP)-enabled routers.
If your network contains RIP-enabled routers, you can install RIP listening support on the Windows 2000 Professional-based client to permit automatic configuration and maintenance of the local route table.
IP packets are forwarded to a user-specified default gateway, which provides the routing information for the packet.
The gateway address can also be automatically configured by DHCP. Multiple routers can be specified as default gateways.
IP packets are forwarded to a default gateway identified by ICMP Router Discovery.
If your network contains routers that meet the ICMP Router Discovery specifications, defined in RFC 1256, you can configure your Windows 2000 Professional-based computer to "listen" for available gateways.
If the local route table cannot provide a path for handling an IP packet, it is directed to the default gateway. Windows 2000 Professional allows you to specify multiple default gateways. You can list them in order, based on availability, load balancing, or other criteria. You can also assign a value to each gateway, the cost metric, which determines the cost of forwarding an IP packet to the specific router. The lowest metric is the most preferred entry in the routing table.
To specify default gateways
In Control Panel, open Network and Dial-up Connections.
Select the local area connection you want to modify, and then click Properties.
Select Internet Protocol (TCP/IP), click Properties, and then click Advanced.
Under the Default gateways box, click Add.
Type the IP address and metric for the default gateway.
The metric is the cost of using a specified route. The gateway with the lowest metric is used first. The default metric value for each gateway is 1.
Click OK.
Click OK when you have specified all the default gateways for the connection.
Gateway addresses and metrics can also be provided by means of a DHCP server. Gateway configuration information specified in the connection properties override addresses provided through DHCP. For information about configuring DHCP, see "Configure DHCP" in this chapter.
Configure ICMP Router Discovery
As specified in RFC 1256, Windows 2000 provides host support for ICMP Router Discovery. Router discovery provides an improved method of detecting and configuring default gateways. Instead of configuring a default gateway manually or through DHCP, Windows 2000-based computers can dynamically discover the best default gateway to use on their subnet and can automatically switch to another default gateway if the current default gateway fails or the network administrator changes router preferences.
When a Windows 2000 Professional-based computer configured for ICMP Router Discovery initializes, it joins the all-hosts IP multicast group (224.0.0.1) and listens for ICMP Router Advertisement messages. RFC 1256-compliant routers periodically send ICMP Router Advertisements containing their IP address, a preference level, and a time after which they can be considered down. Hosts receive the ICMP Router Advertisements and select the router with the highest preference level as their default gateway.
A Windows 2000 Professional-based computer can also send ICMP Router Solicitation messages to the all-routers IP multicast address (224.0.0.2) at initialization or when it has not received a router advertisement from the router for the current default gateway within the router's advertised lifetime. Windows 2000-based hosts send a maximum of three solicitations at intervals of approximately 600 milliseconds.
ICMP Router Discovery is determined by the values of two registry entries PerformRouterDiscovery in the subkey HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters and SolicitationAddressBcast in the subkey HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesadapternameParametersTcpip. To enable ICMP Router Discovery, add the two entries to the registry, each with a value of 0x1 (REG_DWORD).
The Router Advertisement parameters are controlled from a RFC 1256-compliant router. Windows 2000 Server and the Routing and Remote Access service support router discovery. For more information, see "Unicast IP Routing" in the Internetworking Guide.
There are several instances where you might need to manually edit the local route table for your Windows 2000 Professional-based computer:
The computer has multiple network adapters (multihomed), and must access different default gateways for each adapter.
If your computer is multihomed and has connections to two separate IP networks, such as the corporate network and the Internet, the default gateway for only one network is used. For the computer to be able to communicate with the other network, routes must be manually added to the route table.
The computer is multihomed, and has no access to a default gateway.
The computer in this case must provide the routing information to send IP packets from one network to the next, because no router is provided to perform this task.
The required routing information is not provided by any default gateway, or a different route is wanted.
You can display the current route table to determine whether any changes are required. To see the route table for your computer, at the command prompt type route print.
The following example is a sample route table from a single-homed Windows 2000 Professional-based computer.
route print ======================================================================== Interface List 0x1 ........................... MS TCP Loopback interface 0x2000002 ...00 c0 4f 49 f3 b2 ...... 3Com EtherLink PCI (QoS Packet Scheduler) ======================================================================== ======================================================================== Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 157.59.0.1 157.59.4.120 1 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 157.59.0.0 255.255.248.0 157.59.4.120 157.59.4.120 1 157.59.4.120 255.255.255.255 127.0.0.1 127.0.0.1 1 157.59.255.255 255.255.255.255 157.59.4.120 157.59.4.120 1 224.0.0.0 224.0.0.0 157.59.4.120 157.59.4.120 1 255.255.255.255 255.255.255.255 127.0.0.1 127.0.0.1 1 Default Gateway: 157.59.0.1 ======================================================================== Persistent Routes: None |
This example shows a computer with the IP address 157.59.4.120, subnet mask of 255.255.248.0, and a default gateway of 157.59.0.1. The table contains the following seven entries:
The first entry is the default route. This is the route to which the computer sends IP packets when the other route entries do not specify where to send them.
The second entry is the loopback route. This is the route a host uses when sending packets to itself.
The third entry is a subnet route for the locally attached subnet.
The fourth entry is a host route for the local host (the route for this host computer).
The fifth entry is a host route for a special type of IP broadcast address called the all-subnets directed broadcast.
The sixth entry is the IP multicast route. This is the route used when the computer sends packets to reach an IP multicast group.
The seventh entry is a host route for the limited broadcast address.
The following sections describe the columns shown in the "Active Routes" section of the net print command.
Network Address
The network address in the route table is the destination address. The network address column can have three different types of entries, listed here in the order in most to least specific.
Host address (a route to a single, specific destination IP address).
Subnet address (a route to a subnet).
Default route (a route used when there is no other match).
If no match is found, the packets are discarded.
Netmask
The netmask defines which portion of the network address must match in order for that route to be used. When the mask is written in binary, a 1 indicates a bit that must match and a 0 indicates a bit that does not have to match.
For example, the mask of all 255s (all 1s) means that the destination address of the packet to be routed must exactly match the network address in order for this route to be used. For another example, if the network address 172.20.232.0 has a netmask of 255.255.255.0, then the first three octets must match exactly, but the last octet need not match.
Gateway Address
The gateway address is the forwarding IP address of where the packet must be sent. This can be the IP address of the host or the address of a gateway (router) on the local subnet. If the gateway address of the route is the host IP address, then the forwarding IP address is set to the destination IP address in the IP datagram.
Interface
The interface is the address of the network adapter over which the packet must be sent. 127.0.0.1 is the software loopback address.
Metric
The metric indicates the cost of the route and is commonly the number of hops to the destination. Anything on the local subnet is one hop, and each router crossed after that is an additional hop. The metric is used to determine the best route among multiple routes that most closely match the destination.
To add static routes, use the following format:
Route add <subnet> mask <netmask> <gateway> metric <metric> if <interface> |
The following is an example route:
Route add 172.20.255.0 mask 255.255.255.0 172.20.234.232 metric 2 if 3 |
The route in this example means that to get to the subnet 172.20.255.0 with a mask of 255.255.255.0, use gateway 172.20.234.232, and that the route has a cost metric of 2 (for example, the subnet is 2 hops away), using interface 3.
Manual maintenance of route tables is error-prone. An error in one of the routes can prevent accessibility to a network location. Additionally, the status of many routes is dynamic—routers can go down or online, new routers might be added, or the metric of a route might change. Each change in the status of a route necessitates an equivalent alteration in the route table. Finally, the challenges of manually maintaining local route tables is multiplied when supporting a large number of computers in a department or enterprise.
Configure RIP Listening Support
To address the challenges of supporting routing in an enterprise environment, Routing Information Protocol, or RIP, can be used. If one or more of the routers on the subnet uses RIP to send routing information, the computer can be configured to "listen in" to RIP messages. Your computer can learn other routes on the network by listening to RIP messages and then add the appropriate routes to the IP routing table. This process is called RIP listening or silent RIP.
Network administrators can use RIP listening on multihomed hosts to solve the multiple default gateway problem without manually adding routes to the route table. Figure 22.17 shows an example of a multihomed host that uses RIP listening.
Figure 22.17 Multihomed Host Using RIP Listening
Router 2 sends RIP messages, and the Windows 2000 Professional-based computer listens in on those messages. Router 1 does not send RIP messages, so the Windows 2000 Professional-based computer is configured to use Router 1 as the default gateway. Thus, the Windows 2000 Professional-based computer can communicate with hosts on both networks without the use of ICMP Redirect messages from Router 1.
The route table chosen by the Windows 2000 Professional-based host computer is based on the hop count of the sending RIP server. The hop count is the number of routers that must be crossed in order to reach the wanted destination. The hop count is used as the metric, or the measurement by which routes are selected. Routes with the lowest metric are selected first.
Windows 2000 Professional supports routers using either RIP version 1 or RIP version 2 as long as the RIP messages are sent as subnet-level broadcasts. RIP v2 messages sent as multicasts are not received by the RIP listener.
RIP listening support is installed as an optional service to Windows 2000 Professional.
To install RIP listening support
In Control Panel, double-click Add and Remove Programs.
Select Add/Remove Windows Components.
In the Windows Component wizard, click Next.
Select Networking Services.
Click Details.
Select the RIP Listener check box.
Click OK.
Click Next.