I have a VPS running Debian 10 and I have for example the following /64 subnet:
2001:db8:abcd:abcd::/64
How can I use a single IP from this subnet?
For example if I want to use this single IPv6 for a process: 2001:db8:abcd:abcd::1234/128, what do I have to add to /etc/network/interfaces to make it work? By default it doesn't respond to pings and it just timeouts.
Thanks a lot!
1 Answer
I would try ip address add 2001:db8:abcd:abcd::1234 dev enp1s0. (The device should be changed depending of your configuration).
If this works, add the following lines in the /etc/network/interfaces to make the new address added in the boot process.
iface enp1s0 inet6 static
address 2001:db8:abcd:abcd::1234
Note, that, when you said you have a 2001:db8:abcd:abcd::/64 network, you are only sure to be able to use the ::0 address, the whole 2001:db8:abcd:abcd::/64 doesn’t necessarily belongs to you (one of the address is your gateway and is attached to the VPS (virtual) router). But I think however you should be able to use all the 2^64-1 addresses remaining. (I have tried with a ::1 address, it works !)
-
You need a subnet mask in there somewhereChris Davies– Chris Davies2021-10-30 11:11:17 +00:00Commented Oct 30, 2021 at 11:11
-
The default netmask is 128 which is ok for an secondary address. I assume that a primary address is already set with a 64 bits netmask… and it won’t be deleted.Frédéric Loyer– Frédéric Loyer2021-10-30 12:10:40 +00:00Commented Oct 30, 2021 at 12:10