Red Hat / CentOS IPv6 Network Configuration
by VIVEK GITE on JANUARY 23, 2009 · 15 COMMENTS
Q. How do I
configure static IPv6 networking under RHEL 5.x / Fedora / CentOS Linux?
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
A. Red Hat
/ CentOS / Fedora RHEL support IPv6 out of box. All you have to do is update
two files and turn on networking.
You need to update and
configure following files for IPv6 configuration:
<!--[if !supportLists]-->1.
<!--[endif]-->/etc/sysconfig/network : Turn
on networking in this file.
<!--[if !supportLists]-->2.
<!--[endif]-->/etc/sysconfig/network-scripts/ifcfg-eth0 : Set
default IPv6 router IP and server IP address in this file.
Open
/etc/sysconfig/network file, enter:
# vi /etc/sysconfig/network
Append following line:
Open
/etc/sysconfig/network-scripts/ifcfg-eth0 (1st network config file)
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Append following config directives for IPv6:
IPV6INIT=yes
IPV6ADDR=<IPv6-IP-Address>
IPV6_DEFAULTGW=<IPv6-IP-Gateway-Address>
Here is my sample file
with mix of IPv4 and IPv6 assigned to eth0:
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:30:48:33:bc:33
IPADDR=202.54.1.5
GATEWAY=202.54.1.3
NETMASK=255.255.255.248
IPV6INIT=yes
IPV6ADDR=2607:f0d0:1002:0011:0000:0000:0000:0002
IPV6_DEFAULTGW=2607:f0d0:1002:0011:0000:0000:0000:0001
Where,
<!--[if !supportLists]-->§ <!--[endif]-->NETWORKING_IPV6=yes|no - Enable
or disable global IPv6 initialization.
<!--[if !supportLists]-->§ <!--[endif]-->IPV6INIT=yes - Enable
or disable IPv6 configuration for all interfaces.
<!--[if !supportLists]-->§ <!--[endif]-->IPV6ADDR=2607:f0d0:1002:0011:0000:0000:0000:0002 -
Specify a primary static IPv6 address here.
<!--[if !supportLists]-->§ <!--[endif]-->IPV6_DEFAULTGW=2607:f0d0:1002:0011:0000:0000:0000:0001 - Add a
default route through specified gateway.
Save
and close the file. Restart networking:
# service network restart
Verify your configuration by pinging ipv6 enabled site such as ipv6.google.com:
$ ping6 ipv6.google.com
Sample output:
PING ipv6.google.com(2001:4860:b002::68) 56 data bytes
64 bytes from 2001:4860:b002::68: icmp_seq=1 ttl=59 time=93.2 ms
64 bytes from 2001:4860:b002::68: icmp_seq=2 ttl=59 time=95.0 ms
64 bytes from 2001:4860:b002::68: icmp_seq=3 ttl=59 time=94.2 ms
64 bytes from 2001:4860:b002::68: icmp_seq=4 ttl=59 time=95.2 ms
64 bytes from 2001:4860:b002::68: icmp_seq=5 ttl=59 time=94.8 ms
64 bytes from 2001:4860:b002::68: icmp_seq=6 ttl=59 time=95.1 ms
64 bytes from 2001:4860:b002::68: icmp_seq=7 ttl=59 time=93.3 ms
64 bytes from 2001:4860:b002::68: icmp_seq=8 ttl=59 time=93.8 ms
--- ipv6.google.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7010ms
rtt min/avg/max/mdev = 93.268/94.376/95.268/0.799 ms
Traces
path to a network host, enter:
$ traceroute6 ipv6.google.com
Print default IPv6 routing table, enter:
$ route -n -A inet6
Sample output:
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
::1/128 :: U 0 42531 1 lo
::62.41.14.144/128 :: U 0 0 1 lo
::127.0.0.1/128 :: U 0 0 1 lo
::/96 :: U 256 0 0 sit0
2001:470:1f04:55a::2/128 :: U 0 15201 1 lo
2001:470:1f04:55a::/64 :: U 256 0 0 sit1
fe80::4833:22f4/128 :: U 0 0 1 lo
fe80::212:3fff:fe75:fa0d/128 :: U 0 0 1 lo
fe80::/64 :: U 256 0 0 eth0
fe80::/64 :: U 256 0 0 sit1
ff00::/8 :: U 256 0 0 eth0
ff00::/8 :: U 256 0 0 sit1
::/0 :: U 1 0 0 sit1
Once
IPv6 configured properly, you need to setup IPv6
firewall using ip6tables command under
Linux.
Featured Articles:
<!--[if !supportLists]-->§ <!--[endif]-->20 Linux
System Monitoring Tools Every SysAdmin Should Know
<!--[if !supportLists]-->§ <!--[endif]-->20 Linux
Server Hardening Security Tips
<!--[if !supportLists]-->§ <!--[endif]-->My 10
UNIX Command Line Mistakes
<!--[if !supportLists]-->§ <!--[endif]-->Linux:
20 Iptables Examples For New SysAdmins
<!--[if !supportLists]-->§ <!--[endif]-->25 PHP
Security Best Practices For Sys Admins
<!--[if !supportLists]-->§ <!--[endif]-->The
Novice Guide To Buying A Linux Laptop
<!--[if !supportLists]-->§ <!--[endif]-->10
Greatest Open Source Software Of 2009
<!--[if !supportLists]-->§ <!--[endif]-->Top 5
Email Client For Linux, Mac OS X, and Windows Users
<!--[if !supportLists]-->§ <!--[endif]-->Top 20
OpenSSH Server Best Security Practices
<!--[if !supportLists]-->§ <!--[endif]-->Top 10
Open Source Web-Based Project Management Software
<!--[if !supportLists]-->§ <!--[endif]-->Top 5
Linux Video Editor Software
Share this with other sys admins!
Facebook it - Tweet it - Print it -
{ 15 comments…
read them below or add one }
you
have no ipv6 mask :(
REPLY
Thanks
so much for this article. It is exactly what I have been looking for. I will
recommend this article. Keep up the good work.
REPLY
Nice
reminders, but I’d like to make two suggestions:
1.
Since the gateways are not specific to an interface, I keep the default gateway
stuff (v4 and v6) in /etc/sysconfig/network.
2.
I also don’t like the v6 autoconf for servers, so I turn it off in
/etc/sysconfig/network: IPV6_AUTOCONF=no
Thanks
for the quick tips.
Pete
REPLY
So
how would one find out there IPV6 address to use as a static one and what the
default gw IPV6 address us to use?
I
know the IPV4 addresses > how do i find its IPV6?
Thanks
in advance
REPLY
I
try to add another interface (ifcfg-eth0:1) with the same IPv6 lines as in
ifcfg-eth0, but the IPv6 does not appear when I use ifconfig. How can I assign
an IPv6 to another network interface?
REPLY
Use
IPV6ADDR_SECONDARIES in ifcfg-eth0. Generally, v6 devices expect to have
multiple addresses. If you do an ifconfig on eth0, you’ll probably see at least
two v6 addresses already (one a link-local scope and one a global scope).
IPV6ADDR_SECONDARIES=”[/]
…” (optional)
A list of secondary IPv6 addresses (e.g. useful for virtual hosting)
Example:
IPV6ADDR_SECONDARIES=”3ffe:ffff:0:1::10 3ffe:ffff:0:2::11/128″
REPLY
Is
there any directive to make network service start at boot time.
REPLY
Try
REPLY
I
think that works for me, thanks Mr Vivek.
REPLY
Just a question. How can
I calculate usable hosts address? I have assigned IPv6 /48 network and need
single adress for each server, for example
3x IPv6 address for server-1
2x IPv6 address for server-2
etc …
REPLY
any
idea how to configure IPv6 in bridge for RH based OS?
REPLY
I
have a question. If one has setup a CentOS server, and it is now in production
sitting online in use 24/7 with IPv4, is it possible to add IPv6 to it without
having to restart the network service?
What I have tried:
$ modprobe ipv6
$ ifconfig eth0 && ifconfig xenbr0
By
this point there are no ipv6 addresses shown in ifconfig
$
ip addr add 2001:xx:xx:xx:1::2/64 dev xenbr0
By this point I still
have no ipv6 addresses in ifconfig, all I get is:
RTNETLINK answers: Operation not supported
If
I absolutely have to reboot the server then I will find a good point to do so
and do it but if it’s even remotely possible to do without then that would be
ideal. The server hosts Xen virtual machines using bridged networking
configuration and somehow I doubt that restarting the network service would
play nice with them and come back automatically at Virtual Machine level.
REPLY
Hi
I dont find /etc/sysconfig/network-scripts/ifcfg-eth0, I only have
/etc/sysconfig/network-scripts/ifcfg-lo…….what can I do ? Help me please
REPLY
George
– how about cp /etc/sysconfig/network-scripts/ifcfg-lo
/etc/sysconfig/network-scripts/ifcfg-eth0
分享到:
相关推荐
CentOS7各个版本镜像下载地址 # CentOS7.6 下载地址 ...http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso # CentOS-7-x86_64-Everything-1810.iso CentOS 7.6 Everything版 10G ...
consol/centos-xfce-vnc 采用VNC或者浏览器 firefox/chrome 都可以连接。启动命令: docker run --rm -it -p 5901:5901 -p 6901:6901 --name test_cent_os consol/centos-xfce-vnc。默认密码 vncpassword
中标麒麟v7/银河麒麟v10/uos20/centos7/centos8/其他linux系统在aarch64/arm64的cpu架构下可以使用的electron。 该版本采用源码编译而来,解决electron在aarch64下白屏及崩溃等问题。 electron版本:7.1.4 ...
zabbix snmp redhat7/centos7 离线安装包zabbix snmp redhat7/centos7 离线安装包zabbix snmp redhat7/centos7 离线安装包
http://mirrors.btte.net/centos/7/isos/x86_64/ http://mirrors.cn99.com/centos/7/isos/x86_64/ http://mirrors.sohu.com/centos/7/isos/x86_64/ http://mirrors.aliyun.com/centos/7/isos/x86_64/ ...
华为OceanStor系列存储多路径软件适用于RedHat/CentOS,华为存储多路径软件适用于RedHat/CentOS
本文件为rpm包,所以仅适用于Red Hat、CentOS 和 Fedora。 WPS for Linux 缺少了一些数学公式显示的字体,导致 WPS for Linux 打开的时候会提示以下错误: 系统缺失字体:Wingdings、Wingdings 2、Wingdings3、MT ...
FTP配置/centos
jdk1.6 Linux/Centos都可以用 这是从官网下载的 请放心使用
FileZilla v3.4.0 FTP 客户端 for RHEL5/CentOS5 i386 因 RHEL5/CentOS5 自带 GNUTLS 库版本过老,无法顺利编译 FileZilla 源代码,EPEL 中也没有 FileZilla 的包,无法 yum 得到。RF 有,直接把攫取了下来。rpm -...
在centos7或Linux下安装gcc-6.4.0.red hat下安装可能失败,如果失败修改yum源(我上传了,下载即可)。以root运行脚本。(我已经试过了,成功。但后来又修改了一下,没试过修改后的,可能失败,你看着办)
打开centos的yum文件夹 输入命令cd /etc/yum.repos.d/ 用wget下载repo文件 输入命令wget http://mirrors.aliyun.com/repo/Centos-7.repo 如果wget命令不生效,说明还没有安装wget工具,输入yum -y install wget 回车...
OEL/Redhat/CentOS等linux平台gcc、g++的全套rpm安装包
制作版本 centos update src.rpm seabios-0.6.1.2-8.el6 rhel 6.1/6.2 centos 6.1/6.2 ubuntu fedora 其他linux 应该都能用 稍后上传seabios-1.6.3 DELL windows 7 oem slic 2.1 bios 自动激活。 windows xp slic...
Red Hat 系统使用 CentOS的yum源配置文件,CentOS-Base.repo,Red Hat Enterprise Linux Server release 6.8 (Santiago)测试可用, release 6.5, release 6.9应该也可以
rhel/red hat/centos/ubuntu/fedora/linux kvm libvirt seabios DELL windows7/vista oem slic2.1 slic2.0 bios (windows xp slic DMI 没验证,验证情况给个评价) 制作版本 centos update src.rpm seabios-0.6.1.2-...
# CentOS7.6 下载地址 # CentOS-7-x86_64-DVD-1810....http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso # CentOS-7-x86_64-Everything-1810.iso CentOS 7.6 Everything版 10G ...
CentOS(Community Enterprise Operating System,中文意思是社区企业操作系统)是Linux发行版之一,它是来自于Red Hat Enterprise Linux依照开放源代码规定释出的源代码所编译而成。由于出自同样的源代码,因此有些...
32位DVD1http://mirrors.163.com/centos/6.2/isos/i386/CentOS-6.2-i386-bin-DVD1.iso 32位DVD2http://mirrors.163.com/centos/6.2/isos/i386/CentOS-6.2-i386-bin-DVD2.iso 64位DVD1...
将red hat 7.3或7.4的yum源改为 Centos 的yum源。文件放一起。要root