Mac iTOps Tube

Wednesday, May 16, 2012

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!











No comments:

Post a Comment