先绑定好IPV6 IP

Debian12

nano /etc/network/interfaces

填入以下内容:

iface ens3 inet6 static
        address ip
        netmask 掩码
        gateway 网关

然后重启

1.添加路由

然后添加路由,指令下面

ip route add local 2001:19f0:6001:48e4::/64 dev enp1s0

PS:2001:19f0:6001:48e4::/64为IP段

sysctl net.ipv6.ip_nonlocal_bind=1

2.验证

$ curl --interface 2001:19f0:6001:48e4::1 ipv6.ip.sb
2001:19f0:6001:48e4::1
$ curl --interface 2001:19f0:6001:48e4::2 ipv6.ip.sb
2001:19f0:6001:48e4::2