In VMWare, Centos sets the specified NAT ip address to access the network at the same time, and centosnat

Source: Internet
Author: User

In VMWare, Centos sets the specified NAT ip address to access the network at the same time, and centosnat

First, after centos is installed, select Virtual Machine --> right-click --> set --> Virtual Machine to NAT Mode

 

 

Select Edit> Virtual Network editor> View or edit the subnet ip address and subnet mask.

 

Select NAT settings to view the gateway Ip Address

 

View ifconfig before configuration and record mac

 

 

Configure the specified IP address as follows:

Edit: vi/etc/sysconfig/network-scripts/ifcfg-eth0 with root permissions

 

DEVICE = "eth0" # The first Nic
BOOTPROTO = "static" # flag of static IP
HWADDR = "00: 0C: 29: BD: F4: E5" # the MAC address specified above
IPV6INIT = "yes"
IPADDR = "192.168.135.155" # ip address to be specified
GATEWAY = "192.168.135.2" # GATEWAY
NETMASK = "255.255.255.0" # Subnet Mask
NM_CONTROLLED = "no"

ARPCHECK = "NO"
ONBOOT = "yes"
TYPE = "Ethernet"
UUID = "1be372d0-5fbe-420d-9847-c5b45792cae9" # if it is a clone centos cluster, the UUID is consistent

 

Edit: vi/etc/resolv. conf
Add:

Nameserver 192.168.135.2 # Gateway

 

 

Run/etc/init. d/network restart to restart net.

View ip address information through ifconfig

Ping www.baidu.com to test network conditions

 

Perform the final test:

 

If the ping fails, you can: Disable VMnet1 in the network connection and try again. If not, try to restart centos for testing.


 

 

 

 

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.