pc micro systems

Order License
User's Guide
About Us

NetModem Client and the Routing Table


To make Microsoft's Dial-Up Networking (DUN) function with a remote modem over a network, NetModem Client may need to manipulate the client PC's routing table.  Depending upon several factors including the number of network cards present in the PC, the entries in the routing table, and the location of the server there may be situations where NetModem Client is unable to correctly configure the routing table.  With an understanding of this issue, the problem may be fixed by manually adjusting the TCP/IP routing table.


NetModem Client automatically reads the routing table on startup, and if needed it will add an additional route to the Windows routing table as each virtual COM port is opened and thereby connects to a NetModem Server. Each added route is removed when the client application closes the virtual COM port.

Changes need to be made to the routing table in order for Dial-Up Networking (client connections to a RAS server) to work only if the following two conditions are true:

  1. The server's IP address is not on the same subnet as the PC.
  2. The route to the server's address is handled via a "default" route. A default route is one with a network address of

What NetModem Client does

If NetModem Client determines that an additional route is necessary, then it needs to calculate the correct information for that route.  NetModem Client builds this route using the first default route found in the routing table.  It builds a "specific" route using the IP address of the server and a netmask of It uses the same gateway address as is used in the default route.

For example, consider the following (abbreviated) routing table:

Netmask Gateway Interface Metric 1 1 1

This example for a PC with an address of, on a class C subnet (a netmask of Only addresses through are accessible in this subnet, which is specified in the second route listed. The first route is the default route, which specifies that all other address outside the range of the 10.0.0.x subnet be delivered via the gateway at

Now suppose that the server's IP address is, which is not on the client PC's subnet.  NetModem Client will take the gateway address of the default route, a netmask of, the IP address of the PC, and add a new route so that the routing table will now read:

Network Address Netmask Gateway Interface Metric 1 1 1 1

The new route specifies that the address can be reached via the gateway, and singles out that address over and above the other addresses reachable via the default route. This guarantees that the server will be accessible even if the default route changes.

Why NetModem Client Does This

At first glance this additional route appears to be redundant. It is, after all, specifying the gateway address that is already listed in the default route. So, why bother?

The issue is that Dial-Up Networking sessions also manipulate the routing table.  Even when used with a local modem, DUN causes all subnets to be inaccessible.  This issue is not unique to redirected COM ports.

Consider this hypothetical Dial-Up Networking session to an ISP. Once dialed-in, the ISP will assign the calling PC an IP address of, and specify that a default route use the gateway at (presumably this gateway knows how to route packets to the rest of the Internet). What happens next is that the routing table gets a new default route added, so the top two entries in the routing table look like this:

Network Address Netmask Gateway Interface Metric 1 2

The core of the problem is this: with the above routing table, all packets outside the range to will be routed via to the ISP not to the gateway on the LAN. This includes the server which is at! Dial-Up Networking has, in effect, sawed off the limb it is sitting on by updating the routing table such that the server is no longer accessible to the PC.

Dial-Up Networking doesn't have this problem with a local modem because the modem can always send and receive data to the PC regardless of the state of the routing table. Modems on servers, however, can be cut off from the PC if the routing table suddenly makes them inaccessible. By adding the specific host route to the address, the server is guaranteed to be always accessible, because the server is not dependent upon the default route.

Solving the Problem of Multiple Default Routes

The NetModem Client can run into problems when the PC's routing table contains more than one default route. The two most common situations where this occurs are:

  1. The PC is "multi-homed," meaning it has more than one network card, each of which connects to a different subnet on the LAN. 
  2. The PC has been configured to have redundant default routes, with one intended to act as the backup for the other.

The problem is that NetModem Client needs to determine which gateway address to use for the additional routes (see above), and with multiple default routes it is forced to guess which gateway is the correct one. NetModem Client will always use the gateway address from the first default route in the routing table. In either case, this means that NetModem Client might have guessed wrong.

In the first case, the server may not be accessible via the network card selected for the gateway. In the second case, sometimes the backup gateway address is not online.

There are two solutions to this problem:

  1. Avoid using default routes when at all possible. Unless your LAN can also route to the Internet, using a default route to route to other subnets is somewhat misleading. If the routing table is adjusted to specify the other subnets directly rather than using a default route, then the problem goes away. 
  2. Manually add a static route to the Client PCs routing table which specifies which gateway to use for the NetModem Server PC.

How to manually add a route to the NetModem Client PCs routing table

From a Command Prompt, type "route print" to view the current routing table.

For example, if your default route uses a gateway address of, and the NetModem Server is on IP address which is a different subnet then the NetModem Client, and the route to this IP address is handled by a "default route" (with a network address of, then the new static route which needs to be created will use this same gateway address, and its Network Address (Destination) will be the IP address of the NetModem Server, and its NetMask will be

For this example, the Command Line to add a static route to your routing table is:
route ADD -p MASK

By adding this static route, it will ensure that NetModem Client will still be able to connect to the NetModem Server even after DUN has caused your default routes to change.

When "-p" is used with the ADD command, it makes the route persistent across boots of the system. Otherwise, the route is not preserved. For a list of other route commands, type "route ?".

Note: In Windows Vista and later, the "route ADD" command must be entered from an "Administrator Command Prompt" This is opened by Right-clicking the Command Prompt icon, and selecting "Run as Administrator".


hot deals on computers

Modem Pool
Home | About NetModem | Download | Order License | Guide | Support | Company Info

Copyright © 1995 - 2008 pcmicro.com    All rights reserved