Yes, you can use SIOCADDRT. Just create an AF_INET6 socket for it. For example, look at the implementation of Busybox " route ". Also consider using Netlink, possibly through libnl .
Sorry for the late answer, I searched for it myself and found that the accepted answer is a bit lacking.
source
share