linux 指定网卡 ping

版权声明:本文为博主原创文章,可以自由转载。 https://blog.csdn.net/u010953692/article/details/88032513

1,系统环境

$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G65

2,指定网卡 ping 检测网络

  • 网卡 en0
$ ifconfig en0
inet 192.168.1.106
  • 使用[-I iface]报错
$ ping -I en0 www.baidu.com
ping: invalid multicast interface: `en0'
  • 使用[-S src_addr]检测指定网卡网络
$ ping -S 192.168.1.106 www.baidu.com
PING www.a.shifen.com (14.215.177.39) from 192.168.1.106: 56 data bytes
64 bytes from 14.215.177.39: icmp_seq=0 ttl=127 time=7.394 ms
64 bytes from 14.215.177.39: icmp_seq=1 ttl=127 time=7.300 ms
64 bytes from 14.215.177.39: icmp_seq=2 ttl=127 time=7.074 ms

参考:

  1. Invalid multicast interface

猜你喜欢

转载自blog.csdn.net/u010953692/article/details/88032513