1

I want to remove the default IPv6 link-local address of an interface and want to replace it with a customized IPv6 link-local address?

Can you help me here?

If I assign a new link-local IPv6 address as below, then the interface shows two link-local IPv6 addresses. /sbin/ip -6 addr add fe80::ade1:ac14:1334/64 dev eth0 scope link

I know below command can remove the old link-local IPv6 address, is there any other way to remove it without specifying the address? sbin/ip -6 addr del dev eth0.

5
  • 1
    Link-local addresses are automatically generated either by generating a random one or by using the MAC address, inverting bit 7 and adding ff:fe in the middle.
    – xdevs23
    Apr 26, 2020 at 15:49
  • Please edit the question and explain why you'd like to change the link-local address without changing the MAC address. You'd be breaking part of the IPv6 protocol if you do so. If you want static additional link-local addresses, you can do so with ULAs, without having to remove the original link-local address.
    – dirkt
    Apr 26, 2020 at 17:22
  • This is just for a small experiment I am doing by disabling the DAD (Duplicate Address Detection). Since DAD is disabled, I want to assign a unique link-local IPv6 address by myself. Apr 27, 2020 at 9:47
  • @dirkt No that is not true. LL addresses aren't tied to MAC addresses. Windows has never (since Vista!) really used MAC-based IPv6 addresses, but rather RFC 7217 addresses. It is a fallacy to assume EUI-64 is always valid for LL and assuming this will break stuff in the future. Also, routers in a segment are often set to fe80::1 for simplicity. And that is totally okay to do!
    – TJJ
    Mar 20, 2021 at 13:38
  • One obvious use case: having stable addresses in protocols like babel (which only use link local addresses). ip token seems not to work in some places.
    – Elrond
    Dec 24, 2023 at 14:04

1 Answer 1

-3

IP address is mandatory for ip -6 a del command so you should write a small scipt to find out IPv/6 address. Original local link address contains MAC address of the interface in converted EUI-64 ID format what means the first byte's of the 7th bit of the MAC adsress is complemented.

Example: ip a show enp0s8 command output (unnecessary parts removed):

enp0s8: ...

link/ether 08:00:27:02:8a:41 brd ff:ff:ff:ff:ff:ff

inet6 fe80::0a00:27ff:fe02:8a41/64 scope link

EUI-64 ID: 08:00:27:FFFE:02:8a:41

Converted EUI-64 ID, complement 7th bit: 08 (0000 1000) will 0a (0000 1010)

From MAC adress you can construct the original local link IP and after you can use to delete this IPv6 address.

1
  • I can also use the getifaddrs() to get all the IP addresses assigned to the particular interface, filter out the IPv6 link-local address from the list and use it as an argument to the del command. Just wanted to know if there is any simpler way to do this. Apr 27, 2020 at 9:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .