Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've installed Debian 6.0.6 running on kernel 2.6.32-5-amd64 and after the installation I assigned a static IPv6 address to the eth0 interface.
This is how my /etc/network/interfaces file looks like:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet6 static

 address fe80::a:1
 netmask 64
 gateway fe80::1

This is what the output of "ifconfig eth0" looks like:

eth0 Link encap:Ethernet HWaddr 10:1f:74:c6:27:5f
inet6 addr: fe80::121f:74ff:fec6:275f/64 Scope:Link
inet6 addr: fe80::a:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:45 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6427 (6.2 KiB) TX bytes:7969 (7.7 KiB)
Interrupt:20 Memory:d0700000-d0720000

As you can see there are 2 IPv6 addresses;
One automatically generated IPv6 address
One static assigned IPv6 address via /etc/network/interfaces

Now my question is how do I disable the automatically generated IPv6 address ?
Most sites tell me to add the following lines into file /etc/sysctl.conf:

net.ipv6.conf.eth0.autoconf=0
net.ipv6.conf.eth0.accept_ra=0

But nothing happens after a reboot of the system. So I removed the first IPv6 address manually by running command:

ip -6 addr del fe80::121f:74ff:fec6:275f/64 dev eth0

and indeed the first IPv6 address got removed but after a reboot the address comes back.

Any clues on how to solve this problem ?

Thx in advance

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You are using Link-Local addresses (those that start with fe80:) in the wrong way. Let me describe how IPv6 works:

  1. When an interface comes up the system will always automatically configure a link-local address for that interface. This link-local address is not routable and only works for communicating between systems on the same link (LAN). It is used in many places and crucial to a functioning IPv6 setup. Even when the system gets routable addresses the link-local address remains.

    From RFC 4861: "All interfaces on routers MUST have a link-local address."

  2. When a router sends out a Router Advertisement (RA) the system can use the information in the RA to auto-configure its other addresses. This is the part you can disable with autoconf.

In your configuration you configure an additional link-local address (fe80::a:1) on your interface and then try to route traffic for outside your LAN to a default gateway with address fe80::1. Using a link-local address as default gateway is fine and happens all the time, but using a link-local address as your source address for destinations beyond the local LAN will never work.

To sum it up:

  • Leave the link-local address alone. By removing it you will break your IPv6 configuration.
  • Use routable addresses for your systems. There are multiple ways of getting routable addresses:

    • Get a prefix from your ISP. You will usually get a /48 or a /56 prefix.
    • Get a tunnel from SixXS or Hurricane Electric and ask for a delegated prefix. It will be a /48.
    • Generate a ULA prefix. You won't be able to route it to the global internet but you can route it within your own organisation. Use a ULA generator to generate the ULA prefix bsed on one of the MAC addresses of one of your devices.


    Then use a /64 prefix out of the prefix you got above for each LAN. Don't use different prefix lengths on your LANs unless you really know what you are doing.

  • Using fe80::1 as your default gateway is fine (if there is actually a router listening to that address on the local link of course)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.