CentOS set fixed IP in VMware virtual machines

Source: Internet
Author: User

1. First access to your gateway

Convenient to use the Select menu bar in the cento system configuration: edit->virtual Network Editor

Select VMnet8, click Nat settings to view the gateway address: The gateway IP here is 192.168.112.2

The next step is to get to the chase.

2. Set up a CentOS static IP:

Three configuration files are involved, namely:

/etc/sysconfig/network

/etc/sysconfig/network-scripts/ifcfg-ens33

/etc/resolv.conf

A. First modify the/etc/sysconfig/network as follows:

Networking=yes

#此处可指定主机名

Hostname=namenode

gateway=192.168.112.2

Specifies the gateway address.

B. Then modify the/etc/sysconfig/network-scripts/ifcfg-eth33 as follows:

Type=ethernet

#此处改为虚拟机分配的MAC地址

Hwaddr=00:0c:29:61:0f:dd
Bootproto=static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
Ipv6_addr_gen_mode=stable-privacy
Name=ens33
uuid=d74c8bd7-e4c0-4afe-a5b6-2970a9c98359
Device=ens33
Onboot=yes
netmask=255.255.255.0
gatway=192.168.112.2
ipaddr=193.168.112.129
dns1=192.168.112.2

C. Restart the network: Service network restart

This is a simple few steps after the virtual machine's IP has been 192.168.112.129.

Once the IP is fixed, you can then set the host

Finally, this configuration must be configured to change the virtual machine configuration Network connection mode to NAT mode

Add: If you need to forward a virtual machine port to the host intranet, you can set up NAT forwarding:

CentOS set fixed IP in VMware virtual machines

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.