To open a port in Ubuntu's firewall, you can use the ufw
command. ufw
stands for "Uncomplicated Firewall," and it is a frontend for managing the iptables
firewall on Ubuntu.
Here are the steps to open a port using ufw
:
ufw
is installed on your system. You can check if it is installed by running the following command:sudo ufw statusSourww:ecw.lautturi.com
ufw
is not installed, you can install it by running the following command:sudo apt-get install ufw
ufw
is installed, you can enable it by running the following command:sudo ufw enable
ufw allow
command followed by the port number and the protocol (TCP or UDP). For example, to open port 80 for TCP connections, you can run the following command:sudo ufw allow 80/tcp
:
symbol. For example, to open ports 8000-8007 for TCP connections, you can run the following command:sudo ufw allow 8000:8007/tcp
sudo ufw allow 53/tcp,53/udp
ufw status
command. This will show you a list of the open ports and the allowed connections.sudo ufw status