OpenWRT-iptables is a simple iptables
and ip6tables
startup script
for OpenWRT. It is an alternative to OpenWRT's default fw3
firewall
management tool.
-
Copy
init.d/iptables
to/etc/init.d/
. Make sure that it is executable. -
Symlink
/etc/init.d/ip6tables
toiptables
. -
Create a directory —
/etc/sysconfig
. -
Copy
sysconfig/iptables
andsysconfig/ip6tables
to/etc/sysconfig/
. -
Disable the default
firewall
service and enable the new services.service firewall disable
service iptables enable
service ip6tables enable
-
Reboot.
NOTE: The default configuration only allows inbound connections to TCP port 22 (
ssh
); IP forwarding and NAT are disabled. It may be necessary to customize the configuration files before enabling the new services.Proceed with caution to avoid losing access to your WAP/router.
The service script supports two additional commands:
-
save
— Saves current rules to/etc/sysconfig/iptables
(or/etc/sysconfig/ip6tables
). -
dump
— Writes current rules tostdout
.