How to save iptables command

I ran a iptable command and it worked. But when I rebooted the router it went away. Can someone list all steps how to save this command?

You should put the iptables commands in /etc/firewall.user. It's executed during boot and firewall restarts.


Can I do this using gui?

Yes, /etc/firewall.user can be edited on the page Firewall - Custom Rules.

How can I write these two commands in firewall.user ?

ip route delete default via dev eth0.2
ip route add default via dev br-lan

It is not firewall command, it is route command.

1 Like