1. 程式人生 > >CentOS7 64位Minimal版配置ifconfig命令工具

CentOS7 64位Minimal版配置ifconfig命令工具

問題原由:

  minimal版CentOS7安裝結束後,進入到系統。需要使用"ifconfig"命令檢視網絡卡資訊的時候,提示找不到"ifconfig"命令。

 

分析問題:

  找不到命令,應該是沒有安裝該功能。使用以下命令檢視"ifconfig"命令是由哪個包提供的。

yum provides ifconfig
yum whatprovides ifconfig

結果如下:
  
[[email protected] ~]# yum whatprovides ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 
* base: mirrors.aliyun.com * extras: mirrors.shu.edu.cn * updates: mirrors.aliyun.com net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools Repo : @base Matched from: Filename : /usr/sbin/ifconfig
 
 

 

  可以看到"ifconfig"所屬的包為:net-tools-2.0-0.22.20131004git.el7.x86_64。

 

解決問題:

  安裝"ifconfig"命令所屬的包

   yum install net-tools 

 

  使用命令驗證問題:

  

[[email protected] ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.206.142  netmask 255.255.255.0  broadcast 192.168.206.255
        inet6 fe80::c3b0:713e:dfcb:f9e4  prefixlen 
64 scopeid 0x20<link> ether 00:0c:29:4b:3d:0f txqueuelen 1000 (Ethernet) RX packets 20692 bytes 25540256 (24.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 5909 bytes 378455 (369.5 KiB) 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

命令可以使用,問題解決。

 

參考地址:https://linux.cn/article-3631-1.html