Skip to content

Instantly share code, notes, and snippets.

@ncracker
Created April 24, 2018 20:45
Show Gist options
  • Save ncracker/577f7ef38d0854fbe958d4e0cce1ccb0 to your computer and use it in GitHub Desktop.
Save ncracker/577f7ef38d0854fbe958d4e0cce1ccb0 to your computer and use it in GitHub Desktop.
firewalld snippets
# 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