-   Linux - Networking (
-   -   Port forwarding on vpn router client (

captainkrypto 05-15-2012 05:33 PM

Port forwarding on vpn router client
I am new to advanced networking so please forgive me.

I have set up my router as a VPN client using dd-wrt. Everything works great and I can selectively tunnel specific computers on the network through VPN. I have a computer acting as a web server using the VPN tunnel, but I am unable to hit it thought the VPN connection or WAN connection as the port does not appear to be open.

I have tried manually forwarding the port with the following:


iptables -t nat -I PREROUTING -i tun1 -p tcp --dport 80 -j DNAT --to-destination
which results in the following iptable rules:


root@RT-N16-MAIN:~# iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 517 packets, 53289 bytes)
 pkts bytes target    prot opt in    out    source              destination       
    0    0 DNAT      tcp  --  tun1  *            tcp dpt:80 to:
    0    0 DNAT      icmp --  *      *        to:
  170 20304 TRIGGER    0    --  *      *        TRIGGER type:dnat match:0 relate:0

Chain POSTROUTING (policy ACCEPT 27 packets, 1567 bytes)
 pkts bytes target    prot opt in    out    source              destination       
  158 10242 MASQUERADE  0    --  *      tun1           
  175 20257 SNAT      0    --  *      vlan2
    0    0 RETURN    0    --  *      br0            PKTTYPE = broadcast
    2  586 MASQUERADE  0    --  *      br0     

Chain OUTPUT (policy ACCEPT 155 packets, 10331 bytes)
 pkts bytes target    prot opt in    out    source              destination

I was hoping that someone can point me in the right direction to get this working. Sorry if I didn't provide enough info, but let me know if further info is needed. Any help/suggestions/direction is much appreciated!


captainkrypto 05-16-2012 11:34 AM

Can someone even give me a high level overview of the next step so I can research further? Or point me in the right direction? Or even a guide or something? I've been trying to figure out this for weeks, and my knowledge level on the subject is very low. Thanks!

b0rked 05-08-2013 05:38 PM

Surely someone else has run into this?
As much I can't stand +1 replies, I too have been trying to sort this out. There must be others out there who have ran into this?

captainkrypto 05-09-2013 08:48 AM

I've searched for a solution for some time and, someone can correct me if I am wrong, but I don't think it is possible to forward ports through a VPN tunnel without some kind of setup on the VPN provider/server side. I've seen some VPN providers with the ability to do this, but haven't yet implemented anything myself.

All times are GMT -5. The time now is 01:15 AM.