使用ping6 或者 ping -6 直接 ping ipv6时报错。
ping6 fe80::b62e:99ff:fe6d:adbe
connect: Invalid argument
这是因为服务器,启用了多网卡,因此要指定网卡。
采用:ping6 -I 网卡名 ipv6地址
ping6 -I ens192 fe80::b62e:99ff:fe6d:adbe
或者:
ping -6 -I ens192 fe80::b62e:99ff:fe6d:adbe
1.找到对应网卡名称
ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:7a:9f:0e brd ff:ff:ff:ff:ff:ff
inet 172.18.5.137/24 brd 172.18.5.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet6 fe80::a813:720:c74e:1e98/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:18:2f:ee:9b brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
[root@itdev7003 ~]#
2.指定网卡即可。
ping6 -I ens192 fe80::b62e:99ff:fe6d:adbe
PING fe80::b62e:99ff:fe6d:adbe(fe80::b62e:99ff:fe6d:adbe) from fe80::a813:720:c74e:1e98%ens192 ens192: 56 data bytes
64 bytes from fe80::b62e:99ff:fe6d:adbe%ens192: icmp_seq=1 ttl=64 time=0.253 ms
64 bytes from fe80::b62e:99ff:fe6d:adbe%ens192: icmp_seq=2 ttl=64 time=0.297 ms
64 bytes from fe80::b62e:99ff:fe6d:adbe%ens192: icmp_seq=3 ttl=64 time=0.407 ms
64 bytes from fe80::b62e:99ff:fe6d:adbe%ens192: icmp_seq=4 ttl=64 time=0.309 ms
64 bytes from fe80::b62e:99ff:fe6d:adbe%ens192: icmp_seq=5 ttl=64 time=0.420 ms
网友评论