Skip to content

Instantly share code, notes, and snippets.

@1901
Last active March 17, 2020 15:34
Show Gist options
  • Save 1901/edb1f4dc8c8960cbd5e98b07cd4d9168 to your computer and use it in GitHub Desktop.
Save 1901/edb1f4dc8c8960cbd5e98b07cd4d9168 to your computer and use it in GitHub Desktop.
[Firewall] #linux #firewall
# 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