浏览器访问 IPv6 地址
在 IPv6 地址两边加上中括号,就可以通过浏览器访问了
浏览器访问
访问 http://[2402:4e00:1013:e500:0:9671:f018:4947]/
,会返回本机 IPv6 IP地址。
如果有端口,在 IP 地址后面添加端口,比如
http://[2402:4e00:1013:e500:0:9671:f018:4947]:80/
Ping IPv6 地址
6.ipw.cn 域名解析的 AAAA 记录就是上面这个 IPv6 IP。
~$ ping6 6.ipw.cn PING6(56=40+8+8 bytes) 1111:1111:30c0:9556:b807:e464:1111:1111 --> > 2402:4e00:1013:e500:0:9671:f018:494716 bytes from 2402:4e00:1013:e500:0:9671:f018:4947, icmp_seq=0 hlim=52 time=8.748 ms16 bytes from 2402:4e00:1013:e500:0:9671:f018:4947, icmp_seq=1 hlim=52 time=8.715 ms16 bytes from 2402:4e00:1013:e500:0:9671:f018:4947, icmp_seq=2 hlim=52 time=8.426 ms16 bytes from 2402:4e00:1013:e500:0:9671:f018:4947, icmp_seq=3 hlim=52 time=15.139 ms16 bytes from 2402:4e00:1013:e500:0:9671:f018:4947, icmp_seq=4 hlim=52 time=9.092 ms
2
3
4
5
6
7
终端 CURL 访问
MacOS
curl [2402:4e00:1013:e500:0:9671:f018:4947]1111:1111:30c0:9556:b807:e464:1111:1111curl http://[2402:4e00:1013:e500:0:9671:f018:4947]/1111:1111:30c0:9556:b807:e464:1111:1111
2
3
4
5
6
Linux
如果在 Linux 下,还需要增加 -g
参数,否则会提示 curl: (3) [globbing] error: bad range specification after pos
。
-g, --globoff his option switches off the "URL globbing parser". When you set this option, you can specify URLs that contain the letters {}[] without having them being interpreted by curl itself. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard.
2
curl -g http://[2402:4e00:1013:e500:0:9671:f018:4947]/
curl 指定 IPv6 或 IPv4 访问
如果同一个 host 同时解析到 IPv6 和 IPv4 地址,即 IPv4/IPv6 双栈,则 curl 使用参数可指定 IP 协议的版本。
-4, --ipv4
If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv4 addresses only.
-6, --ipv6
If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv6 addresses only.
比如 test.ipw.cn 同时解析到 IPv4 和 IPv6 地址。
curl -4 test.ipw.cn106.224.145.147curl -6 test.ipw.cn2408:824c:200::2b8b:336f:cc9c
2
3
4
5
telnet ipv6 地址
telnet -6 2402:4e00:1013:e500:0:940e:29d7:3443 80Trying 2402:4e00:1013:e500:0:940e:29d7:3443... Connected to 2402:4e00:1013:e500:0:940e:29d7:3443. Escape character is '^]'.
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/9626.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~