IPv6 static address configuration for linux hosts

How to statically configure IPv6 on linux systems for the UW Campus network.

By default, most linux distributions use autoconfiguration to pick an IPv6 address that is derived based on the host's mac address. For environments where it is desirable to have static host configurations (for example servers, or other machines to be remotely accessible) you will want to disable autoconfiguration and use a static IPv6 address.

For networks that exclusively want static host configuration, the router can be provisioned to disable autoconfiguration for the entire vlan. This is suitable for vlans that only have servers and static clients. It is not necessarily the best option for client environments unless you want to configure each host by hand. Contact Network Services if you want autoconf disabled for your vlan.

One unique feature of the UW-Madison campus network is that the default gateway will always be fe80::1 regardless of what network you are on. If your host has multiple interfaces, you can only use one of them for your default gateway. This is the same as for IPv4. (Technically you can have multiple default gateways listed but at different metrics so only one is used at a time.)

Fedora, Redhat Enterprise Linux, and clones like Centos

  Add lines to these files:
  • /etc/sysconfig/network
  • /etc/sysconfig/network-scripts/ifcfg-eth0
    IPV6ADDR=2607:f388:xxxx:yyyy::zzzz/64     # replace with your static address

Debian and derivatives like Ubuntu

  Add lines to these files:
  • /etc/sysctl.conf
  • /etc/network/interfaces
    iface lo0 inet6 loopback
    iface eth0 inet6 static
      address 2607:f388:xxxx:yyyy::zzzz        # replace with your static address
      netmask 64
      gateway fe80::1

Keywords:ipv6   Doc ID:14099
Owner:Michael H.Group:Network Services
Created:2010-05-31 19:00 CDTUpdated:2017-08-08 14:10 CDT
Sites:Network Services, Systems Engineering
Feedback:  38   17