Configure IP addresses for centos7

Source: Internet
Author: User
Environment virtual machine: VMWare10.0.1build-1379776 Operating system: CentOS764 bit introduction when CentOS7 is installed (Minimal), it does not contain the ifconfig command, which is included in the net-tools package, yum can be installed, but when the network is not configured, yum cannot work at this time (the software package cannot be downloaded from the network ). Then we need to manually configure the NIC to set the environment

Virtual Machine: VMWare10.0.1 build-1379776

Operating system: 64-bit CentOS7

Introduction

CentOS7 Minimal installation (Minimal) without the ifconfig command, which can be installed in the net-tools package through yum, but when our network is not configured, at this time, yum cannot work (cannot be connected to the network to download software packages ). Then we need to manually configure Nic settings.

View network adapters
ip a

Lists information about all network adapters.

 

 

Lo is the local loopback address 127.0.0.1

Eno16777736 is our VM Nic.

Configure IP addresses

Open/etc/sysconfig/network-scripts/ifcfg-eno16777736

vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

Default configuration

Modify configurations

Description

IPV6INIT = no # disable ipv6

ONBOOT = yes # Start Automatic loading

HWADDR = 00: 0C: 29: C7: A9: 5D # enter the MAC address based on the virtual machine network adapter configuration

PREFIX = 24 # mask length

Complete configuration file

TYPE=EthernetBOOTPROTO=noneDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=noIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noNAME=eno16777736UUID=f74f183e-026c-44fd-91f3-08a08a3d02cfDEVICE=eno16777736ONBOOT=yesDNS1=114.114.114.114HWADDR=00:0C:29:C7:A9:5DIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPADDR=10.12.2.68PREFIX=24GATEWAY=10.12.2.254
Restart network service
service network restart

Test network, ping Gateway

ping 10.12.2.254

 

 

According to the feedback, the network and configuration are completed.

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.