Firewall Setting in Ubuntu

Ubuntu comes with a built-in firewall called "ufw" (Uncomplicated Firewall) that you can use to configure your firewall settings. Here are the basic steps to configure your firewall settings in Ubuntu using ufw:



Check the status of ufw: Open a terminal and enter the command "sudo ufw status". This will show you the current status of ufw, which should be "inactive" if you haven't configured it before.

Enable ufw: To enable ufw, enter the command "sudo ufw enable". This will activate the default set of rules that block all incoming connections and allow all outgoing connections.

Allow incoming connections: To allow incoming connections for a specific service, such as SSH or HTTP, you can use the command "sudo ufw allow [service]". For example, to allow incoming SSH connections, enter the command "sudo ufw allow ssh".

Deny incoming connections: To deny incoming connections for a specific service, use the command "sudo ufw deny [service]". For example, to deny incoming HTTP connections, enter the command "sudo ufw deny http".

Allow outgoing connections: By default, ufw allows all outgoing connections. If you want to restrict outgoing connections, you can use the command "sudo ufw default deny outgoing" to deny all outgoing connections, and then use the "sudo ufw allow [service]" command to allow specific outgoing connections.

Deny outgoing connections: To deny all outgoing connections, use the command "sudo ufw default deny outgoing".

Check the status of ufw: To check the status of ufw again, enter the command "sudo ufw status". This will show you the current rules and configuration of ufw.

These are the basic steps for configuring your firewall settings in Ubuntu using ufw. You can find more information about ufw and advanced firewall configurations in the Ubuntu documentation.

Share this post
Archive
Sign in to leave a comment
How To Install wkhtmltopdf on Ubuntu 22.04
Installation process of wkhtmltopdf