I was wondering if I could get some help with my OpenVPN server and client. I have an Ubuntu 14.04 Digital Ocean droplet that is my OpenVPN server and I have a Debian 8 vm on my server at home that is the client to that server. The VPN works great for sending traffic and searching the web. But I was wondering if I could do that in reverse. So be able to host a web server on that Debian 8 vm, and have the front end IP of that vm be the external IP of the Digital Ocean droplet. I know @wendell made a video mentioning that this is possible, and that he would go into it further, but I figured I'd ask here to see if anybody else knew. Thanks!
You need to configure NAT on the VM to port forward to the client.
Presumably you've configured the VPS to forward traffic between the VPN network and the VPS network (so you can access the internet)? Did you do that by editing /etc/ufw/before.rules? Or did you do it with iptables? If you did it by editing the ufw files then add these lines:
make sure that at the top you have these lines (you will probably already have some of them but make sure you add the prerouting one)
where eth0 is the interface wirth the piblic IP, -p tcp is the protocol, dport 80 is the port number and xxx.xxx.xxx.xxx is the IP you want to forward to
bellow that you should have the postrouting rules similar to this:
-A POSTROUTING -s 10.1.8.0/24 -o eth0 -j MASQUERADE
where 10.1.8.0/24 is your openvpn network and eth0 is the internet facing interface on the VPS
after this there should be the line COMMIT
make those changes and reload UFW and that should work.