我正在尝试为我的无线接口获取 IPv6 IP。当获取 IPv4 时,我看到以下内容:
wlan0 Link encap:Ethernet HWaddr 00:15:00:bf:29:b2
inet addr:192.168.1.128 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::215:ff:febf:29b2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:723 (723.0 B) TX bytes:12641 (12.6 KB)
现在我正在尝试获取 IPv6 IP:
$ sudo ifconfig wlan0 inet6 add fe80::215:ff:febf:29b::1
我收到此错误:
fe80::215:ff:febf:29b::1: Resolver Error 0 (no error)
我究竟做错了什么?
答案1
您只能使用 :: 一次。引用标准:
“连续全零字段的最长序列被双冒号替换。如果有多个最长的全零字段,则最左边的被压缩。例如,2001:db8:0:0:1: 0:0:1 呈现为 2001:db8::1:0:0:1,而不是 2001:db8:0:0:1::1。”
尝试改为:sudo ifconfig wlan0 inet6 add fe80::215:ff:febf:29b1