我是否可以从命令行输入命令来判断是否有物理电缆插入网络端口?
答案1
Solaris 10:
# dladm show-dev
nxge0 link: down speed: 0 Mbps duplex: unknown
nxge1 link: up speed: 1000 Mbps duplex: full
OpenSolaris/OpenIndiana/Solaris 11:
# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
rtls0 Ethernet up 100 full rtls0
rtls1 Ethernet down 0 unknown rtls1
答案2
kstat -p :::link_up
将显示卡是否处于活动状态(如操作系统所见)--或不活动状态。卡可能已“插入”但未配置,或者连接存在问题,因此这并非万无一失。