CentOS 7云虚拟机配置DHCPv6

CentOS 7云虚拟机配置DHCPv6

  • 修改 /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV6INIT="yes"
DHCPV6C=yes
NM_CONTROLLED=no
NAME="eth0"
DEVICE="eth0"
ONBOOT="yes"
  • 修改 /etc/sysconfig/network
NETWORKING=yes
NOZEROCONF=yes
NETWORKING_IPV6=yes
  • 重启服务
sudo service network restart
  • 查看是否获取IPv6地址
# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet 10.10.9.3  netmask 255.255.255.0  broadcast 10.10.9.255
        inet6 2001:db8:eed1::5  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::f816:3eff:fe0e:cafa  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:0e:ca:fa  txqueuelen 1000  (Ethernet)
        RX packets 370  bytes 38488 (37.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 266  bytes 47240 (46.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
# inet6 2001:db8:eed1::5 即获取到的IPv6地址
# 通过在server端抓包可以看到请求
14:26:44.963685 IP6 fe80::f816:3eff:fe0e:cafa.546 > ff02::1:2.547: dhcp6 solicit
14:26:44.964479 IP6 fe80::f816:3eff:fe34:e53e > ff02::1:ff0e:cafa: ICMP6, neighbor solicitation, who has fe80::f816:3eff:fe0e:cafa, length 32
14:26:44.965648 IP6 fe80::f816:3eff:fe0e:cafa > fe80::f816:3eff:fe34:e53e: ICMP6, neighbor advertisement, tgt is fe80::f816:3eff:fe0e:cafa, length 32
14:26:44.965680 IP6 fe80::f816:3eff:fe34:e53e > fe80::f816:3eff:fe0e:cafa: ICMP6, neighbor solicitation, who has fe80::f816:3eff:fe0e:cafa, length 24
14:26:44.966244 IP6 fe80::f816:3eff:fe0e:cafa > fe80::f816:3eff:fe34:e53e: ICMP6, neighbor advertisement, tgt is fe80::f816:3eff:fe0e:cafa, length 24
14:26:45.064831 IP6 fe80::f816:3eff:fe34:e53e.547 > fe80::f816:3eff:fe0e:cafa.546: dhcp6 advertise
14:26:45.974412 IP6 fe80::f816:3eff:fe0e:cafa.546 > ff02::1:2.547: dhcp6 request
14:26:45.993155 IP6 fe80::f816:3eff:fe34:e53e.547 > fe80::f816:3eff:fe0e:cafa.546: dhcp6 reply
14:26:46.129483 IP6 fe80::f816:3eff:fe0e:cafa > ff02::16: HBH ICMP6, multicast listener report v2, 2 group record(s), length 48
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值