[twsocket] TWSocket 2 default gateways

Wilfried Mestdagh wilfried_sonal@compuserve.com
Mon, 12 Jun 2000 16:14:13 +0200


Hello,

I have following problem:

On a machine with 2 network interface there is 1 default gateway, as this:

Destination        Netmask          Gateway       Interface  Metric
  0.0.0.0          0.0.0.0     213.224.54.1  213.224.54.240       2

When I use a dial up connection to specific other external network (not
reacheable in default gateway) then RAS installs a second default gateway,
as this:

Destination        Netmask          Gateway       Interface  Metric
  0.0.0.0          0.0.0.0      172.16.2.59     172.16.2.59       1
  0.0.0.0          0.0.0.0     213.224.54.1  213.224.54.240       2

The problem is 2 default gateways, it means the gateway on interface
213.224.54.240 in this example is not reacheable anymore. How can I avoid
RAS to install a default gateway ?

I do not need it sinds the interface ip of the dial up connection is
specific network that I know, I can get it tru LocalIpList function, set
WSocket.LocalAddr to this interface and voila I can connect tru it without
the default gateway.

I think it is possible to get rid of it by executing a batch file who delete
the top route after the connection is there but I dont find this very
reliable. Someone has more elegant idea ?  It has to be work on Windows NT
(I dont care about other operating systems).

thanks in advance, Wilfried