Linux IPv6 操作: ping telnet ssh curl wget

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# ping -6 -I <interface> <ipv6 address>
ping -6 -I eth0 fe80::3016:9242:18fb:5a07
ping6 -I eth0 fe80::3016:9242:18fb:5a07

# SSH
# ssh <username>@<ipv6 address>%<interface>
ssh root@fe80::3016:9242:18fb:5a07%eth0

# telnet
# telnet -6 <username>@<ipv6 address>%<interface> [port]
telnet -6 fe80::3016:9242:18fb:5a07%eth0 22

# IPv6 中的 url 地址要用 [] 括起来,端口在 ] 后
# curl 不支持链路本地地址,即 fe80 开头的地址,内网测试需要修改其他地址~报错:curl: (7) Failed to connect to fe80::6d7d:7c73:5851:e712: Invalid argument
# -g, --globoff Disable URL sequences and ranges using {} and [](禁用 url 中使用 {} 和 [] 来表示序列和范围)
curl -6 -g 'http://[20a0::6d7d:7c73:5851:e712]:8888'

# wget
# wget -6 <ipv6 url> ,也不支持链路本地地址:报错Connecting to [fe80::6d7d:7c73:5851:e712]:8888... failed: Invalid argument.
wget -6 'http://[20a0::6d7d:7c73:5851:e712]:8888'

-g 参数引用:Linux curl命令详解