VmWare communicates with host host step by step (for beginners)

Source: Internet
Author: User
Tags virtual environment

Basic principle

There are three ways to communicate in a virtual machine, as shown in



1. Bridged (bridging mode)

In bridging mode, VMware Virtual operating system is like a separate host in the LAN, it can access any machine in the network but you need more than one IP address, and you need to manually configure the virtual system IP address subnet mask, but also with the host machine in the same network segment, So that the virtual system can communicate with the host machine

If you want to use VMware to create a new virtual server within the LAN, to provide network services for LAN users, you should choose Bridging mode

2. NAT (network address translation mode)


Using NAT mode is to let the virtual system with NAT (Network address translation) function, through the host machine on the network to access the public network that is, the use of NAT mode can be implemented in the virtual system access to the Internet NAT mode of the virtual system TCP/IP configuration information is by VMnet8 (NAT) The virtual network's DHCP server provides, cannot make the manual modification, therefore the virtual system also cannot communicate with the other real host in this LAN, uses the NAT mode the biggest advantage is the virtual system accesses the Internet very simple, you do not need to carry on any other configuration, only needs the host machine to have access to the Internet to

If you want to use VMware to install a new virtual system, you can directly access the Internet without any manual configuration in the virtual system, it is recommended that you use NAT mode

3. Host-only (host mode)

In some special network debugging environment, the need to isolate the real environment and virtual environment, then you can adopt host-only mode in host-only mode, all virtual systems can communicate with each other, but the virtual system and the real network is isolated can take advantage of Windows XP has its own Internet Connection Sharing (actually a simple route NAT) to allow the virtual machine to access the virtual system's TCP/IP configuration information (such as IP address gateway address DNS server, etc.) through the host's real network card, all by VMnet1 (host-only) The DHCP server of the virtual network to dynamically assign the

If you want to use VMware to create a virtual system that is isolated from other machines in the network, you can choose Host-only mode for some special network debugging work.


Nat Mode Configuration

How to configure NAT (static IP)

1 Ensure that the network adapter for the virtual machine is healthy. Select Edit-virtunal Network Editor



2 Check the NIC properties to ensure that the status of VMnet8 host Connection (host connection) is connected. If you don't have a connection, you can click the Restore Default button in the lower left corner to restore the defaults.



3 Click the NAT Settings button and you can view the gateway as 192.168.84.2. Make a note of the gateway at this point and prepare for the subsequent configuration.



4 Entering the virtual machine, modifying the configuration information of the eth0

[Email protected]=192 ~]# vi/etc/sysconfig/network-scripts/ifcfg-eth0bdevice=eth0hwaddr=00:0c:29:7f:ef:4ctype= ethernetuuid=34adef05-91e5-4f4a-9776-df983b2a8787onboot=yesnm_controlled=yesbootproto=staticnetmask= 255.255.255.0ipaddr=192.168.84.101gateway=192.168.84.2dns1=192.168.84.2ipv6init=noarpcheck=no
Make sure that the following parameters are set

Onboot=yesnm_controlled=yes

Bootproto=static<span style= "White-space:pre" ></span>//static address netmask=255.255.255.0ipaddr= 192.168.84.101<span style= "White-space:pre" ></span>//virtual machine IP address (optional) Gateway=192.168.84.2<span style= " White-space:pre "></span>//Gateway (consistent with the previously seen Gateway)

5 Restart the Network service after saving to ensure normal activation.
[Email protected]=192 ~]# service network restartshutting down interface eth0:                              [  OK  ]shutting Loopback Interface:                          [  OK  ]bringing up loopback interface:                            [  OK]  ]bringing up interface eth0:                                [  OK  ]

6 See if the IP address at this point is set as configured above
[[Email protected]=192 ~]# ifconfigeth0      Link encap:ethernet  HWaddr 00:0c:29:7f:ef:4c inet addr            : 192.168.84.101  bcast:192.168.84.255  mask:255.255.255.0          inet6 addr:fe80::20c:29ff:fe7f:ef4c/64 Scope : Link up          broadcast RUNNING multicast  mtu:1500  metric:1          RX packets:448 errors:0 dropped:0 overruns:0 frame:0          TX packets:223 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes : 39552 (38.6 KiB)  TX bytes:19385 (18.9 KiB)          interrupt:19 Base address:0x2000 lo        Link encap:local Loopback            inet addr:127.0.0.1  mask:255.0.0.0          Inet6 Addr::: 1/128 scope:host up          LOOPBACK RUNNING  mtu:65536  metric:1          RX packets:0 errors:0 dropped:0 overruns:0 frame:0          TX packets:0 errors:0 dropped:0          overruns:0 carrier:0 collisions:0 txqueuelen:0           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

7 on the Host View Network card information (WIN7 Environment) Control Panel \ Network and internet\ network connection find the "VMware network Adapter VMnet8" This network card



8 View IPV4 Properties change the default gateway to match the gateway in the virtual machine 192.168.84.2


9 Ping the virtual machine address in the command prompt line 192.168.84.101

C:\users\administrator>ping 192.168.84.101 is pinging 192.168.84.101 with 32 bytes of data: Reply from 192.168.84.101: bytes =32 time =3ms ttl=6 4 Replies from 192.168.84.101: Byte =32 time =1ms ttl=64 reply from 192.168.84.101: bytes =32 time <1ms ttl=64 reply from 192.168.84.101: bytes =32 time <  Ping statistics for 1ms ttl=64192.168.84.101:    packet: Sent = 4, received = 4, lost = 0 (0% missing), estimated time of round trip (in milliseconds):    shortest = 0ms, longest = 3ms, average = 1ms


10 You can ping through now

After pinging, you can use tools such as Xshell to connect to the virtual machine and simplify the operation.




Virtual Machine Internet Settings

1 in the current mode, check if you can ping the extranet. The following results show that you can ping the

[[Email protected]=192 ~]# Ping baidu.comping baidu.com (220.181.111.86)] bytes of data.64 bytes from 220.181.111.86 : icmp_seq=1 ttl=128 time=7.75 ms64 bytes from 220.181.111.86:icmp_seq=2 ttl=128 time=51.3 ms64 bytes from 220.181.111.86 : icmp_seq=3 ttl=128 time=9.57 ms64 bytes from 220.181.111.86:icmp_seq=4 ttl=128 time=8.38 ms64 bytes from 220.181.111.86 : icmp_seq=5 ttl=128 time=7.39 ms64 bytes from 220.181.111.86:icmp_seq=6 ttl=128 time=7.83 ms64 bytes from 220.181.111.86 : icmp_seq=7 ttl=128 time=7.16 ms64 bytes from 220.181.111.86:icmp_seq=8 ttl=128 time=91.2 ms^c---baidu.com ping statist ICS---8 packets transmitted, 8 received, 0% packet loss, time 7194msrtt Min/avg/max/mdev = 7.163/23.834/91.244/29.166 ms

2 If the following results indicate that the ping does not pass the extranet. Returns the unknown host name.

[[Email protected]=192 ~]# Ping Baidu.comping:unknown host baidu.com


3 If the virtual machine wants to sisu the network, it needs to modify the network card configuration information. Add a DNS address to the file, which is the same as the gateway.

[Email protected]=192 ~]# vi/etc/sysconfig/network-scripts/ifcfg-eth0bdevice=eth0hwaddr=00:0c:29:7f:ef:4ctype= ethernetuuid=34adef05-91e5-4f4a-9776-df983b2a8787onboot=yesnm_controlled=yesbootproto=staticnetmask= 255.255.255.0ipaddr=192.168.84.101gateway=192.168.84.2<span style= "color: #ff0000;" >dns1=192.168.84.2</span>ipv6init=noarpcheck=no


4 Restart the Network service and ping the Extranet again. It is possible to ping out of the network at this time.

[Email protected]=192 ~]# service network restartshutting down interface eth0:                              [  OK  ]shutting Loopback Interface:                          [  OK  ]bringing up loopback interface:                            [  OK]  ]bringing up interface eth0:                                [  OK  ] [[Email protected]=192 ~]# Ping baidu.comping baidu.com (220.181.111.86)] bytes of data.64 bytes from 220.181.111.86 : icmp_seq=1 ttl=128 time=7.64 ms64 bytes from 220.181.111.86:icmp_seq=2 ttl=128 time=8.44 ms64 bytes from 220.181.111.86 : icmp_seq=3 ttl=128 time=8.43 ms








VmWare communicates with host host step by step (for beginners)

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.