方法一: ifconfig
[[email protected] ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:5A:03:D0
inet addr:192.168.1.8 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe5a:3d0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:90931 errors:0 dropped:0 overruns:0 frame:0
TX packets:77139 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8985535 (8.5 MiB) TX bytes:6054556 (5.7 MiB)
如果是link 证明有网线连接
方法二: mii-tool
[[email protected] ~]# mii-tool
eth0: negotiated 100baseTx-FD, link ok
eth1: no link
这种方法更直观 直接显示网卡是否连接
时间: 2024-10-06 05:01:59