Solution: centos7 does not have the ifconfig command installed

Source: Internet
Author: User

Our solution is: install the ifconfig command package in yum.

See It, bash is also split line, of course this is not in the focus, the focus is through the yum search command we found that the ifconfig command is in the net-tools.x86_64 of this package, next we will install this package.

Here we have installed the ifconfig command. Let's try it.

After the command is run successfully, do you have the same questions as I did at the beginning? Why is it not necessary to install the ipconfig command in windows when it comes to linux, the ifconfig command is originally from net-tools, which contains ifconfig, netstat, whois, and other commands. Therefore, you cannot run these commands before.

Example

My Nic is the Atheros AR8131 PCI-E, but there is no prompt to set the Nic during installation, no ifcfg-eth0 configuration file found after installation.

Use dmesg | grep-in eth to check whether there is any eth0 message in the boot information.

Changed from interface eth0 to ens33

3. Change the nic name from ens33 to eth0.

Modify GRUB_CMDLINE_LINUX in grub and append the statement "net. ifnames = 0 biosdevname = 0".

Then run # grub2-mkconfig-o/boot/grub2/grub. cfg
Restart later # reboot

Check the NIC and find that the name has been changed.

However, you still need to rename/etc/sysconfig/network-scripts/ifcfg-ens33 to a ifcfg-eth0, modify its content, specify the IP, NETMASK, and GATEWAY, and change onboot = no to yes. Finally, run service restart network.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.