Bugzilla – Bug 1688
Routers should advertise themselves from the link-local address
Last modified: 2013-06-20 04:09:26 UTC
This means the routing table should have link-local address as next hop. you can reference http://keepingitclassless.net/2013/03/ipv6-next-hop-best-practices/ this article's name is "IPv6 Next-Hop Best Practices".
Created attachment 1601 [details] Modify route r1's routing table, now the next-hop address is link-local.
*** Bug 1696 has been marked as a duplicate of this bug. ***
For a discussion on this bug. see Bug 1646
Created attachment 1611 [details] patch
Created attachment 1612 [details] new patch, cleaned
fixed in changeset 9848:800877664177
I think the following assertion is too much, isn't it ? src/internet/model/ipv6-static-routing.cc 4.13 void Ipv6StaticRouting::AddNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse, uint32_t metric) 4.14 { 4.15 NS_LOG_FUNCTION (this << network << networkPrefix << nextHop << interface << prefixToUse << metric); 4.16 + NS_ASSERT_MSG(nextHop.IsLinkLocal(), "Ipv6StaticRouting::AddNetworkRouteTo - Next hop must be link-local"); I guess, the requirement described in the RFC(4861, Section 8) is only about routers, not necessary for hosts. # since I have a code to configure a host. routing->SetDefaultRoute (Ipv6Address ("2001:1:2:6::2"), 1, Ipv6Address ("::"), 0);
(In reply to comment #7) > I think the following assertion is too much, isn't it ? > > src/internet/model/ipv6-static-routing.cc > > 4.13 void Ipv6StaticRouting::AddNetworkRouteTo (Ipv6Address network, > Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address > prefixToUse, uint32_t metric) > 4.14 { > 4.15 NS_LOG_FUNCTION (this << network << networkPrefix << nextHop << > interface << prefixToUse << metric); > 4.16 + NS_ASSERT_MSG(nextHop.IsLinkLocal(), > "Ipv6StaticRouting::AddNetworkRouteTo - Next hop must be link-local"); > > > I guess, the requirement described in the RFC(4861, Section 8) is only about > routers, not necessary for hosts. > > # since I have a code to configure a host. > routing->SetDefaultRoute (Ipv6Address ("2001:1:2:6::2"), 1, Ipv6Address > ("::"), 0); According to the RFC, a router must advertise itself from the link-local address, and this is consistent, as the hosts should be able to reach it from the link local network. If an host can't reach the default router from the link-local address, it means only one thing: that the router isn't in their LL network and there's another router in between, so that router can't be the default one. Moreover, a router could (and should) discard packets that should be routed and are sent to its global address (it's a risk, they could be from loops or forged by an attacker). I know using link-local addresses can be a pain, but even hosts should use that kind of address. I'm going to revamp the helpers to set up the routers, including radvd. This should help a bit. Cheers, T.