Retrieve the lost ifconfig in CentOS 7

Source: Internet
Author: User

Since centos7 minimal was installed in the early morning of November 5, there has been no chance (lazy) to play with it. It's really embarrassing. Today is Saturday, it's raining, so let's take a look at this system:

After logging in to the system, I want to see how many ip addresses are. So I naturally used ifconfig, but I had a loose. ifconfig: command not found.

Because I can't (I don't know) on the physical machine (I don't know), I should simply use the linux system to write a blog after I get the graphic interface out, now it's sad to remember and then paste the same picture on the Internet.

In other words, I checked the internet and found that this is a new feature of Centos7. The ifconfig command is not used by default. You still need to do the following:

1, cd/etc/sysconfig/network-scripts

After you get to this directory, you may find a file named enpXXX based on the display name of your network card. My machine displays enp25s0, so I typed it again under this directory.

2, vi if-enp25s0

Add the following lines at the end of the article:

IPADDR0 = 192.168.1.9

GATEWAY0 = 192.168.1.1

DNS1 = 255.255.255.0

Change ONBOOT = no to yes

: Wq!

3. Restart the network service and type

Service network restart

Of course, you can directly type/etc/init. d/network restart, and the effect is the same.

4. Finally, because ifconfig is in the net-tools package, you also need to type in the shell window:

Yum clean all

Yum install net-tools

5. After the preceding steps, the ifconfig command is retrieved.

Ps: those who have experience in dos feel that learning linux will be much better. Fortunately, I have it. Haha, this is an example of exposing age, but this is the truth. The Internet is everywhere. It is also a good thing to be able to view your network address. This article will be recorded here.

 

Retrieve the lost ifconfig in CentOS 7

Related Article

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.