vlambda博客
学习文章列表

centos8添加访问限制

<rule family="ipv4">

    <source address="xxx.xxx.xxx.xx/32"/>

    <accept/>

  </rule>

允许此ip访问本机22端口和80端口

<rule family="ipv4">

    <source address="xxx.xxx.xxx.xx/32"/>

    <port protocol="tcp" port="22"/>

    <port protocol="tcp" port="80"/>

    <accept/>

  </rule>

允许此ip访问本机指定端口段22-100

<rule family="ipv4">

    <source address="xxx.xxx.xxx.xx/32"/>

    <port protocol="tcp" port="22-100"/>

    <accept/>

  </rule>


允许此网段访问本机

<rule family="ipv4">

    <source address="xxx.xxx.xxx.xx/24"/>

    <accept/>

  </rule>


禁止此ip访问本机

<rule family="ipv4">

    <source address="xxx.xxx.xxx.xx"/>

    <reject/>

  </rule>