LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Port forwarding on vpn router client (http://www.linuxquestions.org/questions/linux-networking-3/port-forwarding-on-vpn-router-client-945166/)

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:

Code:

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

Code:

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  *      0.0.0.0/0            0.0.0.0/0          tcp dpt:80 to:192.168.1.42:80
    0    0 DNAT      icmp --  *      *      0.0.0.0/0            71.xxx.xxx.166      to:192.168.1.1
  170 20304 TRIGGER    0    --  *      *      0.0.0.0/0            71.xxx.xxx.166      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    0.0.0.0/0            0.0.0.0/0         
  175 20257 SNAT      0    --  *      vlan2  192.168.1.0/24      0.0.0.0/0          to:71.xxx.xxx.166
    0    0 RETURN    0    --  *      br0    0.0.0.0/0            0.0.0.0/0          PKTTYPE = broadcast
    2  586 MASQUERADE  0    --  *      br0    192.168.1.0/24      192.168.1.0/24     

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!

Thanks!

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:48 PM.