Category Archives: DD-WRT

DD-WRT Command line port forward

Port Forwarding can be accomplished from within the web interface here. However, the very same thing can be done a bit differently (tested and working), via command line.  Example from port 8021 to IP 192.168.0.17 and port 21

iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 8021 -j DNAT --to 192.168.0.17:21
iptables -I FORWARD -p tcp -d 192.168.0.17 --dport 21 -j ACCEPT

Source: dd-wrt.com