IPv6 basic settings; addressing a host and static routing

[Originally posted Mar 20, 2012 12:01 PM by Antti Uitto   [ updated May 8, 2012 3:15 AM ]]

Once you have acquired yourself an globally valid IPv6 prefix, you may need to configure addresses on your hosts. By default computers will attempt to find themselves an IPv6 address automatically by using the processes of NDP or DHCPv6.

NDP (Neighbor Discovery Protocol)
http://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol

DHCPv6 ( Dynamic Host Configuration Protocol version 6)
http://en.wikipedia.org/wiki/DHCPv6

Manual configuration is needed for example if your host acts as an IPv6 router. In that case the host does not try to autoconfigure itself.

Here are the very basics you will need to get IPv6 going. Dynamic routing, access control etc are not covered here.

Ubuntu / Debian Linux

Give IPv6 address for an interface

sudo nano /etc/network/interfaces

example snippet for interface eth0

auto eth0
 iface eth0 inet6 static
 address 2001:05c0:1400:000a:0000:0000:0000:0055
 netmask 64
 gateway 2001:05c0:1400:000a:0000:0000:0000:0001

Save and exit editor, then restart network.

/etc/init.d/networking restart

Static routes

ip -6 route add 2000::/3 via 2001:0db8:0:f101::1

Write routes also to /etc/rc.local to make them persist over reboots.

Check

ip -6 add
ip -6 route
ip -6 neigh
ping6 ipv6.google.com

Turn on IPv6 forwarding (routing) if needed.

sudo nano /etc/sysctl.conf

Uncomment
net.ipv6.conf.all.forwarding=1

Install and set up radvd

If you want this host to advertise itself as a router to your LAN, install and set up radvd

sudo apt-get install radvd

sudo nano /etc/radvd.conf

interface eth0
 {
 AdvSendAdvert on;
 prefix 2001:db8::/64
 {
 };
 };

Cisco router

conf t
 ipv6 unicast-routing
 ipv6 cef
interface Gi0/1
 ipv6 enable
 ipv6 address 2001:05c0:1400:000a:0000:0000:0000:0002/64
 or
 ipv6 address 2001:05c0:1400:000a::/64 eui-64
 (ipv6 nd suppress-ra [*] )
(ipv6 nd other-config-flag [**] )
exit
ipv6 route ::/0 2001:05c0:1400:000a:0000:0000:0000:0001
ipv6 route 2001:998::/32 2001:05c0:1400:000a:0000:0000:0000:0007[*]

[*] If the router interface in question is not facing your LAN (where the client computers are), you may want to put ipv6 nd suppress-ra  under the interface configuration.  This will disable router advertisements on that interface.

[**] Use this if you want the router to provide other IPv6 configurations to your computers, for example IPv6 DNS addresses. If you do this, you must also set up a service such as ipv6 dhcp pool that will give out these settings.

Vyatta router

By default Vyatta has IPv6 forwarding on so you can just address your interfaces and write your routes.

Give IPv6 address to an interface

set interfaces ethernet eth0 address 2001:db8:2::1/64
( set interfaces ethernet eth0 ipv6 router-advert prefix 2001:099:0013:004b::/64 [*] )
( set interfaces ethernet eth0 ipv6 router-advert other-config-flag true [**] )
commit
save

[*] Turn router-advert on if this interface is serving as IPv6 gateway to computers in your LAN. If this interface is facing only another router(s) you might want to leave it out.

[**] Use this if you want the router to provide other IPv6 configurations to your computers, for example IPv6 DNS addresses. If you do this, you must also set up a service such as DHCPv6 that will give out these settings.

 

Static route

set protocols static route6 ::/0 next-hop 2001:db8:2::1
commit
save

Check

show interfaces
show ipv6 route
show ipv6 neighbors
ping6 2001:db8:2::2
traceroute6 2a00:1450:4016:800::1010

Windows 7

To configure IPv6 for static addressing

  1. Click Use the following IPv6 address, and then do one of the following:
    • For a local area connection, in IPv6 address, Subnet prefix length, and Default gateway, type the IP address, subnet prefix length, and default gateway address.
    • For all other connections, in IPv6 address, type the IP address.
  2. Click Use the following DNS server addresses.
  3. In Preferred DNS server and Alternate DNS server, type the primary and secondary DNS server addresses.

Check

Open command line  Start - Run - cmd
  ipconfig

Sources

http://technet.microsoft.com/en-us/library/cc732106.aspx
http://www.cyberciti.biz/faq/ubuntu-ipv6-networking-configuration/
http://www.cisco.com/en/US/docs/ios/ipv6/configuration/guide/ip6-addrg_bsc_con.html
Carla Schroder: Linux Networking Cookbook
Vyatta documentation www.vyatta.org