connect to the web only through my vps

Issues related to configuring your network
Post Reply
yanivmomo
Posts: 2
Joined: 2010/05/24 10:38:03

connect to the web only through my vps

Post by yanivmomo » 2010/07/07 13:07:34

i bought a vps last week. I wanna if it is possible that the only connection on my computer will be to the vps(i wont be able to connect directly to the internet for example) and if i want to connect to the internet it will be through the vps . i wanna use ssh and especially iptables(and not the proxy of the browser) I wiil be so glad if someone will help me with the iptables part

User avatar
dfateyev
Posts: 34
Joined: 2009/11/15 03:34:01
Location: Kostanay, Kazakhstan
Contact:

connect to the web only through my vps

Post by dfateyev » 2010/07/14 05:27:35

If you want to go to Internet through VPS, you have to set it as default gateway.

Basic scenario: deploying VPN-server on your vps (`openvpn`, for example) and setting on it's configuration to assign default gateway for clients. Also, on VPS you should to allow ip-forwarding for VPN-clients and set SNAT rule to translation VPN-client addresses to public VPS address. You may use PPTP-server (like `poptop`) instead `openvpn`, then you will not need specific VPN-client, but in other hand it provides less security.

Next, on your local gateway (or client machine) with iptables rules you need to allow to connect to your VPS only, except for some others: DNS-servers, etc. When you establish a VPN-connection, all your traffic will go through VPS.

Post Reply