Communication between virtual machines and host machines

Source: Internet
Author: User

Communication between virtual machines and host machines

1. briged:

(1) Click 'edit'-> 'virtual network editor... 'and make the following settings on the pop-up interface:

Click 'OK.
(2) Click 'vm '-> Settings and make the following settings on the pop-up interface:

Click 'OK.
(3) Cd etc/sysconfig/network-scripts/
VI ifcfg-eth0
Modify the following three items:
Adevice = "eth0"
Hwaddr = "00: 0C: 29: F1: 52: 31"
Nm_controlled = "yes"
Onboot = "yes"
Company:
Ipaddr = "10.17.47.201"
Netmask = "255.255.255.0"
Gateway = "10.17.47.203"
Factory lane:
IP: 202.109.207.165
Mask: zookeeper without authorization
GW: 202.109.207.161
Bridge: Set the IP address to the same network segment as the host machine (assuming ip2 ).
(4) vi etc/hosts: Modify the corresponding IP Address
(5) reboot: restart the VM.

Or service network restart


2. NAT:

(1) Click 'edit'-> 'virtual network editor... 'and make the following settings on the pop-up interface:

Click 'OK.

(2) Click 'vm '-> Settings and make the following settings on the pop-up interface:

Click 'OK.
(3) Cd etc/sysconfig/network-scripts/
VI ifcfg-eth0
Modify the following three items:
Adevice = "eth0"
Hwaddr = "00: 0C: 29: F1: 52: 31"
Nm_controlled = "yes"
Onboot = "yes"
Company:
Ipaddr = "10.17.47.201"
Netmask = "255.255.255.0"
Gateway = "10.17.47.203"
Factory lane:
IP: 202.109.207.165
Mask: zookeeper without authorization
GW: 202.109.207.161
NAT: Set the IP address to the same network segment as the Virtual Machine NIC (assuming ip2 ).
(4) vi etc/hosts: Modify the corresponding IP Address
(5) reboot: restart the VM.
Or service network restart

3. Host-only:

(1) Click 'edit'-> 'virtual network editor... 'and make the following settings on the pop-up interface:

Click 'OK.

(2) Click 'vm '-> Settings and make the following settings on the pop-up interface:

Click 'OK.
(3) Cd etc/sysconfig/network-scripts/
VI ifcfg-eth0
Modify the following three items:
Adevice = "eth0"
Hwaddr = "00: 0C: 29: F1: 52: 31"
Nm_controlled = "yes"
Onboot = "yes"
Company:
Ipaddr = "10.17.47.201"
Netmask = "255.255.255.0"
Gateway = "10.17.47.203"
Factory lane:
IP: 202.109.207.165
Mask: zookeeper without authorization
GW: 202.109.207.161

Host-only: Set the IP address to the same network segment as the Virtual Machine NIC (assuming ip2 ).
(4) vi etc/hosts: Modify the corresponding IP Address
(5) reboot: restart the VM.

Or service network restart

 

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.