Firewall (Linux)
Firewall (Linux)
UFW
NAME
• ufw - program for managing a netfilter firewall
DESCRIPTION
• This program is for managing a Linux firewall
and aims to provide an easy to use interface
for the user.
UFW
• USAGE
• ufw [--dry-run] enable|disable
• To delete rule
• $ sudo ufw delete allow/deny (port no) (e,g 80)
UBUNTU
• To allow traffic from a particular port of an ip
(rules)
$ sudo ufw allow from 192.168.1.111 to 80(port
no)
UFW Examples
Allow port 53
•
$ sudo ufw allow 53
•
Delete Allow port 53
•
$ sudo ufw delete allow 53
•
Allow port 80
•
$ sudo ufw allow 80/tcp
•
Delete Allow port 80
•
$ sudo ufw delete allow 80/tcp
•
Allow port smtp
•
$ sudo ufw allow smtp
•
Delete Allow port smtp
•
$ sudo ufw delete allow smtp
•
Allow fro Particular IP
•
$ sudo ufw allow from 192.168.254.254
•
Delete the above rule
•
$ sudo ufw delete allow from 192.168.254.254
•
GUFW
• Moreover, if you feel that the terminal way is a
bit annoying, you can use the graphical way of
the settings. But, you have to install another tiny
package namingGUFW.
$ sudo apt-get install gufw
• Please note that ufw status only shows rules added with ufw and
not the rules found in the /etc/ufw rules files.
UFW