@
royzheng 我本来是想用网关 MAC 生成网关的 EUI64 地址,再用::ffff:ffff:ffff:ffff 匹配本地链路和全球地址两个
现在不用 mac 生成了,用$(ip -6 route | awk '/^default/ {print $5}')获取一个网关地址,一般是本地链路,然后匹配它的::ffff:ffff:ffff:ffff
GATEWAY_IPV6=$(ip -6 route | awk '/^default/ {print $5}')
ebtables -t filter -A FORWARD -i $INTERFACE -p IPV6 --ip6-protocol udp --ip6-destination ${GATEWAY_IPV6}/::ffff:ffff:ffff:ffff --ip6-destination-port 53 -j ACCEPT
ebtables -t filter -A FORWARD -i $INTERFACE -p IPV6 --ip6-destination ${GATEWAY_IPV6}/::ffff:ffff:ffff:ffff -j DROP