How to remove only one IPv6 address from an interface?
Sophia Terry
I have board with linux kernel 2.6.23.12 where on eth0 interface it has two IPv6 addresses.
root@ramana:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr FF:AB:CD:EF:85:94 inet addr:192.168.20.107 Bcast:192.168.20.255 Mask:255.255.255.0 inet6 addr: fe80::20d:b9ff:fe3c:8594/64 Scope:Link inet6 addr: 2001:1890:110e:1111::a245/64 Scope:Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6289 errors:0 dropped:0 overruns:0 frame:0 TX packets:12197 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:587799 (574.0 KiB) TX bytes:2057305 (1.9 MiB) Interrupt:10 Base address:0x4000I want to disable the first ipv6 address in this. How do I do that?
Well there's a question here. But there are no such files in my kernel.
23 Answers
Generally, you really should not remove the link-local address, as it is required for core IPv6 features to work, such as Neighbour Discovery (i.e. IPv6 ARP).
That said, you can use ip addr to add or delete IPv4/6 addresses:
ip addr del 2001:1890:110e:1111::a245/64 dev eth0ip is the modern Linux network configuration tool, and ifconfig should be avoided on Linux. It still can delete individual addresses, but only for IPv6:
ifconfig eth0 del 2001:1890:110e:1111::a245/64 1 That first IPv6 address is the link-local address. Every IPv6 interface must have one. It's perfectly normal for an interface to have multiple IPv6 addresses.
- Enter Interface Configuration mode for the VLAN 1 interface. SEFOS# configure terminal SEFOS(config)# interface vlan 1
- Delete the IPv6 address configured for that interface. SEFOS(config-if)# no ipv6 address fec0::1111:0:1 96 SEFOS(config-if)# no ipv6 address fe80::203:2ff:fe03:501 link-local SEFOS(config-if)# exit SEFOS(config)# exit
- Review the IPv6 information for the VLAN 1 interface. SEFOS# show ipv6 interface vlan 1
vlan1 is up, line protocol is up IPv6 is Enabled Link local address: fe80::214:4fff:fe6c:560f ... The link-local address is auto-configured when you remove a link-local address in the IPv6 interface. Or click on the link below for more information
2