Configure IP addresses in centos 7

Source: Internet
Author: User

Configure IP addresses in centos 7
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.