(找到解决方案,见下文...)
服务器 (CentOS 7) 有多个公共 IP,这些都是通过常用的ifcfg-eth0:0配置文件设置的,并且运行良好。我正在尝试适应 firewalld(来自 iptables)。我喜欢能够为每个 IP 别名指定开放端口 - 使用 iptables,只需将目标 IP 设置为匹配端口所需的任何别名即可完成。
我认为使用 firewalld 我可以对每个接口应用不同的区域以达到相同的效果,但似乎我不能这样做。
我们从:
# firewall-cmd --get-active-zones
public
interfaces: eth0 eth0:0
trusted
interfaces: eth1
Run Code Online (Sandbox Code Playgroud)
我创建了一个public_web我想用于的新区域eth0:0
# firewall-cmd --permanent --new-zone=public_web
success
# firewall-cmd --permanent --zone=public_web --add-service=http
success
# firewall-cmd --permanent --zone=public_web --add-interface=eth0:0
success
# firewall-cmd --reload
success
Run Code Online (Sandbox Code Playgroud)
但...
# firewall-cmd --get-active-zones
public
interfaces: eth0 eth0:0
trusted
interfaces: eth1
Run Code Online (Sandbox Code Playgroud)
我尝试了--remove-interface,--change-interface以及各种顺序的各种其他命令,但eth0:0不会让步。我似乎无法在任何地方找到任何关于使用别名的文档,所以我不确定这是否是实现我想要的正确方法?
谢谢大家。
解决方案是destination …