CentOS Virtual Machine Network configuration

Source: Internet
Author: User
Tags nameserver

Modify IP

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Onboot=yes

Bootproto=dhcp

Service Network restart

Virtual opportunity automatically acquires an IP address after reboot

-----------------

Example: the IP address after ifconfig is 192.168.31.132

Inner-layer Routing 192.168.31.2

Outer Route 192.168.1.1

Ping www.baidu.com cannot ping if the internal and external routing can ping

Need to set up DNS

-----------------

Modify DNS vi/etc/resolv.conf

Modify NameServer

; Generated By/sbin/dhclient-script

Search Node1

NameServer 192.168.31.2

The first two lines can not only configure NameServer

Modify Host Name

Vi/etc/sysconfig/network

Modify the host name that hostname defines for itself

Reboot INIT 6 hostname configuration Complete

Set MAC Address

Delete HWADDR

Remove UUID

Rm-rf/etc/udev/rules.d/70-persistent-net.rules

Restarting Init 6

CentOS Virtual Machine Network configuration

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.