I can't add ipv6 aliases to my server. I've tried with FreeBSD, posted here and I'm trying NetBSD on a different server with the same provider. Linux just works, so I'm not sure what I'm missing to get BSD's to work.
When I add an ipv6 alias, it doesn't work until I ping the gateway. Then it works for a few minutes and eventually stops working. Ping the gateway, and it comes back online.
I've been reading https://www.netbsd.org/docs/network/ipv6/ and tried dhcpcd first with ip6mode="autohost"
in /etc/rc.conf
but did not get an ipv6 address autoconfigured, so I'm manually configuring addresses.
I've also consulted https://www.netbsd.org/docs/guide/en/chap-net-practice.html but I think some of it is outdated as it suggests a sysctl that doesn't exist.
sysctl net.inet6.ip6.accept_rtadv
sysctl: fourth level name 'accept_rtadv' in 'net.inet6.ip6.accept_rtadv' is invalid
What I've tried:
NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC
I've been assigned 2602:fed2:7116:d82c::1/64
gateway 2602:fed2:7116::1
Using the /64 in my ifconfig.vioif0 I cannot connect. If I try to add a default route.
route add -inet6 default 2602:fed2:7116::1
route: writing to routing socket: Network is unreachable
add net default: gateway 2602:fed2:7116::1: Network is unreachable
I think this is because the gateway is on a different subnet. I tried adding a route to the gateway, but that didn't help.
route add -inet6 2602:fed2:7116::1 2602:fed2:7116:d82c::1
I changed my address to a /48 and then it works, but that doesn't seem like the right way to solve this problem, and I still don't get additional aliases working properly.
Here's my current settings.
/etc/ifconfig.vioif0
inet6 2602:fed2:7116:d82c::1 prefixlen 48 alias
# NOTE: I put alias on the end because the ipv6 docs https://www.netbsd.org/docs/network/ipv6/ say it's mandatory
/etc/resolv.conf
nameserver 2620:fe::fe
/etc/mygate6
2602:fed2:7116::1
Then I can add an alias, and get it temporarily working by pinging the gateway.
ifconfig vioif0 inet6 2602:fed2:7116:d82c::5 prefixlen 48 alias
ping6 -S 2602:fed2:7116:d82c::5 2602:fed2:7116::1
Do I need to be running rtadvd or something because I have a /64? I tried that on FreeBSD unsucsessfully, but could have had that misconfigured.
I've been poking at this for 6 months and still haven't figured it out, so any help would be greatly appreciated.