Aug 172011
 

Welcome to part three of my multipart series on IPv6. In this post I’ll cover configuring a (Debiab/Ubuntu) linux box to use a static IPv6 address without using Network Manager. This particular host is a headless Xen virtual machine, which makes using Network Manager difficult.

To configure a (Debian/Ubuntu) Linux host with a static IPv6 address, add the following stanza to /etc/network/interfaces:

[cc lang=”bash”]
# cat /etc/network/interfaces | grep -A 3 inet6
iface eth0 inet6 static
address 2001:0DB8:1d:619::3
netmask 64
gateway 2001:0DB8:1d:619::1
[/cc]

You will of course want to substitute your own IPv6 address and gateway. To actually enable the IPv6 address without rebooting, run the following commands:

[cc lang=”bash”]
# ifconfig eth0 inet6 add 2001:0DB8:1d:619::3/64
# route –A inet6 add default gw 2001:0DB8:1d:619::1
[/cc]

Here’s what the interface looks like:

[cc lang=”bash”]
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:3e:31:57:a1
inet addr: 203.0.113.158 Bcast: 203.0.113.159 Mask:255.255.255.248
inet6 addr: 2001:0DB8:1d:619::3/64 Scope:Global
inet6 addr: fe80::216:3eff:fe31:57a1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16243455 errors:0 dropped:923 overruns:0 frame:0
TX packets:9296920 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11683362417 (11.6 GB) TX bytes:11518299086 (11.5 GB)
Interrupt:20
[/cc]

Moreover, here’s the IPv6 routing table:.

[cc lang=”bash”]
# ip -f inet6 route show
2001:470:1d:619::/64 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
default via 2001:470:1d:619::1 dev eth0 metric 1
[/cc]

Note there are actually two IPv6 addresses on the interface. One is the link-local address (the one starting with fe80), which is used for neighbor and router solicitation and discovery purposes, among other uses. The link-local address is assigned automatically, and is based on the MAC address. The other is the globally routable IPv6 address that is what other IPv6 enabled hosts will use to communicate with this host.

Sorry, the comment form is closed at this time.