1

On a Fedora server, I have the following line in my /etc/sysconfig/network-scripts/ifcfg-eth0:0:

IPV6ADDR=<REDACTED>:48ea::1/64

Now binding to that specific address works:

$ nc -l <REDACTED>:48ea::1 1025

However, binding to another address in the same netmask space fails:

$ nc -l <REDACTED>:48ea::2 1025
Ncat: bind to <REDACTED>:48ea::2:1025: Cannot assign requested address. QUITTING.

If explicitly add <REDACTED>:48ea::2/128 (either by adding it to IPV6ADDR_SECONDARIES or by running ip addr add <REDACTED>:48ea::2/128 dev eth0), then I can bind to it.

Why adding the /64 address is not enough? Do I have to explicitly add every single /128 address to the device before using it?

1 Answers1

2

The number after the / is the subnet size, which is (almost) always a /64 in IPv6. It doesn't say anything about your local machine. Just like with IPv4 you still have to assign each individual address to the interface.

With IPv4 you can write both 192.168.0.1/24 and 192.168.0.1/255.255.255.0. They mean exactly the same.

With IPv6 writing <REDACTED>:48ea::1/ffff:ffff:ffff:ffff:: (or even <REDACTED>:48ea::1/ffff:ffff:ffff:ffff:0000:0000:0000:0000) would become a bit unwieldy, so only the <REDACTED>:48ea::1/64 notation is used.

Sander Steffann
  • 1,496
  • 8
  • 11