Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a system with a primary IP address of 2001:DB8:1::1/64. This IP is achieved via stateless auto config and is static for our purposes.

This system has a routed IP block of 2001:DB8:2::/64.

I would like to ensure that by default, all IPv6 traffic originating from the system uses 2001:DB8:1::1. (Applications could override this with a specific source binding.)

The best way to do this appears to be, from my research, to run

ip addrlabel add prefix 2001:DB8:1::1/128 label 1 
ip addrlabel add prefix 2001:DB8:2::/64 label 99 

What would be a proper Ubuntu way to have this run at startup?

Thanks to Anders input i was able to do this by adding the following lines, in /etc/network/interfaces

up /sbin/ip addrlabel add prefix 2001:DB8:1::1/128 label 1 
up /sbin/ip addrlabel add prefix 2001:DB8:2::/64 label 99 
down /sbin/ip addrlabel del prefix 2001:DB8:1::1/128 label 1 
down /sbin/ip addrlabel del prefix 2001:DB8:2::/64 label 99

This works great, and also covers clean-up if the interface is brought down.

share|improve this question
Thanks for the feedback, that is great to have. – Anders Sep 8 '13 at 1:07
up vote 1 down vote accepted

Add it to /etc/network/interfaces as a post-up to the interface.

share|improve this answer

Your Answer


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.