zoukankan      html  css  js  c++  java
  • linux下开启防火墙,打开端口

    service iptables start时提示:“iptables: No config file.                                  [WARNING]”

    此时打开配置文件所在目录,如

    [root@EM5VMA064 sysconfig]# cd /etc/sysconfig
    [root@EM5VMA064 sysconfig]# ls|grep iptables
    iptables-config
    iptables.old

    [root@EM5VMA064 sysconfig]# mv iptables.old iptables

    再次执行 service iptables start,就可以开启防火墙;

    linux下打开80 、9200端口

     1.vi打开 /etc/sysconfig/iptables文件;

    2.黏贴

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 9200 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

    注意:

    添加的行一定要在 
    -A INPUT -j REJECT --reject-with icmp-host-prohibited
    -A FORWARD -j REJECT --reject-with icmp-host-prohibited

    这两行前面,否则没有效果;

    重启防火墙。

    其他操作命令:

    查询防火墙状态:
    [root@localhost ~]# service   iptables status
    停止防火墙:
    [root@localhost ~]# service   iptables stop
    启动防火墙:
    [root@localhost ~]# service   iptables start
    重启防火墙:
    [root@localhost ~]# service   iptables restart
    永久关闭防火墙:
    [root@localhost ~]# chkconfig   iptables off
    永久关闭后启用:
    [root@localhost ~]# chkconfig   iptables on

    关闭端口则只需要将ACCEPT改成drop即可。

  • 相关阅读:
    绝对定位position: absolute;
    加号选择器(ul>li + li)
    position: absolute;绝对定位水平居中问题
    nth-child 和 nth-of-type 的区别
    Scrapy Shell 待续。。。
    TypeError: write() argument must be str, not bytes
    ModuleNotFoundError :No module named 'win32api'
    scrapy 简介
    3月27下午(补交)
    软件工程作业二:需求分析
  • 原文地址:https://www.cnblogs.com/thaughtZhao/p/5329306.html
Copyright © 2011-2022 走看看