I have the following addresses from my provider (documentation examples):
IPv4 address - 203.0.113.2/24
Gateway - 203.0.113.1
IPv6 address - 2001:DB8::2/64
Gateway - fe80::1
The provider offers IPv4 DHCP (although the addresses can be programmed manually), but does not provide any IPv6 discovery/configuration.
There are a number of problems - the first is under what circumstances an IPv6 link local address is allocated to the TrueNAS server. There are two settings which determine whether a fe80::/64 link local address is used. It does seem that it is not possible to use fe80::1 as a default gateway under any circumstances.
I have found out that if you set both IPv4 DHCP and Autoconfigure IPv6 to off, enter the static IPv6 address, test and save the configuration and then come back and turn both IPv4 DHCP and Autoconfigure IPv6 to on. The static IPv6 address is still configured, and the link local address is created. However, despite the fact that the server now has an address in fe80::/64, the gateway fe80::1 is still not valid. In fact, when one tries to use it, the following error/traceback occurs as the web interface seems to think that fe80::1 cannot be a valid gateway under any circumstances:
It seems that what you can do with IPv6 addresses in the web interface is entirely dependent on whether IPv4 is DHCP or not which does seem a bit strange.
If I perform the following steps:
So it seems that the web interface won't let a valid IPv6 configuration be implemented.
The question is, therefore, how do I manually edit the configuration without using the web interface?
IPv4 address - 203.0.113.2/24
Gateway - 203.0.113.1
IPv6 address - 2001:DB8::2/64
Gateway - fe80::1
The provider offers IPv4 DHCP (although the addresses can be programmed manually), but does not provide any IPv6 discovery/configuration.
There are a number of problems - the first is under what circumstances an IPv6 link local address is allocated to the TrueNAS server. There are two settings which determine whether a fe80::/64 link local address is used. It does seem that it is not possible to use fe80::1 as a default gateway under any circumstances.
IPv4 DHCP | Autoconfigure IPv6 | Can enter static IPv6 address | fe80::/64 link local network created | fe80::1 pingable | fe80::1 valid gateway |
Yes | Yes | No | Yes | Yes | No |
Yes | No | No | No | No | No |
No | Yes | No | Yes | Yes | No |
No | No | Yes | No | No | No |
I have found out that if you set both IPv4 DHCP and Autoconfigure IPv6 to off, enter the static IPv6 address, test and save the configuration and then come back and turn both IPv4 DHCP and Autoconfigure IPv6 to on. The static IPv6 address is still configured, and the link local address is created. However, despite the fact that the server now has an address in fe80::/64, the gateway fe80::1 is still not valid. In fact, when one tries to use it, the following error/traceback occurs as the web interface seems to think that fe80::1 cannot be a valid gateway under any circumstances:
Code:
Error: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/middlewared/main.py", line 204, in call_method result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self) File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1344, in _call return await methodobj(*prepared_call.args) File "/usr/lib/python3/dist-packages/middlewared/service.py", line 576, in update rv = await self.middleware._call( File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1344, in _call return await methodobj(*prepared_call.args) File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1246, in nf res = await f(*args, **kwargs) File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1378, in nf return await func(*args, **kwargs) File "/usr/lib/python3/dist-packages/middlewared/plugins/network_/global.py", line 353, in do_update await self.middleware.call('route.sync') File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1395, in call return await self._call( File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1344, in _call return await methodobj(*prepared_call.args) File "/usr/lib/python3/dist-packages/middlewared/plugins/network_/route.py", line 138, in sync routing_table.add(ipv6_gateway) File "/usr/lib/python3/dist-packages/middlewared/plugins/interface/netif_linux/routing.py", line 202, in add self._op("add", route) File "/usr/lib/python3/dist-packages/middlewared/plugins/interface/netif_linux/routing.py", line 235, in _op ip.route(op, **kwargs) File "/usr/lib/python3/dist-packages/pyroute2/iproute/linux.py", line 1909, in route ret = self.nlm_request(msg, File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 376, in nlm_request return tuple(self._genlm_request(*argv, **kwarg)) File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 867, in nlm_request for msg in self.get(msg_seq=msg_seq, File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 379, in get return tuple(self._genlm_get(*argv, **kwarg)) File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 704, in get raise msg['header']['error'] pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')
It seems that what you can do with IPv6 addresses in the web interface is entirely dependent on whether IPv4 is DHCP or not which does seem a bit strange.
If I perform the following steps:
- Turn IPv4 DHCP and Autoconfigure IPv6 off
- Enter Static IPv6 address
- Test and save configuration
- Turn IPv4 DHCP and Autoconfigure IPv6 on
- Start a shell and manually add the gateway -
ip -6 route add default via fe80::1 dev eno1
So it seems that the web interface won't let a valid IPv6 configuration be implemented.
The question is, therefore, how do I manually edit the configuration without using the web interface?