Skip to content

Instantly share code, notes, and snippets.

@KavenTheriault
Created October 1, 2018 12:51
Show Gist options
  • Save KavenTheriault/cf354c79d6df757f3ebb444c66d1620e to your computer and use it in GitHub Desktop.
Save KavenTheriault/cf354c79d6df757f3ebb444c66d1620e to your computer and use it in GitHub Desktop.
Open port with firewall-cmd

Show all opened ports

$ sudo firewall-cmd --list-all

To open up a new port (e.g., TCP/80) permanently, use these commands. Without --permanent flag, the firewall rule would not persist across reboots.

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment