I have a Ubuntu 16.04.2 server with a /64 block of IPv6s.
If I add the block, like this:
ip addr add 2001:41d0:xxx:yyy::/64 dev eth2
only the first one works:
$ curl -g http://[2001:41d0:xxx:yyy::]/
<!DOCTYPE html>...
$ curl -g http://[2001:41d0:xxx:yyy::1]/
curl: (7) Failed to connect to 2001:41d0:xxx:yyy::1 port 80: Connection timed out
If I add the others one by one, they work:
ip addr add 2001:41d0:xxx:yyy::1/128 dev eth2
What I am doing wrong?
The block is also in /etc/network/interfaces:
iface eth2 inet6 static
address 2001:41d0:xxx:yyy::
netmask 64
An interface address is a single address, although you can assign a bunch of IPv6 addresses to an interface, so you are really adding the
2001:41d0:xxx:yyy::
address in the2001:41d0:xxx:yyy::/64
network to an interface.IPv6 actually allows you to use every address in a network for a host address, unlike IPv4 where the network address cannot be used as a host address, but RFC 2373, IP Version 6 Addressing Architecture defines the Router-Subnet anycast address as the all-zeroes address for a network.
@Ron_Maupin gives a correct answer but I felt it would be complimented by a simpler one:
/64 doesn't imply the whole block is assigned to the interface. It assigned one address to the interface and tells it that the LAN has the /64 block. This is almost always what you want for an Ethernet interface.
/128 is almost never what you want for an Ethernet interface. These addresses will not be reachable from the LAN.