/sc_assets/441/logo.png

DD-WRT OpenVPN Port Forward

Last updated by Shayne M on July 03, 2015 14:29

You will require a Dedicated IP from vpnsecure for port forwarding to work.

go to the Administration tab and then the Commands sub-tab.

edit the Firewall script (Or Save a new one), and add the following lines, replacing IPADDRESS and PORT appropriately, followed by clicking Save Firewall

IPADDRESS = Local IP on your LAN, example 192.168.1.10

PORT = Port which is forwarded from VPNSecure

	iptables -I FORWARD 1 -i tun1 -p udp -d IPADDRESS --dport PORT -j ACCEPT
	iptables -I FORWARD 1 -i tun1 -p tcp -d IPADDRESS --dport PORT -j ACCEPT
	iptables -t nat 1 -I PREROUTING -i tun1 -p tcp --dport PORT -j DNAT --to-destination
	IPADDRESS
	iptables -t nat 1 -I PREROUTING -i tun1 -p udp --dport PORT -j DNAT --to-destination IPADDRESS

This example will forward port 80 to IP address 192.168.1.10 from the VPN tunnel

	iptables -I FORWARD 1 -i tun1 -p udp -d 192.168.1.10 --dport 80 -j ACCEPT
	iptables -I FORWARD 1 -i tun1 -p tcp -d 192.168.1.10 --dport 80 -j ACCEPT
	iptables -t nat 1 -I PREROUTING -i tun1 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.10
	iptables -t nat 1 -I PREROUTING -i tun1 -p udp --dport 80 -j DNAT --to-destination 192.168.1.10

Save the script - You may need to reboot to activate the firewall script - alternatively once saved as the Firewall script you can manually run them from the commands 

VPNSecure Provides Secure VPN servers in over 45+ Countries

If you are a looking for a versatile easy to use VPN service, checkout Today