This article covers how to enable and configure the firewall in Ubuntu 22.10 (Kinetic Kudu). In fact, Firewall helps to define rules which monitors both incoming and outgoing network connections to make decisions depending on a predefined security rules.
How to check ufw status ?
To view status of ufw, run:
$ sudo ufw status
How to enable IPv6 support in Ubuntu ?
Ensure that the directive IPV6=yes do exists in /etc/default/ufw file. For instance:
$ cat /etc/default/ufw
How to Open SSH TCP port 22 connections ?
Run the below command to open SSH TCP port 22 using UFW:
$ sudo ufw allow ssh
If you are running ssh on TCP port 2222 or TCP port 2323, run:
$ sudo ufw allow 2222/tcp
$ sudo ufw allow 2323/tcp
How to enable firewall on Ubuntu ?
You can enable firewall by running the below command:
$ sudo ufw enable
How to disable ubuntu UFW based firewall ?
If you need to stop the firewall and disable on system startup, run:
$ sudo ufw disable
How to Reset the ufw in Ubuntu ?
The below command will help to reset ufw:
$ sudo ufw reset
You can Reload the ufw by running:
$ sudo ufw reload