Question

How do I forward the port 80 on my local computer connected to droplet via OpenVPN

Posted November 10, 2019 847 views
ApacheVPNOpen SourceUbuntu 18.04
  1. I can access the droplet ports. eg. Apache server of the droplet by typing 10.8.0.1
  2. I can access my local pc with the droplet eg. ping local pc with IP 10.8.0.2
  3. I need my local PC to be available on the public through port 8080

My IP infos:


root@spookycodes:~# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d2:a2:41:b4:8b:e2 brd ff:ff:ff:ff:ff:ff
    inet 159.65.20.191/20 brd 159.65.31.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.16.0.5/16 brd 10.16.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::d0a2:41ff:feb4:8be2/64 scope link
       valid_lft forever preferred_lft forever
3: ens4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 2a:37:17:b8:1f:dc brd ff:ff:ff:ff:ff:ff
10: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 100
    link/none
    inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::1c4f:241a:128d:e97f/64 scope link stable-privacy
       valid_lft forever preferred_lft forever

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

There are a couple of ways, I think.

Firstly, what comes to mind is for you to forward your 8080 port through your router. Which depending on the router can be a little harder.

Second option would be to use a program called ngrok. Assuming your application listens on port 8080, run ngrok in command line with this command:

ngrok.exe http 8080
``

ngrok will start port forwarding immediately. 
Submit an Answer