![有没有办法在不启用其他假设的情况下启用 IPv6 转发,特别是 ND 数据包上的 IsRouter?](https://linux22.com/image/204472/%E6%9C%89%E6%B2%A1%E6%9C%89%E5%8A%9E%E6%B3%95%E5%9C%A8%E4%B8%8D%E5%90%AF%E7%94%A8%E5%85%B6%E4%BB%96%E5%81%87%E8%AE%BE%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%E5%90%AF%E7%94%A8%20IPv6%20%E8%BD%AC%E5%8F%91%EF%BC%8C%E7%89%B9%E5%88%AB%E6%98%AF%20ND%20%E6%95%B0%E6%8D%AE%E5%8C%85%E4%B8%8A%E7%9A%84%20IsRouter%EF%BC%9F.png)
我在文档中注意到,启用 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).