大网数据广告活动
服务器运维问答

How do I enable IPv6 in RHEL 7.4 on Amazon EC2

· 52CE 我爱测

Amazon provides instructions on how to enable IPv6 on RHEL 7 and Centos 7: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-migrate-ipv6.html#ipv6-dhcpv6-rhel These instructions work on RHEL 7-7.3 and Centos 7-7.3, but d…

问题原文

原帖链接 · Aram Hăvărneanu · CC BY-SA 3.0

Amazon provides instructions on how to enable IPv6 on RHEL 7 and Centos 7: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-migrate-ipv6.html#ipv6-dhcpv6-rhel

These instructions work on RHEL 7-7.3 and Centos 7-7.3, but do not work on RHEL 7.4 (and presumably neither on Centos 7.4, when it will become available).

The problem is that the file /etc/sysconfig/network-scripts/ifcfg-eth0 is user-writable on the older versions, but on RHEL 7.4 this file becomes managed by cloud-init instead.

$ sed 1q /etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.

I find it very unexpected that merely upgrading from 7.3 to 7.4 would require such a fundamental change to managing networking. I am not sure if this change is specific to Amazon EC2 or not, I can't find anything in the RHEL 7.4 release notes, so it might be specific to Amazon.

So how are you supposed to enable IPv6 on RHEL 7.4 and Centos 7.4 in the cloud-init model?

已采纳解答

原帖链接 · Al Pooley · CC BY-SA 3.0

To configure DHCPv6 on RHEL 7.4 or CentOS 7

  1. Connect to your instance using the instance's public IPv4 address.
  2. Using a text editor of your choice, create a custom file, for example:

    /etc/cloud/cloud.cfg.d/99-custom-networking.cfg

  3. Add the following lines to your file, and save your changes:

    network:
      version: 1
      config:
      - type: physical
        name: eth0
        subnets:
          - type: dhcp6
    
  4. Reboot your instance.

  5. Reconnect to your instance and use the ifconfig command to verify that the IPv6 address is configured on the network interface.

Source: https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-migrate-ipv6.html#ipv6-dhcpv6-rhel

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-08-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。