port forwarding

Scripts with setup, destroy, and modify routing tables and firewall rulesets for client connections.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
steanly
OpenVpn Newbie
Posts: 2
Joined: Mon Nov 03, 2014 2:16 pm

port forwarding

Post by steanly » Mon Nov 03, 2014 2:25 pm

hello,

i have a server on debian, it's running OpenVPN server.

current iptables rules:
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 192.168.88.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s 192.168.88.0/24 -j SNAT --to-source 81.**.33.**


Debian server:
192.168.88.1

client is assigned an IP:
192.168.88.2

Everything works as it should, but I'm not able to direct port of the outdoor networks 81.**.33.** to the internal network 192.168.88.2

I tried:
iptables -A FORWARD -p tcp -i eth0 -d 81.**.33.** --dport 3389 -j ACCEPT
iptables -t nat -A POSTROUTING -p tcp -d 81.**.33.** --dport 3389 -j DNAT --to-destination 192.168.88.2:3389

does not work, plese help...

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: port forwarding

Post by Traffic » Mon Nov 03, 2014 8:19 pm

Would it not make more sense to have your Remote Desktop server listening on the private IP not the public one ?
Then you make the connection over the VPN.

Note: Is your Remote Desktop server listening on pub.lic.ip.add:3389 ?

steanly
OpenVpn Newbie
Posts: 2
Joined: Mon Nov 03, 2014 2:16 pm

Re: port forwarding

Post by steanly » Tue Nov 04, 2014 8:34 am

I need to get a port of public IP addresses to the internal IP address of the VPN 192.168.88.2

Post Reply