Windows : ping -S

 ping 命令 指定特定网卡 发送 ICMP 数据包 Linux

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

Linux : ping -I <device>

-I interface
interface is either an address, or an interface name. If interface is an address, it sets source address to specified interface address. If interface in an
interface name, it sets source interface to specified interface. For IPv6, when doing ping to a link-local scope address, link specification (by the
'%'-notation in destination, or by this option) is required.

➜  Desktop ping -I wlp3s0  baidu.com
PING baidu.com (123.125.115.110) from 10.210.10.160 wlp3s0: 56(84) bytes of data.
➜  Desktop ping -I tun0  baidu.com
PING baidu.com (220.181.57.216) from 10.72.12.142 tun0: 56(84) bytes of data.

保持更新,转载请标明出处。

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄