在 Ubuntu 系統中,你可以使用 ifconfig
命令來查看網絡接口的狀態。以下是具體步驟:
打開終端:
Ctrl + Alt + T
快捷鍵打開終端。輸入命令:
ifconfig
并按下回車鍵。查看輸出結果:
eth0
, wlan0
等接口名稱。UP
或 DOWN
)。例如,輸出可能類似于:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a00:27ff:fe4e:66a1 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:4e:66:a1 txqueuelen 1000 (Ethernet)
RX packets 123456 bytes 12345678 (11.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 654321 bytes 65432109 (62.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 890 bytes 78901 (77.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 890 bytes 78901 (77.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
在這個例子中,eth0
是一個活動的以太網接口,而 lo
是本地回環接口。
如果你只想查看特定的網絡接口,可以使用 ifconfig <interface_name>
,例如:
ifconfig eth0
這將只顯示 eth0
接口的詳細信息。
請注意,ifconfig
命令在某些現代 Linux 發行版中可能已被棄用,推薦使用 ip
命令來替代。你可以使用 ip addr show
來查看網絡接口的狀態。