Set a fixed IP address in CentOS6.4 of VMware Virtual Machine

Source: Internet
Author: User
For some reason, if you want to perform a test in a virtual machine and require a fixed IP address, record this process. 1. obtain your GATEWAY first, so that you can use the menu bar Edit-& gt; VirtualNetworkEditor to select VMnet8 in cento system configuration. click NATSettings to view the GATEWAY address. the GatewayIP here is 192.168

For some reason, if you want to perform a test in a virtual machine and require a fixed IP address, record this process.

1. first obtain your GATEWAY for later use in cento system configuration

Choose Edit> Virtual Network Editor from the menu bar.

Select VMnet8 and click NAT Settings to view the GATEWAY address. The Gateway IP address here is 192.168.110.2.

Next, you can go to the topic.

2. set the CentOS static IP address:

Three configuration files are involved:

/Etc/sysconfig/network

/Etc/sysconfig/network-scripts/ifcfg-eth0

/Etc/resolv. conf

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

Specify the Gateway address.

B. Then modify/etc/sysconfig/network-scripts/ifcfg-eth0:

 

[Html]View plaincopy
  1. DEVICE = "eth0"
  2. # BOOTPROTO = "dhcp"
  3. BOOTPROTO = "static"
  4. IPADDR = 192.168.110.129
  5. NETMASK = 255.255.255.0
  6. HWADDR = "00: 0C: 29: 53: A8: 1D"
  7. IPV6INIT = "no"
  8. NM_CONTROLLED = "yes"
  9. ONBOOT = "yes"
  10. TYPE = "Ethernet"
  11. UUID = "f933b2bf-47eb-42f3-bea9-1f54088a2cb7"
  12. DNS1 = 192.168.110.2

C. finally, configure/etc/resolv. conf: (in fact, this step can be omitted. after the DNS Server address is set above, the system will automatically modify this configuration file .)

 

 

[Html]View plaincopy
  1. # Generated by NetworkManager
  2. Nameserver 192.168.110.2


 

After a few steps, the IP address of the VM is 192.168.110.129.

After the IP address is fixed, you can set the host

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.