centos系统ifconfig命令用法
导读:ifconfig 是一个用于配置和显示 Linux 内核中网络接口的命令行实用程序。在 CentOS 系统中,你可以使用 ifconfig 命令来查看、配置和激活网络接口。 以下是一些常用的 ifconfig 命令用法: 查看所有网络接口...
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
命令。
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: centos系统ifconfig命令用法
本文地址: https://pptw.com/jishu/723426.html