Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

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
0
bendecko
Asked:
bendecko
  • 4
  • 3
1 Solution
 
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
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
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
 
bendeckoAuthor Commented:
Thank you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now