38

Do you need to run any of these commands:

sudo ufw reload
sudo ufw disable
sudo ufw enable

after adding a rule via sudo ufw allow?

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
iLW
  • 483
  • 1
  • 4
  • 6

1 Answers1

41

No. It's enough to just add it. But if you add rules in the files, you need to execute commit.

You can check user rules, as they're called with:

ufw status

You can also add verbose for some details:

ufw status verbose

Or numbered to know which rule to remove with delete. The syntax for this one is this:

delete RULE|NUM 
  • 1 more question please. What do you mean by "add rules in the files"? – iLW Jun 13 '17 at 20:07
  • @iLW Take a look in `/etc/ufw/`. There are many rules there. What you add through the command line goes to `user` or `user6` for IPv6. There should be 6 more folders there and a cover of `sysctl.conf` form `/etc/sysctl` and `/etc/sysctl.d`. Find a suitable guide for your OS and version. There are plenty of them in the air. –  Jun 13 '17 at 20:15
  • 2
    sudo ufw commit results in Error: Invalid syntax – user_78361084 Jan 06 '18 at 05:16
  • @MarissaLevy This shouldn't happen. Start a new question with your details. –  Jan 06 '18 at 12:26
  • delete RULE needs reload? It seems like it is the case for me.. is it normal? – yeahman Oct 02 '20 at 18:19
  • 2
    you need to execute commit makes it sound like there's a command ufw commit Should be (?) ufw reload – beardedfool Nov 11 '21 at 20:29
  • actually there's also ufw app update PROFILE – beardedfool Nov 11 '21 at 20:46
  • There is no `commit` on ubuntu. – Eric Mar 21 '22 at 12:39