Skip to content

Instantly share code, notes, and snippets.

@iintothewind
Last active September 3, 2019 13:11
Show Gist options
  • Select an option

  • Save iintothewind/5e673e4097803257a7f23bb41a4d3bb7 to your computer and use it in GitHub Desktop.

Select an option

Save iintothewind/5e673e4097803257a7f23bb41a4d3bb7 to your computer and use it in GitHub Desktop.
firewalld cheat sheet

启动一个服务:

systemctl start firewalld.service

关闭一个服务:

systemctl stop firewalld.service

重启一个服务:

systemctl restart firewalld.service

显示状态:

firewall-cmd --state

查看所有打开的端口:

firewall-cmd --zone=public --list-ports

更新防火墙规则:

firewall-cmd --reload

添加一个端口:

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

删除一个端口:

firewall-cmd --zone= public --remove-port=80/tcp --permanent 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment