Created
April 24, 2018 20:45
-
-
Save ncracker/577f7ef38d0854fbe958d4e0cce1ccb0 to your computer and use it in GitHub Desktop.
firewalld snippets
This file contains hidden or 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
# CentOS 7 firewall open ports | |
# see active zone (profile) | |
firewall-cmd --get-active-zones | |
#open port 8080 | |
firewall-cmd --zone=public --add-port=8080/tcp --permanent | |
# block calls to external ip | |
firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -d 54.236.250.10/32 -p tcp -m tcp --dport=443 -j DROP | |
#reload | |
firewall-cmd --reload | |
# firewall see opened ports in current zone | |
firewall-cmd --list-all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment