Virtual machine Set static IP

Source: Internet
Author: User

Recently learning Hadoop, using virtual machines to do the distributed, because Hadoop to configure the host name of the slave node, you need to modify the Hosts file's IP address and host name Mapping relationship.

However, each time the virtual machine restarts, the IP address will change, so that each time you have to change the hosts file. So decided to static IP, the process encountered some problems, now the steps and the problems encountered summed up:

1, modify sudo vi/etc/network/interfaces, modify the content as follows:

Iface eth0 inet Static

Address 192.168.0.100
Netmask 255.255.255.0
Gateway 192.168.0.1

2, Ifup eth0

3,/etc/init.d/networking Restart (it is important to forget to execute this command, have been unable to ssh remote connection)

If it still doesn't work, restart the virtual machine.

Ps:linux for Ubuntu

Virtual machine Set static IP

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.