Useful Scripts - DD-WRT Wiki
wiki.dd-wrt.com › wiki › indexDirectory Listing for DD-WRT Micro. Since the Micro version of DD-WRT doesn't provide a ls command, here is a very simple script to list directory contents #!/bin/sh files=`echo *` for x in $files; do if [ -d $x ]; then echo -n "$x/ " else echo -n "$x " fi done echo See the Telnet/SSH_and_the_Command_Line Talk page for other variants. Reset Wireless Radio
Iptables command - DD-WRT Wiki
wiki.dd-wrt.com › wiki › indexIptables is a powerful administration tool for IPv4 packet filtering and NAT. It is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Iptables commands can be entered by command line interface, and/or saved as a Firewall script in the dd-wrt Administration panel. I tend to recommend testing and confirming your rules at the command line first.
Iptables command - DD-WRT Wiki
https://wiki.dd-wrt.com/wiki/index.php/Iptables_commandiptables -I FORWARD 1 -p tcp -d dd-wrt.com --dport 80 -j ACCEPT iptables -I FORWARD 2 -p tcp --dport 80 -j DROP Which would accept all http traffic to dd-wrt.com, while blocking outgoing http traffic to anywhere else. If you wish to allow multiple sites, insert additional rules before the DROP (making sure to order and number them correctly).
Talk:Iptables command - DD-WRT Wiki
wiki.dd-wrt.com › wiki › indexIt seems like you should enter custom iptables commands in the http interface by accessing Administration-> Commands-> Save Firewall. There is a nice example iptables script for a different purpose here: --Urule99 04:17, 1 August 2007 (CEST) ddwrt chains . I think is interesting add information about DD-WRT specific chains and rules.
Port Blocking - DD-WRT Wiki
https://wiki.dd-wrt.com/wiki/index.php/Port_Blockingiptables -I FORWARD -p tcp -m multiport --dport 21,80 -j DROP Port Range - Use a colon to select a port range (Port 21 through 80 will be closed): iptables -I FORWARD 1 -p tcp --dport 21:80 -j DROP See Also . Iptables command - Lists all available commands for use in iptables Telnet/SSH and the Command Line - How to on Telnet and SSH
#3033 (`ip rule` command broken in 21676 mega) – DD-WRT
svn.dd-wrt.com/ticket/3033The ip rule command does indeed appear broken. Here is an updated version of the script, using a table number: # Configure source IP rewriting on vlan3 iptables -t nat -I POSTROUTING -o vlan3 -s 192.168.42.0/24 -j SNAT --to $ (nvram get wan2_ipaddr) # Add default gateway to 900 table ip route add default via $ (nvram get wan2_gateway) table 900.