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