阅读量:3
ifconfig 是一个用于配置和显示 Linux 内核中网络接口的命令行实用程序。在 CentOS 系统中,你可以使用 ifconfig 命令来查看、配置和激活网络接口。
以下是一些常用的 ifconfig 命令用法:
- 查看所有网络接口的信息:
ifconfig
- 查看指定网络接口的信息(例如:eth0):
ifconfig eth0
- 激活网络接口(例如:eth0):
ifconfig eth0 up
- 关闭网络接口(例如:eth0):
ifconfig eth0 down
- 为网络接口分配 IP 地址(例如:eth0,IP 地址为 192.168.1.100,子网掩码为 255.255.255.0):
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
- 删除网络接口的 IP 地址(例如:eth0):
ifconfig eth0 0.0.0.0
- 修改网络接口的 MTU(最大传输单元,例如:eth0,MTU 为 1500):
ifconfig eth0 mtu 1500
注意:在 CentOS 7 及更高版本中,ifconfig 命令已被废弃,推荐使用 ip 命令来替代。例如,查看所有网络接口的信息可以使用 ip addr 命令。
以上就是关于“centos系统ifconfig命令用法”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm