使用 ip6tables 可以生成以下 ICMP 错误代码(根据手册页):
--reject-with type
The type given can be icmp6-no-route, no-route, icmp6-adm-prohibited, adm-prohibited, icmp6-addr-unreachable, addr-unreach, icmp6-port-unreachable or port-unreach which return the appropriate ICMPv6 error message (port-unreach is the default).
例子:
[root@outside-pc ~]# ip6tables -A INPUT -s 2001::/64 -p ICMPv6 -j REJECT --icmpv6-type destination-unreachable
[root@outside-pc ~]# ip6tables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -s 2001::/64 -p ipv6-icmp -m icmp6 --icmpv6-type 1 -j REJECT --reject-with icmp6-port-unreachable
是否可以使用 ip6tables 生成其他错误代码,例如“packet-too-big”(类型 2,代码 0)?