centos

centos中ifconfig命令格式是什么

小樊
44
2025-09-01 19:39:36
栏目: 智能运维

在 CentOS 系统中,ifconfig 命令用于配置和显示网络接口的信息。其基本格式如下:

ifconfig [interface] [options]

示例

  1. 显示所有网络接口的信息:

    ifconfig
    
  2. 显示特定接口(如 eth0)的信息:

    ifconfig eth0
    
  3. 启用一个网络接口(如 eth0):

    ifconfig eth0 up
    
  4. 禁用一个网络接口(如 eth0):

    ifconfig eth0 down
    
  5. 修改接口的 IP 地址和子网掩码:

    ifconfig eth0 192.168.1.10 netmask 255.255.255.0
    

请注意,在较新的 CentOS 版本中,ifconfig 可能已经被 ip 命令取代,但 ifconfig 仍然广泛使用且有效。

0
看了该问题的人还看了