An IP router, or gateway , is a device that has more than one network adapter and thus is connected to multiple subnets. Routers can pass packets between the subnets, allowing them to act as a contiguous network. Routers can be either dedicated hardware devices or software services on hosts.
Any Windows NT or Windows 2000 computer can act as an IP router if it has multiple network interfaces attached to two or more subnets. This type of node is referred to as a multihomed computer.
There are two basic types of IP routing: static routing uses a fixed routing table specifying available destinations, and dynamic routing maintains a routing table dynamically by communicating with other routers. These are examined in the sections that follow.
In static routing, a routing table stores information about available destinations and the gateway (router) they can be reached through. Routing tables are not exchanged between routers in any way, so the routes must be specified for each multihomed computer.
The route
command, described later in this
section, allows you to modify or display the routing table. Type
route
print
to display the
current routing table. The following is an example of a simple
routing table:
The route table includes the following fields:
The subnet mask corresponding to the network address.
The IP address of the gateway (router) that connects to the specified subnet.
The IP address of the interface card in the local computer that connects to the gateway.
The number of hops (cost) for the route. This number is used to optimize routes.
Each Windows NT or 2000 client has a Default Gateway address defined in the IP Address tab of the TCP/IP Properties dialog. The Advanced button in that dialog allows a number of gateways to be listed in order of priority. The Default Gateway list can also be received by a DHCP client.
The Default Gateway is listed in the route table with a network address of 0.0.0.0. The defined gateways are used in order when no explicit route is found in the route table for a destination network.
In a network with only two subnets, you can create a functional static route setup with only the Default Gateway parameter. Configure a multihomed computer on each subnet as a router and enter each machine in the other’s Default Gateway field. In this scheme all destinations not recognized as part of the local subnet are automatically sent to the other subnet.
Dynamic routing uses a routing protocol (rather than a manually configured routing table) to exchange information between routers. Two routing protocols are widely supported on today’s networks and the Internet: RIP and OSPF. These are described in the following sections.
RIP was formally documented in RFC 1058 and then expanded in RFCs 1387-1389. RIP is the most popular routing protocol in use today. RIP is a distance vector routing protocol , meaning that the primary information routers exchange is a measure of the distance (in hops) between destinations, and these distances are used to calculate optimal routes.
RIP keeps an internal routing table similar to the table used for static routing, but the table is maintained strictly by receiving updates from adjacent routers. The following information is maintained for each entry in the RIP database:
The IP address of the host or network the route points to.
The first router (gateway) to which packets should be sent in order to reach the destination.
The IP address of the network adapter in the local machine that is connected to the gateway’s subnet.
A measure of the number of hops required to reach the destination, or cost. Metric values range from 1 to 15.
A measure of the amount of time since the record was updated.
Along with Version 1 of RIP, supported by Windows NT, Windows 2000 supports RIP Version 2. RIP v2 improves on v1 by sending updates only when routes change and, also, supports a basic form of router authentication.
OSPF is documented in RFC 1131 (Version 1) and RFC 1247 (Version 2). OSPF is a link state routing protocol , meaning that routing is based not only on distance, but also on the current status of links in the network.
OSPF is an autonomous system, meaning that all routers use the same algorithm and a copy of the same database. Each OSPF router keeps a database that keeps track of the entire routing system and receives updates from other routers. OSPF is considered superior to RIP for most purposes, but has not yet been implemented as widely.
You can configure a Windows 2000
computer acting as a static router by using the
route
command. This command can display
routing information, add entries, or modify or delete entries in the
static routing table. The options of the route
command are described in Table 18-9.
Table 18-9. Route command options
Dynamic routing, like many other Windows 2000 features, is managed through Microsoft Management Console (MMC). To configure routing, select Programs → Administrative Tools → Routing and Remote Access from the Start menu. The Routing and Remote Access MMC snap-in is displayed, as shown in Figure 18-3.
From this dialog, you can manage one or more servers designated as routers. Select Add Server from the Action menu to add a server to the list; the local computer is normally on the list by default in Windows 2000 Server.
To initially configure routing, select Configure and Enable Routing and Remote Access from the Action menu. This prompts you with a series of dialogs to configure routing:
A welcome screen is displayed. Click Next.
A variety of options, such as Remote Access Server and Internet Connection Server, are displayed. Select Network Router and click Next.
A list of current protocols is displayed, and you can optionally add protocols. If TCP/IP is already on the list, simply click Next.
Choose whether to allow demand-dial connections, which use dial-up networking to route to a remote network. This option is disabled by default. Click Next.
A final screen is displayed. Click Finished to complete the installation process. This starts the routing services and returns you to the Routing and Remote Access console.
After routing is installed, you can access the following options under each server in the console:
Displays a list of network adapters that can be used for routing. You can add a new entry for a demand-dial route or an IP tunneling (PPTP) route.
Displays statistics for each enabled router interface, including bytes sent and received and operational status. Right-click on an interface to access additional information dialogs, such as Show IP Routing Table, which displays the current static or dynamic route table.
Provides an interface to the static routing table as an alternative
to the route
command, described earlier in this
section. Right-click to add a new static route or right-click on a
highlighted route to remove or modify it.