在centos7中iptables已经废弃不用
firewalld命令:
查看所有规则
firewall-cmd --list-all
修改规则
cd /etc/firewalld/zones
vim public.xml
<rule family="ipv4"> <source address="172.16.0.250"/> <!-- <port protocol="tcp" port="6379"/> --> <accept/> </rule> <rule family="ipv4"> <source address="192.168.7.40"/> <!-- <port protocol="tcp" port="3306"/> --> <accept/> </rule> <rule family="ipv4"> <source address="172.16.0.240"/> <accept/> </rule> <rule family="ipv4"> <source address="192.168.7.238"/> <accept/> </rule>
标签:--,firewalld,防火墙,centos7,firewall,规则 From: https://www.cnblogs.com/sdgtxuyong/p/17032715.html