IlcvhZ
Hi,
Here is my goal. Can I do this with OpenVPN?
I have a mobile broadband card, and my machine runs a webserver, email server, and a public vcs. But I have three problems:
1. Port 25 is blocked so I have to use an elaborate convulsion to allow
me to send mails.
2. It has a dynamic IP address so I have to use dynamic DNS.
3. There's no way for me to set up reverse DNS (that I know of).
I have a VPS in London, can I somehow route/tunnel (whattever the word is) EVERYTHING through the VPS?
So I could kind of `fix' my connection to be as if as if I have a static IP address, with port 25 not blocked?
The VPS is Debian 6.1 and this machine is ParabolaGnu/Linux-libre (a 100% free software version of Arch Linux).
IlcvhZ
bump.
dazo
In theory, this should be doable. But you'll need to do some clever things along the road. I've not really done this in real life, but in the theory, it should work.
- Install a OpenVPN server on your VPS box
- Install a OpenVPN client on your "moving target box" (dynamic IP address)
Make the client connect to your VPS box as soon as it get online. Then make your services listen on the tun/tap interface (or VPN IP address) and then use NAT or some kind of proxy software on the VPS box to route ports from its public IP address to the VPN client IP address.
I would probably spend time finding a good TCP proxy software, as that would make a move towards IPv6 enabling quicker for you, if you consider the future. Then you can still have IPv4 on the "inside" (the VPN), and just make the proxy listen to both IPv4 and IPv6 addresses on your VPS box.
However, with the latest git development tree, the IPv6 code is basically ready ... and you can probably do things much more transparent by just using IPv6 routing. But that's another topic. Getting a basic OpenVPN setup working is still the first step.
IlcvhZ
Thanks, I'll keep you posted.
dazo
I have such a setup running now, and has been running successfully for quite some time.
I'm using a virtual machine at a hosting centre with a fixed IPv4 and IPv6 address. This also serves as an OpenVPN server and has haproxy running (more on that later on).
On the backend server where I have services I want to have publicly available, I'm running an OpenVPN client which connects to the OpenVPN server. This server is in a completely different place physically and got a dynamic public IP address.
The haproxy setup then proxies all the traffic from the public IP addresses on the ports I've opened up for to the services running on the backend server via the OpenVPN tunnel. The advantage here is that haproxy can then be setup as a load balancer if you add more OpenVPN clients with the same services. And it all is transparent for the end users.
So no matter which IP address my backend server have, it is available via the fixed public IP address of the virtual machine.
arne22
I am also running a setup that is slightly simular to this.
I run a OpenVPN server in routing mode on a Centos VPS.
I do not run any "local servers" on regular basis, but I have tried to forward
ports from the fixed external ip to the local OpenVPN client, and it has worked ok.
The only proxy I has running at the VPN is Squid, but this is unly used from time to
time for my own outgoing web traffic.
I think i will run a dns proxy on the VPS but I have not set it up yet.