是的,Debian支持DHCPv6。以下是在Debian系统上配置和使用DHCPv6的基本步骤:
在终端中执行以下命令来安装DHCPv6客户端软件包:
sudo apt update
sudo apt install isc-dhcp-client
使用传统的 interfaces 文件方式:
编辑 /etc/network/interfaces 文件,为需要配置IPv6的接口添加以下内容(假设接口名为 eth0):
auto eth0
iface eth0 inet6 dhcp
使用 netplan 配置方式:
编辑 /etc/netplan/ 目录下的相应 YAML 文件(例如 01-netcfg.yaml),添加或修改以下内容:
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: yes
      dhcp6: yes
然后应用配置:
sudo netplan apply
使用以下命令查看IPv6地址是否已分配:
ip addr show eth0
或者,在较旧的Debian版本中,使用:
ifconfig eth0
使用 ping6 命令测试IPv6连接:
ping6 google.com
如果需要在Debian上搭建DHCPv6服务器,可以安装 isc-dhcp-server:
sudo apt install isc-dhcp-server
/etc/dhcp/dhcpd6.conf,根据需要进行配置。/etc/default/isc-dhcp-server,指定监听的接口。sudo systemctl start isc-dhcp-server
sudo systemctl enable isc-dhcp-server
通过以上步骤,您应该能够在Debian系统上成功配置和使用DHCPv6。