Link to home
Start Free TrialLog in
Avatar of bendecko
bendecko

asked on

Setting Route Depending on Destination Network

Hi,

I've a machine with 2 LAN cards

I'd like it to access the Internet via the 192.168.0.1 gateway.
I'd like it to able to access both LAN segments 192.168.0.x and 10.x.x.x but I'd also like any traffic to the hosts 66.206.25.32 to 66.206.25.36 to go via the 10.10.80.1 gateway.
I want to make it *impossible* for the machine to connect to Internet hosts via the 10.10.80.1 gateway unless they in the range above.  Even if the 192.168.0.1 gateway is down.

The routes need to persist even if the machine gets rebooted.

What do I have to do to get this setup?

My current routing table is this:

0x1 ........................... MS TCP Loopback interface
0x2 ...00 02 e3 03 e3 ba ...... NETGEAR FA311/312 PCI Adapter
0x3 ...00 a0 c9 c8 08 27 ...... Intel(R) PRO Adapter
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0       10.10.80.1      10.10.80.2       1
          0.0.0.0          0.0.0.0      192.168.0.1     192.168.0.6       1
         10.0.0.0        255.0.0.0       10.10.80.2      10.10.80.2       1
       10.10.80.2  255.255.255.255        127.0.0.1       127.0.0.1       1
   10.255.255.255  255.255.255.255       10.10.80.2      10.10.80.2       1
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.0.0    255.255.255.0      192.168.0.6     192.168.0.6       1
      192.168.0.6  255.255.255.255        127.0.0.1       127.0.0.1       1
    192.168.0.255  255.255.255.255      192.168.0.6     192.168.0.6       1
        224.0.0.0        224.0.0.0       10.10.80.2      10.10.80.2       1
        224.0.0.0        224.0.0.0      192.168.0.6     192.168.0.6       1
  255.255.255.255  255.255.255.255      192.168.0.6     192.168.0.6       1
Default Gateway:       192.168.0.1
===========================================================================
Persistent Routes:
  None

Thanks!

Bendecko
Avatar of Les Moore
Les Moore
Flag of United States of America image

Easy...

c:\>route delete 0.0.0.0 mask 0.0.0.0
c:\>route add 0.0.0.0 mask 0.0.0.0 192.168.0.1 -p
c:\>route add 65.206.25.32 mask 255.255.255.248 10.10.80.1 -p

Avatar of bendecko
bendecko

ASKER

Cool

The command...

route delete 0.0.0.0 mask 0.0.0.0

will delete both my extra-network outbound routes?

What is preventing the 10.10.80.1 route re-appearing after a reboot?

Thanks

Bendecko
How can I verify what route a packet is taking.

TRACERT gives loads of timeout now.  Maybe because the in between hops are going through the wrong gateway?

>What is preventing the 10.10.80.1 route re-appearing after a reboot?
Nothing if you get your IP dynamically. You can go into TCP/IP properties and make sure it is not listed there..
The only way to verify if to do traceroute. As long as your next hop shows as the 10.10.80.1, there is nothing you can do about the ones in between, and not all of them will respond.
The 10.10.80.1 route is given dynamically by DHCP.

Obviously I need that interface to access that LAN subnet from this machine.

If  I put in manually then remove the route will that persist over reboots?

Bendecko
ASKER CERTIFIED SOLUTION
Avatar of Les Moore
Les Moore
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.