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 192.168.1.100 netmask 255.255.255.0 up
注意:在较新的 CentOS 版本中,ifconfig
命令可能已被弃用,推荐使用 ip
命令来替代。你可以使用 ip addr
和 ip link
等命令来实现与 ifconfig
类似的功能。