在CentOS 7最小化服务器版本中如何启用“ifconfig”命令?

简介:

最近安装了一个最小化版本的CentOS 7,发现不能使用 ifconfig命令,界面提示:
ifconfig command not found.

解决办法:

  1. 从yum找出哪个包括ifconfig 命令
    [root@tangym ~]# yum provides ifconfig Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile

    • base: mirrors.zju.edu.cn
    • extras: mirrors.163.com
    • updates: mirrors.163.com
      net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
      Repo : @base
      Matched from:
      Filename : /usr/sbin/ifconfig
  2. 从上面可以看到 net-tools 包中可以找到ifconfig命令
  3. 安装net-tools
    [root@tangym ~]# yum provides ifconfig
  4. 安装完成之后,将可以使用ifconfig 命令了
    [root@tangym ~]# ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.1.20 netmask 255.255.255.0 broadcast 192.168.1.255
    inet6 fe80::1157:71fe:de9b:3e7e prefixlen 64 scopeid 0x20<link>
    ether 00:15:5d:01:07:3c txqueuelen 1000 (Ethernet)
    RX packets 29890 bytes 42966542 (40.9 MiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 18814 bytes 1278145 (1.2 MiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

            lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
                            inet 127.0.0.1  netmask 255.0.0.0
                            inet6 ::1  prefixlen 128  scopeid 0x10<host>
                            loop  txqueuelen 1  (Local Loopback)
                            RX packets 0  bytes 0 (0.0 B)
                            RX errors 0  dropped 0  overruns 0  frame 0
                            TX packets 0  bytes 0 (0.0 B)
                            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0









本文转自 yuanzhitang 51CTO博客,原文链接:http://blog.51cto.com/yuanzhitang/2056473,如需转载请自行联系原作者
目录
相关文章
|
17天前
|
应用服务中间件 Linux 网络安全
CentOS 7.4源码编译nginx1.12 并且隐藏nginx的版本
CentOS 7.4源码编译nginx1.12 并且隐藏nginx的版本
15 0
|
24天前
|
Linux 网络安全
Centos 防火墙端口控制命令
Centos 防火墙端口控制命令
29 3
|
1月前
|
Linux Shell 网络安全
【Shell 命令集合 网络通讯 】Linux 与SMB服务器进行交互 smbclient命令 使用指南
【Shell 命令集合 网络通讯 】Linux 与SMB服务器进行交互 smbclient命令 使用指南
52 1
|
17天前
|
Linux
centos 查看服务器信息 版本cpu
centos 查看服务器信息 版本cpu
12 0
|
17天前
|
网络协议 应用服务中间件 Linux
centos7 Nginx Log日志统计分析 常用命令
centos7 Nginx Log日志统计分析 常用命令
33 2
|
1月前
|
网络协议 安全 Shell
【Shell 命令集合 系统设置 】Linux 从远程时间服务器获取当前日期和时间 rdate命令 使用指南
【Shell 命令集合 系统设置 】Linux 从远程时间服务器获取当前日期和时间 rdate命令 使用指南
36 0
|
1月前
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
30 0
|
1月前
|
Shell Linux Apache
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
162 1
|
1月前
|
监控 网络协议 Linux
Linux 命令大全 & CentOS常用运维命令
Linux 命令大全 & CentOS常用运维命令
157 0
|
1月前
|
关系型数据库 MySQL 数据库
虚拟机Linux-Centos系统网络配置常用命令+Docker 的常用命令
虚拟机Linux-Centos系统网络配置常用命令+Docker 的常用命令
45 0