ddwrt-firewall-script-cropOne may find himself in the face of this scenario: you have a friend’s infected computer over for cleanup and you need internet access on it to install/run cleanup utilities; but you don’t want it to continue it’s spamming of the internet (and get your public IP blacklisted or even blocked).

Using a router running DD-WRT, this is easy to do using custom firewall rules. For example, to allow trusted hosts and and block any other host on the local network from connecting to outgoing port 25 (SMTP) to send spam emails, you can add the following rules in DD-WRT’s firewall script:

The firewall script is editable via Administration » Commands » Firewall. Click Edit in the Firewall section then paste/edit the rules in the Command Shell box above. When done, click the Save Firewall button. This will save and reboot the router.

Remember to test the rules via the console before making them final (to avoid locking yourself out of the router or writing broken rules).

Leave a Reply