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