Static IPv6 Gateway in TrueNAS Core Jail Fails.

Janky Jay

Dabbler
Joined
Jul 23, 2016
Messages
27
Hello All,

I'm using TrueNAS Core 13.0-U3.1 and I've been attempting to assign a static IPv6 address to an already working IPv4 jail. I'm currently using the VNET emulation and everything appears to be in order, but when I attempt to start the jail, I get the following error:


Code:
* Starting test-jail
  + Started OK
  + Using devfs_ruleset: 1001 (iocage generated default)
  + Configuring VNET FAILED
  route: writing to routing socket: Network is unreachable
add net default: gateway fe80::230:30ff:fe8b:6c13 fib 0: Network is unreachable


This is the correct IPv6 gateway for the LAN. I'm able to use it from many other systems (including the host.)

Also, if I configure the jail to use "Autoconfigure IPv6," everything works as expected (via SLAAC.) The correct (same) IPv6 gateway is assigned but, of course, the static IP I want is not.

Is there something simple I'm missing here? Has anyone else successfully assigned a static IPv6 address to their jail that can help point me in the right direction? There doesn't seem to be that many options to change for such an assignment so I'm quite dumbfounded as to why the gateway is causing the jail to fail upon startup. Perhaps the jail is assigning the v6 gateway too early or something? Any insights into why this is happening would be greatly appreciated.

Regards,
Janky Jay, III
 

Janky Jay

Dabbler
Joined
Jul 23, 2016
Messages
27
A quick update:

If I remove the IPv6 default gateway, the jail will start with the static IPv6 address assigned. However, manually adding the v6 gateway from the jail once it started results in a non-working v6 route (seems like it's unable to route out?)

I'm also noticing that when I attempt to remove the IPv6 configuration via the TrueNAS web UI, when I save, old IPv6 configuration goes right back into place. I'm unable to remove the IPv6 configuration from the jail via the UI. I have to log in use iocage to remove all the settings. I'm guessing this is a bug?
 

Janky Jay

Dabbler
Joined
Jul 23, 2016
Messages
27
So, it looks like I've found the problem. If you do not set the IPv6 configuration to "Autoconfigure IPv6," the jail does not get a link-local address. I figured the /etc/rc.conf configuration of "ipv6_activate_all_interfaces="YES"" would take care of this but, apparently not.

Manually adding:
Code:
ifconfig_epair0b_ipv6="inet6 2001:db8:abcd:abcd::16 prefixlen 64 auto_linklocal"
ipv6_defaultrouter="fe80::abc:abcd:dead:beef%epair0b"

to the /etc/rc.conf in the jail and restarting it does, indeed, add the link-local address, the static IPv6 address and the IPv6 default router as expected.

While I wouldn't consider this "solved," at least there is a workaround. I'm still unsure why the static configuration from the TrueNAS web UI does not work.
 
Top