
Исправляем ошибку «ifconfig not found in centos»
Недавно при использовании docker контейнера, я ввел ifconfig команду на Centos 7 и получил ответ “Command Not Found”. И так, исправляем ошибку «ifconfig not found in centos»….
1. Посмотрим с каким пакетом идет данная утилита, для этого — выполняем:
# yum provides ifconfig Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.easynews.com * extras: repos.lax.quadranet.com * updates: centos.mirror.ndchost.com net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools Repo : base Matched from: Filename : /sbin/ifconfig
2. Видим что данная утилита находиться в «net-tools» пакете, по этому, установим ее:
# yum install net-tools -y
3. После установки выполняем повторную проверку:
# ifconfig enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255 inet6 fe80::a00:27ff:fe6c:3e95 prefixlen 64 scopeid 0x20<link> ether 08:00:27:6c:3e:95 txqueuelen 1000 (Ethernet) RX packets 232391 bytes 244921302 (233.5 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 68689 bytes 5745906 (5.4 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.221 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fd86:94c4:705c:0:a00:27ff:fedd:6c29 prefixlen 64 scopeid 0x0<global> inet6 fe80::a00:27ff:fedd:6c29 prefixlen 64 scopeid 0x20<link> ether 08:00:27:dd:6c:29 txqueuelen 1000 (Ethernet) RX packets 141 bytes 21508 (21.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 135 bytes 11836 (11.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.130.10 netmask 255.255.255.0 broadcast 192.168.130.255 inet6 fe80::a00:27ff:feab:9a12 prefixlen 64 scopeid 0x20<link> ether 08:00:27:ab:9a:12 txqueuelen 1000 (Ethernet) RX packets 21 bytes 5208 (5.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 27 bytes 3090 (3.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s10: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.130.20 netmask 255.255.255.0 broadcast 192.168.130.255 inet6 fe80::a00:27ff:fecb:eb5b prefixlen 64 scopeid 0x20<link> ether 08:00:27:cb:eb:5b txqueuelen 1000 (Ethernet) RX packets 30 bytes 5184 (5.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 34 bytes 4184 (4.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s16: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.130.30 netmask 255.255.255.0 broadcast 192.168.130.255 inet6 fe80::a00:27ff:fe6c:cd09 prefixlen 64 scopeid 0x20<link> ether 08:00:27:6c:cd:09 txqueuelen 1000 (Ethernet) RX packets 29 bytes 5688 (5.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 26 bytes 3000 (2.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s17: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.130.40 netmask 255.255.255.0 broadcast 192.168.130.255 inet6 fe80::a00:27ff:fe33:98d1 prefixlen 64 scopeid 0x20<link> ether 08:00:27:33:98:d1 txqueuelen 1000 (Ethernet) RX packets 25 bytes 5448 (5.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 26 bytes 3000 (2.9 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 0 (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
Видим что все заработало. Статья ‘Исправляем ошибку «ifconfig not found in centos»‘ завершена.