Last active
March 17, 2020 15:34
-
-
Save 1901/edb1f4dc8c8960cbd5e98b07cd4d9168 to your computer and use it in GitHub Desktop.
[Firewall] #linux #firewall
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
# list enabled ports/services | |
firewall-cmd --zone=public --list-ports | |
firewall-cmd --zone=public --list-service | |
# enable http(s) port (80 443) using the firewall-cmd | |
firewall-cmd --permanent --zone=public --add-service=http | |
firewall-cmd --permanent --zone=public --add-service=https | |
firewall-cmd --reload | |
# enable specified port | |
firewall-cmd --permanent --zone=public --add-port=8080/tcp | |
# get avaiabled zones | |
firewall-cmd --get-zones | |
# get zone of interface `tun0` | |
firewall-cmd --get-zone-of-interface=tun0 | |
# add zone to interface `tun0` | |
firewall-cmd --zone=internal --add-interface=tun0 | |
# configuration dir | |
/etc/firewalld/zones/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment