Ubuntu Firewall setting By UFW

The basic firewall in Ubuntu is UFW. So here’s how to use the basic UFW..

UFW enable/disable

Displays a warning that the firewall will be blocked on activation.

Allow and block UFW

  1. Port base, Service base:
    sudo ufw allow <port>/<optional: protocol>

  2. IP base:

    sudo ufw allow from <ip address>

UFW Advanced used

sudo ufw allow from <ip address> to <protocol> port <port number> proto <protocol name>

Allow address and tcp protocol port 80

Delete UFW rule

When deleting a rule in UFW, insert the delete classification and the same rule as the Allow rule. At this time, you can check the rule through state and numbered.

sudo ufw allow from


UFW numbered rules

You can see the UFW rules with numbers attached. Rules are applied sequentially from top to bottom. You can use this to modify, delete, or add rules.



Facebook Comments

Leave A Reply

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다

This site uses Akismet to reduce spam. Learn how your comment data is processed.