Radvd for OpenWrt? [IPv6]

I would prefer to advertise a specific "remote" IPv6 route from an interface on an OpenWrt 23.05.2 router rather than hard-coding static routes on all that interface's peers.

It does not appear that uradvd can supply an ICMPv6 RA (134) packet with an ICMPv6 Option Route Information (24)

This can be done on other Linux distributions using the standard radvd utility and a configuration such as

interface bond0
{
    IgnoreIfMissing on;
    AdvSendAdvert on;
    AdvManagedFlag on;
    AdvDefaultLifetime 0;
    route 2601:aaaa:bbbb:cccc::/64 {
        AdvRouteLifetime 300;
        AdvRoutePreference low;
    };
};

Is there an equivalent utility or another approach available under OpenWrt?


FWIW, the init file for uradvd is broken in at least two ways when trying to use device. It needs . /lib/functions/network.sh as well as the logic around using device instead of ifname to be fixed.

bird2 is able to do RA, see https://bird.network.cz/?get_doc&v=20&f=bird-6.html#ss6.14

I presume this is on a different subnet? If so can't you use a default route?

Here is what I do, my main home network is 192.168.2.0/24; I have a beagle farm that lives on the machine 192.168.2.144 - the farm address is 192.168.7.0/24.

Now on the openwrt router, in /etc/rc.local I have ip route replace 192.168.7.0/24 via 192.168.2.144 so the router knows to send packets to 192.168.2.144

This means when any machine on my local network tries to contact 192.168.7.0/24 it goes by the default route to the openwrt router; the router then forwards the packet onto 192.168.2.144; and that machine knows how to forward packets to the beagles - specifically it has:

192.168.7.0/30 dev usb0 proto kernel scope link src 192.168.7.1 metric 1024
192.168.7.16/30 dev usb1 proto kernel scope link src 192.168.7.17 metric 1024

and the machine 192.168.2.144 also knows to forward ip packets (thats enabled); and the router also does DNS for the beagle farm (and that needed enabling).

But once done, all of this is transparent.

Would this solve your problem? Done with IPv6 of course, unlike mine in IPv4.

It certainly could be and is being done with static routes on each of the involved machines. Maintenance is troublesome as not only does it require static routes on all of the involved machines, but it also requires knowledge of IP addresses used on the other interfaces. Some of the routes need to be applied on machines that are more than one link away. One of the advantages of IPv6 is stateless auto-configuration, which includes advertising routes, without needing a separate route-propagation protocol in many cases.

Be careful with ip route replace -- It may not do what you might think. It sometimes will add an additional route. If you want to replace a route you generally have to delete and add.

Interesting - always though replace was safe! Or rather it has always work flawlessly for me.

I guess a quick and dirty solution is:

ip r | grep '192.168.7.0' && ip route del 192.168.7.0/24
ip route add 192.168.7.0/24 via 192.168.2.144

Need to think if I can do the test with less sub processes - ash sh language I find always takes me ages to write code! (but at least have a dash man page now, which helps!).

I was meaning to suggest only doing a static route on the router, and not on other machine. So when the address is used by most machine, it goes via the default route to the router - and then only the router needs to redirect the pack to the right place.

If it were a simple tree topology, you're right, the routes would only need to be managed on the router(s) and all the clients could route everything not on the local link to their upstream router. For the topology at hand, the routing decisions aren't being made at a single point. Some hosts need to know to which of multiple routers to send certain traffic.

On learning POSIX sh, or unlearning bash, the shellcheck utility can be helpful.

Did you had a look at bird?

Thanks, it looks like a good, fully featured routing daemon.