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


Windows : ping -S

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.

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM