CentOS settings in VMWare specify NAT IP to access the network at the same time

Source: Internet
Author: User

First, after installing CentOS, check the virtual machine----right---set the virtual machine to NAT mode

Select Edit--Virtual network editor--View or edit subnet IP and subnet masks

Check NAT settings to view gateway IP

View the ifconfig before the configuration and record the Mac

The following begins the formal configuration of the specified IP:

Edit under root privileges: Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device= "Eth0" #第一块网卡
bootproto= Sign of "static" #设置成静态ip
Hwaddr= "00:0c:29:bd:f4:e5" #上面指定的MAC地址
ipv6init= "Yes"
Ipaddr= "192.168.135.155" #要指定的 IP
Gateway= "192.168.135.2" #网关
netmask= "255.255.255.0" #子网掩码
nm_controlled= "No"

arpcheck= "NO"
onboot= "Yes"
Type= "Ethernet"
Uuid= "1be372d0-5fbe-420d-9847-c5b45792cae9" #如果是clone the CentOS cluster, then this UUID is consistent

Editor: vi/etc/resolv.conf
Add to:

NameServer 192.168.135.2 #网关对应

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

View IP by ifconfig

Test network conditions by pinging www.baidu.com

For the final test:

If the ping is not able to: in the network connection will be VMnet1 disabled after the attempt, if not, try to restart the CentOS test


CentOS settings in VMWare specify NAT IP to access the network at the same time

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.