Configuring Static Networking and IPv6 on CentOS 7

Last Updated: Wed, Sep 17, 2014
CentOS FAQ Linux Guides
Archived content

This content is out of date. Please see our updated article.

Please see our updated article: Configure CentOS with Multiple IP Addresses

Pasted below is an example /etc/sysconfig/network-scripts/ifcfg-eth0 file. This template configures IPv4/IPv6 statically. Substitute DNS/HWADDR/IPADDR/GATEWAY/IPV6ADDR from your existing configuration.

DNS1=123.123.123.123
ONBOOT=yes
BOOTPROTO=static
DEVICE=eth0
IPADDR=123.123.123.123
PREFIX=23
GATEWAY=123.123.123.123
DEFROUTE=yes
NM_CONTROLLED=no
IPV6INIT=yes
IPV6ADDR="2001:1234:1234:1234::64/64"
IPV6_AUTOCONF=yes

Then, disable NetworkManager and restart networking:

systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl restart network

Don't forget, should you lose access to your box you can use the VNC console from the control panel.

Want to contribute?

You could earn up to $300 by adding new articles