I have OpenVPN up and running on a server and serving as a gateway to the internet for private browsing.
I also have several apps running on the same server that I would like to access only via OpenVPN.
For example, if I have etherpad active on port 127.0.0.1:8000 on my server, how do I access that website through my OpenVPN connection on my client? Please let me know what setting changes from the standard configurations are required.
Thank you. I have read many OpenVPN posts and have not been able to understand how to do this...and it seems like it should be simple.
In the general case you would want to allow the port on all interfaces, then use a firewall to drop all connections on that port except through the VPN IP range (and localhost)
If you can get it to work, the rule would be something like
iptables -t nat -D PREROUTING -i tun+ -p tcp --dport 8000 -j DNAT --to-destination 127.0.0.1
(The tun+ bit means any tun devices)
In order for this to work, you will probably also need to have 2 other things set -
sysctl -w net.ipv4.conf.all.route_localnet=1
echo 1 > /proc/sys/net/ipv4/ip_forward
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments