Skip to content

Instantly share code, notes, and snippets.

@ryansechrest
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryansechrest/e75ada4d3f161789a68a to your computer and use it in GitHub Desktop.
Save ryansechrest/e75ada4d3f161789a68a to your computer and use it in GitHub Desktop.
Useful programs for CentOS 7.

Programs

firewall-cmd

firewalld command line client

View firewall state
firewall-cmd --state

--state — Check whether firewall daemon is active.

View active zones
firewall-cmd --get-active-zones

--get-active-zones — Print currently active zones with interfaces and sources used.

View rules
firewall-cmd --zone=public --list-all

--zone=public — Name of the zone.

--list-all — View everything added or enabled for zone.

Open port
firewall-cmd --zone=public --add-port=80/tcp --permanent

--zone=public — Name of the zone.

--add-port=80/tcp — Add port to the zone.

--permanent — Save changes permanently.

Reload firewall
firewall-cmd --reload

--reload — Reload firewall rules.

systemctl

Control the systemd system and service manager.

Reload service
systemctl reload sshd.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment