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
LVL 1
bendeckoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lrmooreCommented:
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

0
bendeckoAuthor Commented:
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
0
bendeckoAuthor Commented:
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?

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

lrmooreCommented:
>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.
0
bendeckoAuthor Commented:
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
0
lrmooreCommented:
If you use the -p option to make each entry permanent, then after a reboot, you may still have to remove the default to 10.10.80.1, or at least give it a higher metric.
You could create a little batch file and keep it on the desktop to execute after you reboot.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bendeckoAuthor Commented:
Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.