[Centos]ip operation

Source: Internet
Author: User
Summary

After installing CentOS in the virtual machine, you need to know the IP of the CentOS, which is convenient for later connection.

View IP Commands

Command

Ifconfig

 

Can see the information, the instructions have been configured, if not configured, can be configured in the following way.

If you configure IP, you need to switch to root permissions, switch to the command line interface via CTRL+ALT+F2

CD to the directory of the network configuration file, and list the files under the directory.

cd/etc/sysconfig/network-scripts/

View Files

Ls

FileName

VI ifcfg-eno16777736

"Is the network configuration of the main file, open it by the following command

Need to configure IPADDR0=IP address, gatway0= Gateway, Dns=dns.

Edit End, by: Wq Save and exit

Restart Network Service

Service Network restart

View IP again

The IP of the local ping virtual machine

Summarize

Of course, this kind of command line is cumbersome, if there is an interface, you can set in the interface. But most of the servers are not interfaces. The command line is the only way.

Reference articles

Introduction to CentOS file viewing and editing

[Centos]ip operation

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.