ifconfig 是一个用于配置和显示 Linux 内核中网络接口的命令行实用程序。在 CentOS 系统中,你可以使用 ifconfig 命令来查看和管理网络接口。以下是一些常用的 ifconfig 命令技巧:
ifconfig
ifconfig eth0
sudo ifconfig eth0 up
sudo ifconfig eth0 down
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0
sudo ifconfig eth0 0.0.0.0
sudo ifconfig eth0 mtu 1400
ifconfig eth0
sudo ifconfig eth0 promisc
sudo ifconfig eth0 -promisc
请注意,ifconfig 命令在某些 Linux 发行版中可能已被弃用,取而代之的是 ip 命令。在使用 ifconfig 命令时,请确保你的 CentOS 系统支持该命令。