Last active
May 15, 2018 14:32
-
-
Save spig/a25ec7288639e32288c713ae9d9439ea to your computer and use it in GitHub Desktop.
Update firewall on CentOS 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Taken from http://ask.xmodulo.com/open-port-firewall-centos-rhel.html | |
Open a Port on CentOS/RHEL 7 | |
Starting with CentOS and RHEL 7, firewall rule settings are managed by firewalld service daemon. A command-line client called firewall-cmd can talk to this daemon to update firewall rules permanently. | |
To open up a new port (e.g., TCP/80) permanently, use these commands. | |
$ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent | |
$ sudo firewall-cmd --reload | |
Without "--permanent" flag, the firewall rule would not persist across reboots. | |
Check the updated rules with: | |
$ firewall-cmd --list-all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment