ifconfig 是一个用于配置和显示 Linux 内核中网络接口的命令行实用程序。在 CentOS 系统中,你可以使用 ifconfig 命令来查看、配置和激活网络接口。
以下是一些常用的 ifconfig 命令用法:
ifconfig
ifconfig eth0
ifconfig eth0 up
ifconfig eth0 down
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
ifconfig eth0 0.0.0.0
ifconfig eth0 mtu 1500
注意:在 CentOS 7 及更高版本中,ifconfig 命令已被废弃,推荐使用 ip 命令来替代。例如,查看所有网络接口的信息可以使用 ip addr 命令。