Access a third machine via a second machine

Michael Berend
Michael Berend used Ask the Experts™
I've got three machines:
1. Linux PC:
    - NIC #1:, netmask, gateway:
      (so this is connected over a switch to the Windows machine (2.))
2. Windows 10 PC:
    - NIC #1:, netmask, no gateway
    - NIC #2:, netmask, gateway:
3. Linux machine
    - NIC #1:, netmask, gateway: (Internet)

What do I have to do on which machine to get access from the Linux machine (1.) to the 10.x.x.x network (over the Windows machine (2.)?
I got above scenario working with Internet Connection Sharing on the Windows machine (2.) sharing its NIC #2 on its NIC #2.
However, it is extremely buggy (when restarting the Windows machine it is not working, have to switch on/off to make it work again, etc.)
So, I need a different solution just based on a few static routes perhaps?
Many thanks in advance,
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2018
What you want is basically routing 101.  Unfortunately windows *client* has no built-in routing services and really shouldn't be used as a router anyways (both technical and legal reasons for this.)  Windows Server can do this, as can many Linux distros.  But if you insist on keeping machine #2 as windows 10 then you'll have to look at 3rd-party router products, and I am not aware of any that I consider reliable.  

You'll find anecdotal regedits that enable routing (But that's basically what ICS does anyways), but you end up manually managing routes and it still can be finicky unless you get the manual routes "just right" and thus it appears unreliable (and therefore effectively *is* unreliable.)

Microsoft never intended windows 10 to be used this way and to do so would cut into their server sales, so they don't make it easy or really supported. You are hitting that limitation.
Top Expert 2013

Windows PCs will not do routing by default.  I haven't done it since XP days, but you should still be able to turn on routing on the Windows machine by editing the registry.  I see by the following link it still worked with Win7.

It's not an ideal solution but does work.

Once done then you need to create static routes on the machines on each subnet showing the gateway for the other subnet as your modified PC.


Hi Rob,
Many thanks for your quick answer.
I understood the first part, which I did already (enabled IP Routing on the Windows machine).
Could you just give me one more hint on what machine I would have to set which route then?
Sorry for bothering you with probably something trivial, but I always get confused about these routes.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2013

The routing PC can only see networks directly connected to it, so assume it has 2 NIC's and  It knows the devices on those 2 subnets, but the devices on those two subnets do not know how to route traffic to the other subnet.  By default they use the default gateway and it does not have an answer.  That is actually where the routes should be added, but if wanting to use a PC to route the traffic...….

On every pc on subnet 192.168.100.x you have to add a route such as
route add -p mask

then on every PC on subnet 192.168.200.x you have t add a route such as
route add -p mask

You have to have routes in both directions, so that the packet knows how to get there, and then how to find its way back.

If a device's default gateway happens to be it's respective IP192.168.100.1 or address, the rout is not necessary.

As Cliff said this is not an efficient way to handle routing, but in a pinch I have done so for temporary set ups in the past.


I added a route on the Linux-PC (1.):
- route add -p mask
so it a "ping 10.x.x.x" would hit Windows machine (2.), which is connected with the 10.x.x.x network
however, I don't get an answer back.
What additional route (if any) do I have to set on the Windows machine then, so that the 10.x.x.x answer can find its way back?
Top Expert 2013

As mentioned the device you are pinging can only respond if you add the return route to it.  The windows device acting as a router, does not need any routes added to itself.

On all devices on the 10.x.x.x network you would have to add
route -p mask mask


Hi Rob and Cliff,
I'd like to thank you for the great and timely answers.
You helped me a great deal.
I decided finally to go with "WinGate" to handle the required routing, since the individual routes on both sides of the networks is impossible to maintain.
Best regards,

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial