在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,如需转载请自行联系原作者
上一篇:阿里云服务器ECS开启或关闭SELinux图文教程


下一篇:2020阿里云域名优惠口令及优惠口令获取方法(新)