Firewall and Container Ports

When using a Docker Container or a Server Ports are very important, here are some Infos and commands to configure them

Check used PORTS

Shell Command

sudo lsof -i -P -n | grep LISTEN

or on Fedorra

ss -tuln

Configure the Firewall

Here are some commands to configure the Firewall on Linux

Check the Firewall

sudo systemctl status firewalld

Start the Firewall

sudo systemctl start firewalld
sudo systemctl enable firewalld

Add a PORT to the Firewall Exeption and Reload

sudo firewall-cmd --add-port=8000/tcp --permanent
sudo firewall-cmd --reload

Remove a PORT from the Firewall Exeption and Reload

sudo firewall-cmd --remove-port=8000/tcp --permanent
sudo firewall-cmd --reload