Skip to content

Instantly share code, notes, and snippets.

@xiaoysh8
Last active September 6, 2018 01:24
Show Gist options
  • Save xiaoysh8/60b53c7150904a840f4f49b0b9a9d1a6 to your computer and use it in GitHub Desktop.
Save xiaoysh8/60b53c7150904a840f4f49b0b9a9d1a6 to your computer and use it in GitHub Desktop.
centos staff
//centos open port
firewall-cmd --zone=public --permanent --add-port=6222/udp
//network test
netcat -u -z -n -v host port
-u udp | tcp
-z scan port range
-n skip dns
-v verbose info
-l listen port
//centos firewall command
firewall-cmd --state
view status of firewalld service (systemctl status firewalld)
firewall-cmd --zone=public --list-all
gets all info for the “public” zone
firewall-cmd --list-all-zones
shows all info for all zones
firewall-cmd --zone=public --add-port=80/tcp --permanent
adds port 80 to public zone
firewall-cmd --zone=public --add-service=http --permanent
adds service http to public zone
firewall-cmd --reload
run this after making changes
firewall-cmd --zone=public --remove-port=80/tcp --permanent
to remove port 80 from public zone
firewall-cmd --get-default-zone
shows default zone for firewall
firewall-cmd --get-active-zones
zones where network interfaces or sources are assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment