centos7防火墙命令

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

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,可自由转载、引用,但需署名作者且注明文章出处。

9 条评论

  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

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

  7. cxkpfleutq
    cxkpfleutq

    做了几十年的项目 我总结了最好的一个盘(纯干货)coinsrore.com

  8. hbsjkofzks
    hbsjkofzks

    新车即将上线 真正的项目,期待你的参与coinsrore.com

  9. qsphbshrys
    qsphbshrys

    2025年10月新盘 做第一批吃螃蟹的人coinsrore.com
    新车新盘 嘎嘎稳 嘎嘎靠谱coinsrore.com
    新车首发,新的一年,只带想赚米的人coinsrore.com
    新盘 上车集合 留下 我要发发 立马进裙coinsrore.com
    做了几十年的项目 我总结了最好的一个盘(纯干货)coinsrore.com
    新车上路,只带前10个人coinsrore.com
    新盘首开 新盘首开 征召客户!!!coinsrore.com
    新项目准备上线,寻找志同道合的合作伙伴coinsrore.com
    新车即将上线 真正的项目,期待你的参与coinsrore.com
    新盘新项目,不再等待,现在就是最佳上车机会!coinsrore.com
    新盘新盘 这个月刚上新盘 新车第一个吃螃蟹!coinsrore.com

添加新评论