如果你不知道在哪里可以找到ifconfig命令,请按照以下简单的步骤来找到它。首先,让我们找出哪个包提供了ifconfig命令。要完成这项任务,输入以下命令:
[root@jrserver app_files]# yum provides ifconfig Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.aliyun.com * updates: mirrors.163.com net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools Repo : @base Matched from: Filename : /usr/sbin/ifconfig
或者你也可以使用以下命令:
yum whatprovides ifconfig
就像你在上面的输出中所看到的,net-tools包提供了ifconfig命令。因此,让我们安装net-tools包来使用ifconfig命令:
yum install net-tools
[root@jrserver app_files]# ifconfig eno16777984: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.60.10.200 netmask 255.255.255.0 broadcast 10.60.10.255 inet6 fe80::20c:29ff:fe05:766b prefixlen 64 scopeid 0x20<link> ether 00:0c:29:05:76:6b txqueuelen 1000 (Ethernet) RX packets 607480 bytes 1278116091 (1.1 GiB) RX errors 0 dropped 13 overruns 0 frame 0 TX packets 404695 bytes 37875952 (36.1 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 0 (Local Loopback) RX packets 18963942 bytes 5327444973 (4.9 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 18963942 bytes 5327444973 (4.9 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0