Difference between revisions of "UFW Ubuntu Firewall"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
(Created page with "To block a port in UFW we use ufw deny command ufw deny port/protocol Examples ufw deny 53")
 
m
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
To block a port in UFW we use ufw deny command
 
To block a port in UFW we use ufw deny command
 
+
ufw deny port/protocol
ufw deny port/protocol
+
  
 
Examples
 
Examples
 +
ufw deny 53
 +
 +
block specific IP address
 +
 +
The syntax is:
 +
sudo ufw deny from {ip-address-here} to any
 +
 +
To block or deny all packets from 192.168.1.5, enter:
 +
sudo ufw deny from 192.168.1.5 to any
 +
 +
To allow ssh service
 +
ufw allow ssh
 +
 +
To see rules config file
 +
cat /etc/ufw/before.rules|less
  
ufw deny 53
+
To enable firewall and active on boot
 +
ufw enable

Latest revision as of 14:46, 15 July 2018

To block a port in UFW we use ufw deny command

ufw deny port/protocol

Examples

ufw deny 53

block specific IP address

The syntax is:

sudo ufw deny from {ip-address-here} to any

To block or deny all packets from 192.168.1.5, enter:

sudo ufw deny from 192.168.1.5 to any

To allow ssh service

ufw allow ssh

To see rules config file

cat /etc/ufw/before.rules|less

To enable firewall and active on boot

ufw enable