UFW is working really well for me except in the cases where it doesn't…
I want to be able to add another rule manually that will be applied on boot?
- where should i put this rule?
- how should I make it start at boot?
- how do I make it play nicely with UFW?
Best Answer
According to this Ubuntu wiki page (scroll down to "Advanced Functionality"), you can achieve what you want by putting your own
iptables
rules into the following files:/etc/ufw/before.rules
/etc/ufw/after.rules
The
before
file is evaluated before anyufw
rules are applied; theafter
file is evaluated after. (There are also correspondingbefore6
andafter6
rules files, for yourip6tables
rules.)These rules files are expected to be in
iptables-restore
-compatible syntax, presumably becauseufw
simply loads them usingiptables-restore
. Finally, note that you need to stop and restartufw
after you make any changes to the rules files.