HI
i got Openvpn working since years but now things had chance so.. i need now to redirect a port from my eth1 (internet) to my client port 5901.
INTERNET ------------------------ FIREWaLL----------------------TUN------------------------CLIENT(10.0.0.74)
|
|
|
|
|
LAN (192.168.0.0)
|
|
MI PC
i can see my clients with pings to/from my lan clearly. but if a just apply a rule:
iptables -t nat -I PREROUTING -i eth1 -p tcp --dport 4501 -j DNAT --to 10.0.0.74:5901
just nothing happens. does not work the redirecction.
i do a nmap from outside:
PORT STATE SERVICE
5900/tcp filtered vnc
what can i do to acheive this?
redirect port from externt world to my vpn client does not w
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVpn Newbie
- Posts: 1
- Joined: Thu Mar 10, 2011 4:41 pm
- Bebop
- Forum Team
- Posts: 301
- Joined: Wed Dec 15, 2010 9:24 pm
Re: redirect port from externt world to my vpn client does n
emel_punk wrote:i need now to redirect a port from my eth1 (internet) to my client port 5901.
my client port 5901
--dport 4501
First of all -- your request did not mention port 4501 or 5900, but your included code did! Please be specific with your request, as guessing games make it hard to help you out. For my examples I will only be using port 5901, but you can figure out how to substitute --dport 4501 if you require it.5900/tcp filtered vnc
You forgot a few things with your code.
- With prerouting you didn't add '-d public.ip.of.vpnserver'. You will need that.
- With prerouting, --to is not the same as --to-destination. You should be using --to-destination instead.
- Also, you didn't apply a forward rule. You will need that too.
Code: Select all
iptables -A FORWARD -p TCP -i eth1 -d 10.0.0.74 --dport 5901 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d public.ip.of.vpnserver --dport 5901 -j DNAT --to-destination 10.0.0.74:5901
The cure for boredom is curiosity