Closed GoogleCodeExporter closed 9 years ago
I'm a total newbie to Linux/iptables but I understood that the manual port
forwarding rules doesn't apply on the VPN connection/tun interface. After some
Googling I found out this way of forwarding ports (through the tun interface)
when the VPN connection is established. Pasted this into the WebUI setting "Run
after Firewall Rules restarted":
iptables -I FORWARD -i tun0 -p udp -d *.*.*.* --dport 8080 -j ACCEPT
iptables -I FORWARD -i tun0 -p tcp -d *.*.*.* --dport 8080 -j ACCEPT
iptables -t nat -I PREROUTING -i tun0 -p tcp --dport 8080 -j DNAT
--to-destination *.*.*.*
iptables -t nat -I PREROUTING -i tun0 -p udp --dport 8080 -j DNAT
--to-destination *.*.*.*
Are there any downsides to this solution?
Original comment by viR...@gmail.com
on 25 Jul 2014 at 7:08
It seems that the rule
-A FORWARD -i tun0 -j ACCEPT
already exists. This allows to forward all incoming traffic to tun0.
You do not need udp traffic, as ssh session use tcp.
So you need to add only 3rd line:
iptables -t nat -I PREROUTING -i tun0 -p tcp --dport 8080 -j DNAT
--to-destination *.*.*.*:8080
Original comment by d...@soulblader.com
on 28 Jul 2014 at 1:10
Original comment by d...@soulblader.com
on 30 Jul 2014 at 12:38
Original issue reported on code.google.com by
viR...@gmail.com
on 24 Jul 2014 at 9:14