How can I access server localhost ports via OpenVPN connection?

bmiller59

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.

davidgo

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.

edited at
0

Comments

0 comments
Login to comment

Related

How can I set SSH connection to my server via just OPENVPN

How can I expose multiple remote server ports via sshuttle?

How to access ports on a local server via ssh?

Can I access my Kubernetes Dashboard via DomainName pointing to specific server instead of localhost

How to setup a server I can call via modem to access the internet?

Failed to start OpenVPN connection to server. But I had removed OpenVPN

How can I access my nodejs-express localhost server from another computer in the same network?

when I don't have access to the Server how can i close the socket Connection from client side?

How can I run redis on a single server on different ports?

How can I establish a secure connection to a websocket on localhost?

How do networking ports work? Can I configure the ports that client and server use?

How to connect to OpenVPN server via cURL?

How can I solve the issue of cookies not being transferred between localhost ports in my Go chat app?

How can I contribute ports?

Can I access a remote web server over an SSH connection?

Kubernetes: After port-forwarding, I can access a service via "localhost" but not via "hostname"

How do I access a server on localhost with nginx docker container?

How to configure Postfix so that I can authenticate via SMTP to localhost

how can I connect Ubuntu through Windows via localhost?

I can access my apache website via localhost, but other users are being denied access

How can I access a PHP file on a server via Unity for MySQL- database manipulation?

How can I access a SQL Server database with . in name via set-location

In VirtualBox, how can I access host localhost from guest (Visual Studio Dev Server from IE7 testing VM)?

How can I access my localhost from my Android device?

How can I temporarily disable localhost access to a certain port?

I can not get access to my own MySQL server via RoR?

How can I connect remotely to a WebSphere Server running on localhost?

How can I Configure localhost and remote server with single config file

How can I use TLS on a local apache development server (on localhost)