2015年7月19日 星期日

[Linux 文章收集] Red Hat / CentOS IPv6 Network Configuration

Source From Here
Preface
Q. How do I configure static IPv6 networking under RHEL 5.x / Fedora / CentOS Linux?
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:
/etc/sysconfig/network : Turn on networking in this file.
/etc/sysconfig/network-scripts/ifcfg-eth0 : Set default IPv6 router IP and server IP address in this file.

How-To
Open /etc/sysconfig/network file, enter:
# vi /etc/sysconfig/network

Append following line:
  1. NETWORKING_IPV6=yes  
Open /etc/sysconfig/network-scripts/ifcfg-eth0 (1st network config file)
# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Append following config directives for IPv6:
  1. IPV6INIT=yes  
  2. IPV6ADDR=  
  3. IPV6_DEFAULTGW=  
Here is my sample file with mix of IPv4 and IPv6 assigned to eth0:
  1. DEVICE=eth0  
  2. BOOTPROTO=static  
  3. ONBOOT=yes  
  4. HWADDR=00:30:48:33:bc:33  
  5. IPADDR=202.54.1.5  
  6. GATEWAY=202.54.1.3  
  7. NETMASK=255.255.255.248  
  8. IPV6INIT=yes  
  9. IPV6ADDR=2607:f0d0:1002:0011:0000:0000:0000:0002  
  10. IPV6_DEFAULTGW=2607:f0d0:1002:0011:0000:0000:0000:0001  
Where,
* NETWORKING_IPV6=yes|no - Enable or disable global IPv6 initialization.
* IPV6INIT=yes - Enable or disable IPv6 configuration for all interfaces.
* IPV6ADDR=2607:f0d0:1002:0011:0000:0000:0000:0002 - Specify a primary static IPv6 address here.
* 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
...

Traces path to a network host, enter:
# traceroute6 ipv6.google.com

Print default IPv6 routing table, enter:
# route -n -A inet6

Once IPv6 configured properly, you need to setup IPv6 firewall using ip6tables command under Linux.

Supplement
How To Test Linux Operating System for IPv6 Networking Support
# modprobe ipv6
# lsmod | grep ipv6


沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...