Configuring CentOS 7 static IP in VMware

Source: Internet
Author: User

The virtual machine is configured as a static IP to ensure that the virtual machine's IP remains intact each time the host machine restarts, which is useful for learning about software in a clustered environment, such as a Hadoop cluster, a DB cluster such as MySQL.

After the VMware workstation has loaded the Linux system (here with CentOS 7), the virtual machine uses NAT to surf the internet and can be configured in a simple network configuration as follows:

1: Set the host name of the virtual machine hostname;

$ sudo hostnamectl set-hostname master_machine

(CentOS 7 uses the HOSTNAMECTL command to host name-related settings)

2: Set static IP

1> View the gateway for VMware:

2> configuration network;

$ cd/etc/sysconfig/network-scripts

$ ls

Modify the contents of a file

$ sudo vi ifcfg-eno16777736

The following changes are included:

Note that the Bootproto is changed from DHCP to static, plus IPADDR (the static IP you want to specify) NETMASK (subnet mask 255.255.255.0) Gateway (the gateway IP seen in the first step of VMware) DNS1 (114.114.114.114).

3> reboot under:

$ sudo service network restart

This completes the static IP setting.

Sometimes we want to use host name to access between the local area network of the virtual machine, then modify the/etc/hosts file, for example:

Configuring CentOS 7 static IP in VMware

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.