Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At home I have two machines, one linux and one Win 7. The Win 7 box is connected to my work PPTP VPN. Is it possible for the linux box to connect through the windows one to the VPN?

They are both behind a router, so the VPN server only sees one IP address, and PPTP apparently only allows one connection per ip address.

share|improve this question

migrated from Feb 10 '11 at 1:33

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.

Tell your Windows box to act as NAT, and tell your Linux box to use the Windows box as a gateway. Either run a DHCP server on the Windows box or use a static IP on the Linux box. I think “professional” enough versions or Windows can do this, but I don't know how. – Gilles Feb 10 '11 at 0:59

Yes, this is possible.

First you need to share the PPTP connection. Right-click on the PPTP connection in the Networking pop-up panel and select Properties. Go to the sharing tab and turn on Allow other network users to connect through this computer's Internet connection

PPTP Sharing Options - Windows 7

Make sure you select the correct Home networking connection for the network adaptor you use to connect to the router.

Secondly you need to route your network traffic from the Linux box through the Windows PC. How you would do that for your version of Linux is beyond the scope of this answer, but the generic command line to do it temporarily would be:

(as root)
# route delete -net default
# route add -net default gw <ip of the windows machine>

All the traffic destined for the internet from the Linux machine will now pass through the PC and down the VPN.

To undo this repeat as above replacing the IP address of the windows machine with the IP address of the router.

If you don't want all the traffic to go down the VPN but only traffic that is destined for the remote network at the other end of the VPN you can use this instead:

(as root)
# route add -net <network range of remote>/<netmask for remote> gw <ip of windows pc>
(for example)
# route add -net gw

That should then split the traffic from the Linux box - anything destined for (for example) to will be passed on to the PC for forwarding through the VPN. Everything else will continue to go through the router to the internet.

share|improve this answer

You must log in to answer this question.