问题
firewalld 需要 ipset IPtables 规则来执行以下规则:
-A INPUT -p tcp -m set --match-set SQL_1811 src -m set --match-set DB-IPs dst -m tcp --dport 1811 -j ACCEPT
on
it
road
.com
解决方法
下面的示例使用 SQL_1811 和 DB-IP 作为两个 IP 地址(10.1.1.2 和 10.1.1.3)的 IPsets
# firewall-cmd --permanent --new-ipset=SQL_1811 --type=hash:ip # firewall-cmd --permanent --new-ipset=DB-IPs --type=hash:ip # firewall-cmd --reload # firewall-cmd --ipset=SQL_1811 --add-entry=10.1.1.2 # firewall-cmd --ipset=DB-IPs --add-entry=10.1.1.3 # firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp -m set --match-set SQL_1811 src -m set --match-set DB-IPs dst -m tcp --dport 1811 -j ACCEPT
日期:2020-09-17 00:12:26 来源:oir作者:oir