IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    CentOS 关闭防火墙

    usity发表于 2016-11-18 01:52:10
    love 0

    CentOS 6:

    1) 永久性生效,重启后不会复原

    开启: chkconfig iptables on

    关闭: chkconfig iptables off

    2) 即时生效,重启后复原

    开启: service iptables start

    关闭: service iptables stop

    CentOS 7:

    systemctl start firewalld.service#启动firewall
    systemctl stop firewalld.service#停止firewall
    systemctl disable firewalld.service#禁止firewall开机启动

     

    查询TCP连接情况:

     netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

    查询端口占用情况:

     netstat   -anp   |   grep  portno(例如:netstat –apn | grep 80)



沪ICP备19023445号-2号
友情链接