我在文档中注意到,启用 IPv6 转发会在主机发送的邻居发现数据包上设置一个“IsRouter”标志。事实上,它指出在启用转发时“假定路由器行为”。
这看起来似乎是不错的逻辑,但它确实排除了 IPv6 NAT 的边缘情况(是的,它们很罕见)。例如,在 ULA 子网上运行 NAT 虚拟网络的容器主机 (Docker) fc00::/64
。内部网络全部由容器软件(Docker)配置,不使用ND。但对于外部 LAN 来说,主机只是一台主机,而不是通往其他任何地方的路由器。
主机将自己广告为路由器几乎没有任何意义。
我不清楚主机是否正在向其有路由的 LAN 进行广告fc00::/64
。这可能很糟糕,因为同一 LAN 上可能有许多主机都广播对同一子网的访问。
有没有办法forwarding
在不启用其他假设的情况下启用 IPv6,特别IsRouter
是在 ND 数据包上?
https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
forwarding - INTEGER
Configure interface-specific Host/Router behaviour.
Note: It is recommended to have the same setting on all
interfaces; mixed router/host scenarios are rather uncommon.
Possible values are:
0 Forwarding disabled
1 Forwarding enabled
FALSE (0):
By default, Host behaviour is assumed. This means:
1. IsRouter flag is not set in Neighbour Advertisements.
2. If accept_ra is TRUE (default), transmit Router
Solicitations.
3. If accept_ra is TRUE (default), accept Router
Advertisements (and do autoconfiguration).
4. If accept_redirects is TRUE (default), accept Redirects.
TRUE (1):
If local forwarding is enabled, Router behaviour is assumed.
This means exactly the reverse from the above:
1. IsRouter flag is set in Neighbour Advertisements.
2. Router Solicitations are not sent unless accept_ra is 2.
3. Router Advertisements are ignored unless accept_ra is 2.
4. Redirects are ignored.
Default: 0 (disabled) if global forwarding is disabled (default),
otherwise 1 (enabled).