Use the virtual machine network configurations are summarized on mac

In early 2014, the company let explore hadoop related technologies, has been a kind of habit, no matter what the technology,
the next must play himself, then felt so only at the end, playing hadoop, is a stand-alone mean nothing, distributed
more than is necessary machines, then after reading mactalk, the above paragraph have been mac, no matter what you LVS, hadoop
like how to play how to play, save enough money to buy early, then that is new to mac, the road began to be suspended or beaten, research hadoop,
process is hard to force, but all came, it would need to use a virtual machine, think of it was hard to force their own, written
, recorded.

When prompted mactalk, I chose the virtual machine software is virtualbox, and then encounter a problem, it is the network should, first of all I need to say,

The machine can be connected to the virtual machine
virtual machine can be connected to the machine
virtual machine access to the Internet
can ssh without password between virtual machines
This machine can ssh login with no password

Read a lot of articles, the virtual machine network NAT, bridging differences and only the difference between Host, personal understanding as follows

NAT

If your virtual machine eth0 configuration is not modified, automatically obtain ip, so after a successful installation start the virtual machine, it will automatically get the ip and get the ip and host is a network segment can be directly ping through, and can networking, virtual box network configuration which can be seen, command + ,in virtualbox network that bar inside, you can see 10.0.2.0/24, then the virtual machine starts, it will automatically generate ip 10.0.2.15

Host-Only

Is the new host on a network card, and then set up a separate local area network between the host and the virtual machine and the host and virtual machine communication barrier,
here is the problem I encountered was the network configuration page in the virtual machine, after activating the card Second, select the host-Only, the following 界面名称has been no way to choose, now understand that is to host virtualbox to add a network card, but did not know, was stunned to find a very long time that he forgot how long, the same command + `, bring up virtualbox network settings page, then add the card again virtualbox network configuration page, and then the virtual machine's network configuration page can choose to have the card, the host ip default is 192.168.56.1, the smallest ip is 192.168. 56.101, the biggest is 192.168.56.254, what would be the things that are difficult, difficult does not, add a card after two, my host added a ip192.168.56.1, then 5 virtual machine ip is 192.168. 56.101 ~ 192.168.56.105, usually at the same time start the virtual machine 3

bridging

Gets the ip address of a segment with the host, such as host ip 192.168.1.101, virtual access to ip 192.168.1.103, but the company's ip should all be tightly managed, so this method is not good maintenance, if the host is located LAN other machines do not need to have to utilize the functionality of virtual machines, it is best to use Host-Only establish an independent local area network

My plan is

NIC NAT mode and host a shared network, virtual machines can be networked, easy to download and install various software
card with two hosts to establish a separate local area network, and other routing machines separated (see this way too right now, and I later put mac taken by the company, because to demonstrate hadoop cluster computing, and the company is required to ip network management application)
ip fixed each virtual machine, because hadoop cluster to set the master, ip to be fixed

A shared NIC using NAT host network is configured as follows

cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=08:00:27:41:90:4D
TYPE=Ethernet
UUID=1c2f383c-8fdb-4aa0-9e5b-8fa2f60117f9
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

Two new cards, Host-Only arranged using the following

cat /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
HWADDR=08:00:27:93:D4:33
TYPE=Ethernet
UUID=8ac73766-a02b-4417-8f71-6762218b6bf8
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.56.101
NETMASK=255.255.255.0

/etc/init.d/network restart  重启网络配置
ifup eth0 /ifdown eth0  启用/停用某个网卡

Difficulties summary

Added to the machine virtualbox appreciated NIC
ip acquiring specified manually, automatically modify the default acquisition

-EOF-

Original: Big Box  virtual machine network configurations are summarized on mac


Guess you like

Origin www.cnblogs.com/wangziqiang123/p/11618383.html