6

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:0x4000

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

Ramana Reddy
  • 163
  • 1
  • 1
  • 6
  • 2
    Possible duplicate of [How to disable ipv6 on a specific interface in linux?](http://superuser.com/questions/575684/how-to-disable-ipv6-on-a-specific-interface-in-linux) – BlueBerry - Vignesh4303 Dec 10 '15 at 08:56
  • the question is why you want to disable link local IPv6 ? you might whish to use a random base instead of mac base adress, but that's another question. You global IP is not giving your mac addess, that a good point. – Archemar Dec 19 '15 at 10:22

4 Answers4

12

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 eth0

ip 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
u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
4

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.

Sander Steffann
  • 4,654
  • 15
  • 18
1

To remove IPv6 addresses from the interface you need to specify "-6" parameter for "ip" command like this:

$ sudo ip -6 addr del fe80::20d:b9ff:fe3c:8594/64 dev eth0

without it the command is executing successfully, but no changes to the interface.

artickl
  • 11
  • 1
-4
  1. Enter Interface Configuration mode for the VLAN 1 interface. SEFOS# configure terminal SEFOS(config)# interface vlan 1
  2. 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
  3. 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 https://docs.oracle.com/cd/E39109_01/html/E24662/z40000f71393620.html

David
  • 3
  • 3
  • 1
    That's nice, but the question is about Linux, not IOS or SEFOS, and if you just [copy-paste from the first Google result](http://docs.oracle.com/cd/E19285-01/html/E24662/z40000f71393443.html), you really should mention that. – u1686_grawity Dec 10 '15 at 09:00
  • Yeah, that was why i inserted the link i got it from – David Dec 10 '15 at 09:07