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 1400
ifconfig eth0 broadcast
ifconfig eth0 hw ether
请注意,ifconfig 命令在一些较新的 Linux 发行版中可能已被弃用,取而代之的是 ip 命令。尽管如此,ifconfig 仍然在许多系统中广泛使用。如果你使用的是 CentOS 8 或更高版本,建议使用 ip 命令来代替 ifconfig。