I have a linux pc which is on a network that does not have internet access. There I have also a windows pc which is on a network that have internet access. The 2 networks are visible one to each other (I can access the linux pc from the windows one and vice versa)
Is there any way to do a setting on linux pc to get internet access through the windows pc? I would like to have it like a script and activate it when I need (for get upgrades )

Thank you in advance

  • Please can I check. There are two networks: Network A, which can reach the Internet, and Network B, which cannot. Your Windows PC is connected to both networks. Your Linux PC is on only Network B. Is this correct? – roaima Jan 8 '18 at 10:53
  • If this is true, is there any reason why you should not temporarily move your Linux PC from Network B to Network A while it is doing upgrades? – roaima Jan 8 '18 at 10:55

Al you have to do is to set your default gateway the same as the one on the Windows PC.

route add default gw X.X.X.X eth0

X.X.X.X is the IP-adress of the gateway (probably a router on the Windows PC network), "eth0" is your network interface (may differ). After the update, you can remove the route

route del default gw X.X.X.X eth0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.