在 CentOS 系统中,ifconfig
命令可以显示以下网络相关信息:
- 网络接口名称(如:eth0、enp0s3 等)
- 网络接口的 IP 地址(IPv4)和 MAC 地址
- 子网掩码
- 默认网关(router)
- 网络接口的状态(如:UP、DOWN、RUNNING 等)
- 网络接口的传输速率(如:RX bytes、TX bytes 等)
- 网络接口的碰撞率(collisions)
- 网络接口接收和发送的数据包数量(如:rx packets、tx packets 等)
- 网络接口的接收和发送错误数据包数量(如:rx errors、tx errors 等)
- 网络接口的接收和发送数据包大小(如:rx bytes、tx bytes 等)
要使用 ifconfig
命令,请打开终端并输入以下命令:
ifconfig
如果您只想查看特定网络接口的信息,可以在命令后添加接口名称,例如:
ifconfig eth0