Page 1 of 1

UFW ubuntu fire wall

Posted: Mon Feb 04, 2019 11:09 am
by Stevyn
UFW ubuntu fire wall

Show firewall status including your rules:

Code: Select all

sudo ufw status numbered
delete rule number # 4:

Code: Select all

sudo ufw delete 4
block specific IP address:

Code: Select all

sudo ufw insert 1 deny from 178.137.80.191 comment 'block spammer'

Code: Select all

sudo ufw insert 1 deny from 202.54.1.0/24 comment 'Block DoS attack subnet'
reload :

Code: Select all

sudo ufw reload
To allow incoming SSH connections from a specific IP address or subnet, specify the source. For example, if you want to allow the entire 15.15.15.0/24 subnet, run this command:

Code: Select all

sudo ufw allow from 15.15.15.0/24  to any port 22