Centos7 networking configuration tutorial after installation, centos7 tutorial

Source: Internet
Author: User

Centos7 networking configuration tutorial after installation, centos7 tutorial

Generally, after centos is installed (on a virtual machine), you need to configure the service by yourself. Next I will explain how to configure

Networking Procedure

First, open the two services of the virtual machine,Right click my computer> Manage> Find service> StartTwo services:

Then configure the configuration file under centos.

The procedure is as follows:

Open the terminal and enterSudo-I,Enter PasswordEnter ls/etc/sysconfig/network-scripts/In administrator mode/

Show the relevant configuration file and find the ifcfg-ensxxx file. You may not be the same as mine. Remember or copy the file and use it multiple times.

Enter vim/etc/sysconfig/network-scripts/ifcfg-ensxxx.

Modify"ONBOOT = no"If the value is no, you cannot access the Internet. Change it to" yes "first ". Press esc->: wq under vim to save and exit the vim editor.

If not, vim canVimChangeGeditThis makes it easy to modify. Enter shutdown-r now and restart your computer to connect to the Internet.

Note:

If there is a networking icon in the upper right corner, open the terminal and enter:Service NetworkManager startOpen NetworkManager.

Set a fixed ip Address

Enter ifconfig to find the corresponding IP Address

Open the ifcfg-ensxxx file again and add

IPADDR = 192.168.83.131 // Add IP address PREFIX = 24 // mask GATEWAY = 192.168.83.1 // Add GATEWAY

Modify host name

First enter the root user and then perform the following steps

View Host Name: Enter:Hostname

Procedure

Input: vim/etc/sysconfig/network

Display

    NETWORKING=yes    HOSTNAME= localhost.localdomain

Set the value after HOSTNAME = to the user name you want.

Modify the ing between host name and IP address

Terminal input:Vim/etc/hosts

-Add content at the end of the file. Format: IP address Host Name (separated by spaces). Save and exit.
    192.168.83.131  yang1

Output after success: ping yang1 to check whether the operation is successful.

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.