Defining multiple IPv6 addresses in one single NIC in Linux

While on my MIPv6 quest, I needed to define two IP addresses to a single ethernet card. Well, I thought the usual aliases thing would suffice, but I guess I was wrong since that didn’t work, complaining something like:

SIOCSIFFLAGS: Cannot assign requested address

So I remembered that, at least in Linux, you can have multiple IPv6 addresses in one single NIC just by issuing the command:

ip -6 addr add 2001:db8:a::1/64 dev eth0

This worked out! But now I wanted to add it to my /etc/network/interfaces so that the changes would be permanent. After some googling I found out that all I had to do was to add the previous command like follows:

auto eth0
iface eth0 inet6 static
address 2001:db8:f:1::1/64
netmask 64
up ip -6 addr add 2001:db8:a::1/64 dev eth0

Then just reboot or execute:

sudo ifconfig eth0 down
sudo /etc/init.d/networking restart

And there you go! Multiple IPv6 in one single NIC the easy way🙂

One thought on “Defining multiple IPv6 addresses in one single NIC in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s