Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My ISP offers IPv6 by default. However, my ISPs IPv6 setup appears to be a bit strange because the default IPv6 gateway is located outside of my servers subnet. Under linux it is possible to setup a static route to that gateway using ip -6 route add <gateway ip> dev <interface>. However, this doesn't work on openbsd, does anybody know the equivalent of that command on openbsd or does anyone know know another approach to fix this problem?

share|improve this question
Typically it would be a link-local address, in particular in the context of SLAAC. Is that what you mean by "outside my server's subnet"? – Håkan Lindqvist Jul 14 '14 at 16:15

I know three approaches to solve this:

  • Find another IPv6 address of the gateway. It might have multiple assigned to the interface. Which one you use as gateway does not make any difference, as long as neighbor discovery can resolve it to the correct MAC address.
  • Add a static route specifying that the prefix containing that MAC address is directly connected to the given Ethernet interface. This should work even if you don't have an address in that prefix yourself. You should use a /128 for that static route, unless you have a very specific reason to do otherwise.
  • Make up an IPv6 address for the gateway and insert it manually in the neighbor cache. This approach will only work if you know the MAC address of the gateway and it remains fixed. This should work on any OS where you can manually create neighbor cache entries, but I have only tested it on Linux.
share|improve this answer

Add the following to /etc/rc.conf:


then reset networking by either rebooting or running

/etc/rc.d/network_ipv6 restart

Or you can do it by hand:

 route -n add -inet6 default <v6-gateway-ip>
share|improve this answer
The "do it by hand" method returns "route: writing to routing socket: Network is unreachable" and I didn't test the other method because /etc/rc.d/network_ipv6 doesn't exist on my system. – RNieaa Dec 20 '13 at 21:25

This looks like a possible network mis-config. The default router for each network segment in IPv6 is carried in the Router Announcement. Look to see what they're giving you in the RA, it should be a link-layer (fe80:...) IPv6 address.

You can over-ride that, as noted above, but you shouldn't have to.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.