zoukankan      html  css  js  c++  java
  • centos7 关闭防火墙

    1、关闭firewall:
    systemctl stop firewalld.service #停止firewall
    systemctl disable firewalld.service #禁止firewall开机启动
    firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

    2、iptables防火墙(这里iptables已经安装,下面进行配置)
    vi/etc/sysconfig/iptables #编辑防火墙配置文件
    # sampleconfiguration for iptables service
    # you can edit thismanually or use system-config-firewall
    # please do not askus to add additional ports/services to this default configuration
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT[0:0]
    :OUTPUT ACCEPT[0:0]
    -A INPUT -m state--state RELATED,ESTABLISHED -j ACCEPT
    -A INPUT -p icmp -jACCEPT
    -A INPUT -i lo -jACCEPT
    -A INPUT -p tcp -mstate --state NEW -m tcp --dport 22 -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -jACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 8080-j ACCEPT
    -A INPUT -j REJECT--reject-with icmp-host-prohibited
    -A FORWARD -jREJECT --reject-with icmp-host-prohibited
    COMMIT
    :wq! #保存退出

    今日事今日毕
  • 相关阅读:
    POJ 2752 Seek the Name, Seek the Fame
    POJ 2406 Power Strings
    KMP 算法总结
    SGU 275 To xor or not to xor
    hihocoder 1196 高斯消元.二
    hihoCoder 1195 高斯消元.一
    UvaLive 5026 Building Roads
    HDU 2196 computer
    Notions of Flow Networks and Flows
    C/C++代码中的笔误
  • 原文地址:https://www.cnblogs.com/gjack/p/8398346.html
Copyright © 2011-2022 走看看