497
个编辑
更改
→firewall常用命令
* 指定特定源IP访问某端口
<pre>
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.1" port protocol="tcp" port="80" accept" #添加源IP 192.168.100.1访问80端口firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.0/24" port protocol="tcp" port="80" accept" #添加IP段访问80端口firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.100.1" port protocol="tcp" port="80" accept" #删除源IP 192.168.100.1访问80端口
</pre>
* 指定特定源IP开放所有端口