ifconfig command not found at CentOS 7 minimal installation

The error “ifconfig command not found” occurs. Actually, the command of ifconfig is obsolete, and is unavailable at CentOS 7 minimal installation.

Assign an IP to access internet

If you insist on running this command, firstly, you might to assign an IP to your host as follows.

Get the interface name

Run “ip addr” to  get the interface name, for example “ens33”

Edit the interface configuration file

The configuration file will be “/etc/sysconfig/network-scripts/ifcfg-ens33”. There’re two methods to set its IP. One is to set an dynamic IP from DHCP, and another is to set a static IP.

Set an dynamic IP from DHCP

Change “ONBOOT=no” to “ONBOOT=yes”, and reboot the host, then it’ll access internet. The total context will be look like as follows.

Set a static IP

Change “ONBOOT=no” to “ONBOOT=yes”, add a static IP into the configuration file, close DHCP feature, and reboot the host, then it’ll access internet.

Install the command of ifconfig

Now the host has internet access, you’d run “yum install net-tools” to get the command of ifconfig.

如无特殊说明,文章均为本站原创,转载请注明出处
源自: 王明军的博客
本文链接地址: ifconfig command not found at CentOS 7 minimal installation
广告

发表评论

This site uses Akismet to reduce spam. Learn how your comment data is processed.