我正在尝试使用 eth1 执行 ping,但该程序使用 eth0(默认网络设备)。任何提示、技巧或替代技术可用?
Gio*_*Mac 24
从手册:
Run Code Online (Sandbox Code Playgroud)-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 inter? face to specified interface. For ping6, when doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) is required.
所以,答案是:
ping -I eth1 123.123.123.123
Run Code Online (Sandbox Code Playgroud)
使用-I选项 -
-I interface address
Set source address to specified interface address. Argument may
be numeric IP address or name of device. When pinging IPv6 link-
local address this option is required.
Run Code Online (Sandbox Code Playgroud)
ping -I eth1 www.google.com
| 归档时间: |
|
| 查看次数: |
93054 次 |
| 最近记录: |