Tuesday, June 11, 2019

Port Allow ufw | configure ufw firewall

Here are few steps to allow ports or services :-

Just type these commands :-
To enable UFW:
$ sudo ufw enable

To Allow specific port on specific IP :-

$ sudo ufw allow from 1.1.1.1 to any port 22
 You can allow any port you want to allow,
To Allow port :-$ sudo ufw allow 80

To Remove port :-
$ sudo ufw delete allow 80

You can allow any service you want to allow,

To Allow service :-
sudo ufw allow http

To Remove service :-
sudo ufw delete allow http

Deleting Rules :- By Rule Number

If you're using the rule number to delete firewall rules, the first thing you'll want to do is get a list of your firewall rules. The UFW status command has an option to display numbers next to each rule, as demonstrated here:

$ sudo ufw status numbered

$ sudo ufw delete 2

By Actual Rule:-
$ sudo ufw delete allow http

$ sudo ufw delete allow 80

Check firewall log:-
$ sudo ufw status verbose
 
Check ufw App list:-
 $ sudo ufw app list

Allow a specific IP (To allow all traffic) :-

$ sudo ufw allow from 1.1.1.1

Block an IP Address:-

$ sudo ufw deny from 1.1.1.1

Block out going traffic to an IP Address:-

$ sudo ufw deny out to 1.1.1.1

 sudo ufw deny out from any to _ipaddress_

To Disable or Resetting UFW (optional):-

$ sudo ufw disable

$ sudo ufw reset

0 comments: