A virtual machine is provided with a local interconnection network (master mode only)

1. In order to realize the interconnection system Linux host and the virtual machine, the virtual machine can be set to achieve the purpose.

VMware's network connection mode, there are three:
1, host-only mode: that is host_only, this model only allows only the local virtual machine and the physical machine communication, not the Internet;
2, NAT mode: This mode retains only the host mode function , the Internet also allows the host;
3, bridge mode: the virtual machine network card directly to the local host of the Internet.

Starting with the "Host Only Mode" simple virtual machine to communicate with local physical machine

(Note: After installing VMware, the software creates two virtual network adapter in the system, namely VMnet1 and VMnet8, which is the only host mode VMnet1 used, VMnet2 is the use of NAT mode),

Therefore, we use only the host mode, only can be used to modify VMnet1.

Step one: Open the VMware menu, [virtual machine] - [Settings], select Network Link network adapter

Step two: Open VMware, menu [Edit] - [Virtual Network Editor]

The third step: VMware Open installed centos7, and to set the ip address in the same network segment VMnet1. as follows:

cd /etc/sysconfig/network-scripts/
cat ifcfg-ens33

Edit the following

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=838284ba-1b30-4892-a817-26240fd8847e
ONBOOT=yes
IPADDR=192.168.0.22
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=192.168.0.1
PREFIX0=24
IPV6_PRIVACY=no

Step four: Restart card, use the command systemctl restart network, and then view the local IP address, you can achieve interconnection.

Step Five: Set your local computer

Enable

If the virtual machine to install nginx

To access the local computer

Guess you like

Origin www.cnblogs.com/ifme/p/11997137.html