CentOS7 ifconfig command cannot be used -bash: ifconfig: command not found

Problem Description

Linux CentOS7 system, -bash: ifconfig: command not found
insert image description here

solution

1. Execute yum search ifconfig (search which installation package ifconfig is in):

yum search ifconfig

1.1 If you encounter the following error:
insert image description here
Solution:

vi /etc/resolv.conf

Insert the following two lines, save and exit to solve:

nameserver 8.8.8.8
nameserver 8.8.4.4

If inserting the above two lines fails to solve the problem, it may be that the network card is not turned on during installation, resulting in the inability to connect to the network. For the solution, refer to conveyor belt
2. Execute yum search ifconfig again (search which installation package ifconfig is in):

yum search ifconfig

The execution effect is as shown in the figure below:
insert image description here
3. Execute the following command to download net-tools.x86_64:

yum install net-tools.x86_64

insert image description here

------------------ So far, the ifconfig command can be executed normally ---------------------

Guess you like

Origin blog.csdn.net/weixin_41377835/article/details/106854263