IPv6 static address configuration for linux

By default, most linux distributions use autoconfiguration to pick an IPv6 address that is

derived based on the host’s mac address.

Fedora, Redhat Enterprise Linux, and clones like Centos
Add lines to these files: •/etc/sysconfig/network
NETWORKING_IPV6=yes
IPV6FORWARDING=no
IPV6_AUTOCONF=no
IPV6_AUTOTUNNEL=no
IPV6_DEFAULTGW=fe80::1
IPV6_DEFAULTDEV=eth0

•/etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
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
net.ipv6.conf.eth0.accept_ra=0

•/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

Where,
NETWORKING_IPV6=yes|no – Enable or disable global IPv6 initialization.
IPV6INIT=yes – Enable or disable IPv6 configuration for all interfaces.
IPV6ADDR=2607:f388:xxxx:yyyy::zzzz – Specify a primary static IPv6 address here.
IPV6_DEFAULTGW=fe80::1 – Add a default route through specified gateway.

Save and close the file. Restart networking:
# service network restart

Using ip

# /sbin/ip -6 addr add <ipv6address>/<prefixlength> dev <interface>

# /sbin/ip -6 addr add 2607:f388:xxxx:yyyy::zzzz/64 dev eth0

Using ifconfig

# /sbin/ifconfig <interface> inet6 add <ipv6address>/<prefixlength>

# /sbin/ifconfig eth0 inet6 add 2607:f388:xxxx:yyyy::zzzz/64

Removing IPV6

Using ip
# /sbin/ip -6 addr del <ipv6address>/<prefixlength> dev <interface>
# /sbin/ip -6 addr del 2607:f388:xxxx:yyyy::zzzz/64 dev eth0

Using ifconfig
# /sbin/ifconfig <interface> inet6 del <ipv6address>/<prefixlength>
# /sbin/ifconfig eth0 inet6 del 2607:f388:xxxx:yyyy::zzzz/64

 

What is IPV6
https://teckadmin.wordpress.com/2014/11/23/what-is-ipv6-address/

How to configure in windows
https://teckadmin.wordpress.com/2014/11/23/how-to-configure-ipv6-in-windows/

How to configure in Router
https://teckadmin.wordpress.com/2014/11/23/ipv6-router-configurations/

Advertisements

Posted on November 23, 2014, in LInux Based. Bookmark the permalink. Leave a comment.

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

%d bloggers like this: