ifconfig
是一个用于配置和显示网络接口信息的命令行工具。在 Linux 和类 Unix 系统中,使用 ifconfig
可以查看和管理网络接口的配置信息。以下是 ifconfig
命令显示的一些主要网络信息:
eth0
, wlan0
等。lo
)。eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 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 123456789 (117.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 654321 bytes 987654321 (941.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ifconfig
在某些现代 Linux 发行版中可能已被 ip
命令取代,但仍然广泛使用。ifconfig
时可能需要 root 权限。通过这些信息,系统管理员可以诊断网络连接问题、配置网络接口或监控网络性能。