firewall防火墙配置

防火墙列表
firewall-cmd --list-all
添加防火墙策略
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.10.5" port protocol="tcp" port="10050" accept'
删除防火墙策略
firewall-cmd --permanent --remove-rich-rule=' rule family="ipv4" source address="192.168.10.5" port protocol="tcp" port="10050" accept '
丢弃来自192.168.10.1的任何连接
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.10.1" drop'
添加端口策略
firewall-cmd --permanent --add-port=${port}/tcp
firewall-cmd --permanent --remove-port=${port}/tcp
重启防火墙
firewall-cmd --reload
参数
--permanent 永久

猜你喜欢

转载自blog.csdn.net/slovyz/article/details/53318577
今日推荐