I have read Adding a whole IPv6 /64 block to an network interface on debian We want to make use of the AnyIP feature to add a whole IPv6 /64 subnet block to a web hosting server but using Netplan because we are on Ubuntu 18.04
Side note: a couple of experts have advised against using AnyIP to configure IPv6 so we will also look at alternative solutions like manually configuring a smaller number of IPs.
Our datacenter does already route the /64 to a single IP, for example
The range 2001:db8:1:10::0/64 is routed to the IP 2001:db8:1::1:10
The range 2001:db8:1:11::0/64 is routed to the IP 2001:db8:1::1:11
In Netplan I can configure single IPs this way
network:
version: 2
renderer: networkd
ethernets:
eth0:
accept-ra: no
addresses:
- '2001:db8:1::1:10/48'
- '2001:db8:1:10::0/64'
- '2001:db8:1:10::1/64'
gateway6: '2001:db8:1::1'
And this works. However I want to use the whole 2001:db8:1:10::/64
range on this server and I don't want to configure it in 18446744073709551616 lines.
Executing this command makes me able to ping all the /64 IPs from outside:
ip -6 route add local 2001:db8:1:10::/64 dev lo
Side note: a server daemon needs to support IP_FREEBIND
to be able to bind to an IP which is not explicitly configured on an interface.
My question is: instead of having to execute ip -6 route add local ..
after each reboot I would like to configure it the proper way inside the Netplan Yaml config.
18,446,744,073,709,551,616
addresses? Also, IPv6 allows you to use every address in s subnet, including the subnet address, so assigning1aaa:2bbb:1:10::/64
to an interface is actually only assigning that single address to the interface, not the entire subnet.1aaa:2bbb:1:10::/64
only adds one IP being1aaa:2bbb:1:10::0
. The question is how to add the whole range at once.lo
. Just be aware of it if you do start hosting containers or VMs in future.