【发布时间】:2026-02-22 13:10:01
【问题描述】:
在继续之前,有没有办法在 bash 脚本中检查多个接口的网络接口链接是否成功?
类似:
eth0 eth1 eth2 eth3 network interfaces are brought up
Wait for link detection on all 4 interfaces
Proceed
【问题讨论】:
-
在一个循环中尝试每秒 1 次 ping 到某个已知主机的每个网络中的内容,或者检查 ifconfig 输出...
-
如果它们是 up 的,并不一定意味着其他主机响应 ping。
标签: bash networking ping ifconfig