2

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
Cory Knutson
  • 1,866
  • 12
  • 20
the_nuts
  • 412
  • 6
  • 18

2 Answers2

4

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 the 2001: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.

2.6.1 Required Anycast Address

The Subnet-Router anycast address is predefined. Its format is as follows:

|                         n bits                 |   128-n bits   |
+------------------------------------------------+----------------+
|                   subnet prefix                | 00000000000000 |
+------------------------------------------------+----------------+

The "subnet prefix" in an anycast address is the prefix which identifies a specific link. This anycast address is syntactically the same as a unicast address for an interface on the link with the interface identifier set to zero.

Packets sent to the Subnet-Router anycast address will be delivered to one router on the subnet. All routers are required to support the Subnet-Router anycast addresses for the subnets which they have interfaces.

Ron Maupin
  • 3,158
  • 1
  • 11
  • 16
4

@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.

Rodney
  • 318
  • 1
  • 8