centos7防火墙命令

技术文章 2019-02-01 2704 次浏览 次点赞

Centos 7 firewall 命令:
查看已经开放的端口:
firewall-cmd --list-ports
开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
命令含义:
–zone #作用域
–add-port=80/tcp #添加端口,格式为:端口/通讯协议
–permanent #永久生效,没有此参数重启后失效
重启防火墙
firewall-cmd --reload #重启firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

启动一个服务:systemctl start firewalld.service

关闭一个服务:systemctl stop firewalld.service

重启一个服务:systemctl restart firewalld.service

显示一个服务的状态:systemctl status firewalld.service

在开机时启用一个服务:systemctl enable firewalld.service

在开机时禁用一个服务:systemctl disable firewalld.service

查看服务是否开机启动:systemctl is-enabled firewalld.service;echo $?

查看已启动的服务列表:systemctl list-unit-files|grep enabled


本文由 shuaiqi 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

6 条评论

  1. gulqssfuvy
    gulqssfuvy

    你的文章内容非常专业,让人佩服。 https://www.yonboz.com/video/44129.html

  2. ovgscajhrq
    ovgscajhrq

    《革命机Valvrave》欧美动漫高清在线免费观看:https://www.jgz518.com/xingkong/144873.html

  3. qhnbnnlxam
    qhnbnnlxam

    你的文章让我学到了很多知识,非常感谢。 https://www.yonboz.com/video/66406.html

  4. xjyyxkjhih
    xjyyxkjhih

    你的才华让人惊叹,请继续保持。 https://www.4006400989.com/qyvideo/45214.html

  5. hprrqhuhyo
    hprrqhuhyo

    你的文章让我学到了很多技能,非常实用。 https://www.yonboz.com/video/45387.html

  6. wevmvnyydp
    wevmvnyydp

    独特的构思和新颖的观点,让这篇文章在众多作品中脱颖而出。

添加新评论