ouyangmland

问个小问题,关于 centos 防火墙的问题

  •  
  •   ouyangmland · Sep 14, 2016 · 2852 views
    This topic created in 3574 days ago, the information mentioned may be changed or developed.
    iptables 防火墙可以写
    iptables -A OUTPUT -p tcp -m multiport --dport 24,50,57,105,106,109,110,143,158,209,218,220,465,587 -j REJECT --reject-with tcp-reset


    上面的这种多端口批量关闭

    FirewallD 的多端口用什么分隔呢
    im
        1
    im  
       Sep 14, 2016
    iptables 可以方便的配置多个端口。其中根据端口的连续性,又可分为连续端口配置和不连续端口配置。

    1 、连续端口配置

    如:

    -A INPUT -p tcp – dport 21:25 -j DROP
    注:这里是英文状态下的冒号。

    2 、使用 multiport 参数配置不连续端口

    如:

    -A INPUT -p tcp -m multiport – dport 21:25,135:139 -j DROP
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2809 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:48 · PVG 17:48 · LAX 02:48 · JFK 05:48
    ♥ Do have faith in what you're doing.