良心ipv6 vps 申请2^64的ipv6的ip

Posted today ipv6

查找ipv6

ip -6 addr show scope global

输出类似:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:acff:fe11:2/64 scope link

中国联通:2408 中国移动:2409 中国电信:240e 国外的另算

添加路由

ip route add local 240?:????:????:????::/64 dev eno1

查看路由

ip -6 route show

启用ip绑定

sudo nano /etc/sysctl.conf
net.ipv6.ip_nonlocal_bind = 1
sudo sysctl -p

配置ndppd

sudo apt install ndppd
sudo nano /etc/ndppd.conf

具体配置

route-ttl 30000
proxy eno1 {
    router no
    timeout 500
    ttl 30000
    rule 240?:????:????:???::/64 {
        static
    }
}

测试


curl --int 240?:????:????:????:abcd:9876:5678:0123 http://ifconfig.me/ip

点击评论