Linux Uncomplicated Firewall

Ubuntu

UFW basic usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# list allowed ports
sudo ufw status verbose

# show ufw status
sudo ufw status

# show and allow by application name
sudo ufw app list
sudo ufw allow 'Nginx HTTP'
sudo ufw allow 53/tcp
sudo ufw allow 6000:6007/tcp
sudo ufw allow from 8.8.8.8
sudo ufw allow from 8.8.8.8 to any port 22


# show rule raw
sudo ufw show raw

# Default Policies
sudo ufw default deny incoming
sudo ufw default allow outgoing

# service enable
sudo ufw enable

Reference

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04