如何使组播iptables允许规则?

我有两台使用ucarp作为故障转移的服务器。 在每台服务器上, eth1:1保留用于ucarp的keepalive连接。

ucarp使用目的IP作为组播地址224.0.0.18

在ucarp主服务器上是eth1:1的IP地址192.168.245.2 ,二级服务器是eth1:1的IP地址192.168.245.3

我想在每个服务器上做一个iptables规则,所以这些网卡不会被任何人误用。 即放弃一切预期的铀。

对于主服务器,这样的规则将如何?

我假设这样?

 iptables -P INPUT -i eth1:1 -j DROP iptables -A INPUT -i eth1:1 ? something with multicast ? -j ACCEPT 

 iptables -A INPUT -i eth1:1 -m pkttype --pkt-type multicast -j ACCEPT 

确保将xt_pkttype模块加载到正在运行的内核中:

 --- Networking support Networking options ---> [*] Network packet filtering framework (Netfilter) ---> Core Netfilter Configuration ---> <*> "pkttype" packet type match support