0

I have following configuration.

OpenVPN server on a cloud(Ubuntu 14.04) with static IP( example 50.60.70.80 on eth0). Linux and Windows clients are successfully connected to VPN (VPN static IP's - 10.8.0.1...199 on tun0).

In VPN network i have few Windows and Ubuntu 12.04 clients every with own web interface running on "https://10.8.0.100"

I need some forwarding when user go to 50.60.70.80:105 to open "https://10.8.0.105" or 50.60.70.80:xxx to open "ttps://10.8.0.xxx" for example.

I spend days to read and try few methods without success. Please help. Thank you very much in advance.

0

I think iptables would do something for you.

First, activate packet forwarding:

$ echo 1 > /proc/sys/net/ipv4/ip_forward

Redirect your traffic from 50.60.70.80:105 to 10.8.0.105:80

$ iptables -t nat -A PREROUTING -d 50.60.70.80 -p tcp --dport 105 -j DNAT --to-destination 10.8.0.105:80

Make the Iptables marquerade the requisition:

$ iptables -t nat -A POSTROUTING -j MASQUERADE

Hope this help!

2
  • Thanks for idea but it don't work. Maybe problem is other. I am not sure witch ports are opened! I open manual many ports, but it looks they are not opened. I cannot ping server, vpnserver works now on tcp 443 not on 1194, even i manually open it in cloud settings... Give me please idea:( – KostovV Jun 29 '16 at 18:34
  • you can check the open ports using ping.eu/port-chk All you need to know is the ip address and the port the you open to check if is open or closed. – FabricioFCarv Jun 30 '16 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.