以下是我精简的ARP
规则集,仅显示广播规则,其他规则(此处未显示)不相关。
请参阅有问题的代码注释(?)
#!/usr/sbin/nft -f
add chain arp arp_table input {
# filter = 0
# Packets delivered to the local system
type filter hook input priority filter; policy drop;
}
add chain arp arp_table output {
# filter = 0
# Packets send by the local system
type filter hook output priority filter; policy drop;
}
# ARP Broadcast address
define broadcast_ether = { ff:ff:ff:ff:ff:ff }
# IPv4 network address
define network_addr_4 = { 192.168.1.0/24 }
# NIC ether address
define physical_ether = { bb:c9:51:d4:4a:b6 }
# Why input to broadcast address never hits?
# This rule should handle broadcast input
add rule arp arp_table input arp daddr ether $broadcast_ether log prefix "ACCEPT input broadcast: " accept
# Why input to 00:00:00:00:00:00 hits instead?
# This rule handles input toward 00:00:00:00:00:00 from LAN
add rule arp arp_table input arp saddr ip $network_addr_4 arp daddr ether 00:00:00:00:00:00 accept
# Why output to broadcast never hits?
# This rule should handle output toward ff:ff:ff:ff:ff:ff to LAN
add rule arp arp_table output arp daddr ether $broadcast_ether log prefix "ACCEPT output broadcast: " accept
# Why output to 00:00:00:00:00:00 hits instead?
# This rule handles output toward 00:00:00:00:00:00 to LAN
add rule arp arp_table output arp saddr ether $physical_ether arp daddr ether 00:00:00:00:00:00 accept
这里有几个问题,主要问题是ARP
广播流量ff:ff:ff:ff:ff:ff
不存在,这就是为什么我添加了日志语句以希望捕获这种流量,但它从未出现,对于input
和output
流量都如此。
相反,我看到很多针对00:00:00:00:00:00
地址的输入/输出,这表明该00:00:00:00:00:00
地址某种程度上是广播地址。
所以主要的问题是为什么我看不到ARP
指向广播地址的流量以及为什么00:00:00:00:00:00
使用地址来代替?
第二个问题是,什么是00:00:00:00:00:00
地址?为什么需要它以及它意味着什么?
如果我阻止来往的流量00:00:00:00:00:00
(例如,通过删除这些规则),那么网络将由于此类ARP
数据包被丢弃而停止运行。