0

This is similar to the question Is there any alternative to virtualization for handling two different interfaces, different networks and same IP range? but that is about linux. And also similar but not the same to Routing on same network to different interface .

Situtation

This is on a windows machine. Basically I have two networks i'm connecting to.

A local lan with a range 10.0.0.0/255.255.255.0 which serves the internet

And a Corp WAN with an approximate range of 10.0.0.0/255.0.0.0 which also serves the internet.

Unfortunately those two obviously clash not just in their local ranges, but also in serving the internet.

Ideally the local lan would change from 10.0.0.0 to something like 192.168.0.0 instead so that part didn't clash, but that is not the major problem anyway. The problem is that the local lan also tries to serve up all of 10.0.0.0/255 since that is part of 0.0.0.0/0

I have a solution which i've posted to http://matthewvukomanovic.blogspot.com.au/2014/10/routing-through-two-different-network.html and I'll also try posting below (though I don't think I have enough points on super user yet)

Does anyone have a better solution than adding the routes manually like I have in the link?

1 Answers1

0

My slightly dodgy solution

open a command line (cmd) then type:

route print

you will get a whole bunch of stuff but what you are interested in are the bits i highlight from my example

... extra stuff ...

IPv4 Route Table

Active Routes:

Network/Netmask Gateway Interface Metric

0.0.0.0/0.0.0.0 10.0.0.1 10.0.0.3 20

0.0.0.0/0.0.0.0 10.10.127.254 10.10.120.88 25

... Lots of extra stuff you shouldn't care about ...

The route with a gateway of 10.0.0.1 is the local lan

The route with a different gateway (with dest and netmask all 0) is the Corp WAN.

You need to then put in these commands subsituting the values from above to your own situation:

route add 10.0.0.0 MASK 255.255.255.0 10.0.0.1
route add 10.0.0.0 MASK 255.0.0.0 10.10.127.254

Note you need to make sure that you add these in that order, setting metrics doesn't seem to work.

The first route wouldn't even need to be added if we changed the ip range that the local lan served.

Result

Now from those commands we should have:

  • The local lan serving the internet still.
  • The local lan serving 10.0.0.0/255.255.255.0
  • The Corp WAN only serving 10.0.0.0/255 EXCEPT 10.0.0.0/255.255.255

Gateway Changes

This is why the solution is a bit dodgy.

My IP assigned from the Corp WAN changes, which isn't important, but what is important is that the gateway also changes.

Get the new gateway IP using the same method as using route print as above then modify your route using:

route change 10.0.0.0 MASK 255.0.0.0 NEW.GATEWAY.IP

for example if my route print command now returned the following

0.0.0.0/0.0.0.0 10.110.127.254 10.110.121.58 25

Then I would run the following command to update my gateway:

route change 10.0.0.0 MASK 255.0.0.0 10.110.127.254

Better Ways?

Would love to know a better way to do this.