iptables:为 IP 别名设置特定规则

iptables:为 IP 别名设置特定规则

我们运行多个游戏服务器,所有服务器都使用一个端口并使用 IP 别名,游戏服务器绑定到属于主专用服务器的特定别名 IP。

我已经设置了 netplan 并且它可以运行,但是我无法为 iptables 设置特定于 IP 的规则。

游戏服务器均使用UDP端口19132。

我已尝试制定 INPUT 规则,将目标逐一设置为别名 IP,并将其配对的 OUTPUT 规则与源 IP 作为别名 IP。

iptables -A INPUT -d xx.xx.xx.xx -p udp --dport 19132 -j ACCEPT
iptables -A OUTPUT -s xx.xx.xx.xx -p udp --dport 19132 -j ACCEPT

这样做没有用,我仍然无法通过 UDP 端口连接。

相关内容