Detailed VMware Network settings

Source: Internet
Author: User
Tags get ip switches what magic


Tags: network vmware virtual machine Web service2009-05-19 22:23 27537 People read Comments (7) favorite reports Classification:class Linux-based development (171)

We know that Vmwareworkstation provides a number of virtual devices that, in addition to the typical bridging network, host-only network, and NAT network, can be used to build complex custom networks. The purpose of this article is to let you know and master the various network devices of VMware Workstation virtual, and finally build a super custom network of 1.

Super Custom Network

I. Knowledge of network equipment

To network, you need to use network cards, switches and other networking equipment, similarly, in the Vmwareworkstation network also need to use these devices, but in vmwareworkstation virtual computers and networks, these devices are also virtual (but in terms of function, They are not very different from real network devices). Let's take a look at what network devices VMware Workstation are virtual for us.

⒈ switch. Like a physical switch, a virtual switch can connect hosts, virtual machines, and other network devices. After the vmwareworkstation is installed, the switch will be automatically created and automatically used by vmwareworkstation according to the needs of the network, and on the Windows Series host, you can use up to 10 virtual switches (2), but on the Linux host, You can use up to 256 virtual switches. Virtual switches created with vmwareworkstation allow you to connect one or more virtual machines to a host or other virtual machine.


Up to 10 machines

⒉ Bridge. When you use Bridge network networking between a host and a virtual machine, the Network Bridge virtual device is automatically enabled, which connects the switch to the physical Ethernet adapter in the host, the physical network card on the switch and host shared host. By default, the switch is vmet0.

All the virtual machines connected to the VMNET0 switch become an additional "real" computer on the host's network, with the IP address on the LAN where the host resides, and the ability to use all the services on the host's network, including printers, file services, gateways, and other services; Host and any physical computer on the same network as the host, other virtual machines can also use all the resources or services provided by it.

3. Host-only

The first thing to say is that the way the NAT is behind is actually adding a function in this way. First look at the picture bar,host only with Vmnet1, which consists of two components, a virtual network card (host virtual Adapter), a virtual switch (virtual Switch), the network card is automatically connected to the switch. When you configure your VMS ' network cards, if you choose Host only, they are also connected to the switch by default. At this point, you must have seen, host virtual adapter and the network card of each VM has formed a LAN, and host virtual adapter on the machine (that is, host) there is a network card (physical network card) connected to the external network ( Whether the extranet is the Internet or other local area networks. However, there is no communication between the two NICs on this host. The two NICs, a virtual one, a physical one, and the two brothers are laosi. The brothers ' incompatibility led to the VMS not being able to access the extranet, but with host Virtual ADAPTER,VM they had access to host, so called host only.

So, what is the way to allow VMs to access the extranet, and to configure the host as a simple NAT server. Here's how to use Windows XP: Open Network Connections, find the connection that represents the physical NIC (typically local area Connection), right-click, properties, Advanced, find the Internet Connection Sharing (ICS), click it, vmware Default to you installed two network cards, this place you have to choose the physical network card IP to whom to share, should be vmnet1. OK, xp pops up a dialog box that says you can't use shared files anymore. That is, after using ICS, you cannot set your files to share on the LAN. Whatever it is, go on. XP will set the IP of Host Virtual adapter on your vmnet1 to 192.168.0.1, but not DHCP, so you can set the VM's IP to 192.168.0.x statically, for example, The first VM is 192.168.0.2, the second one is 192.168.0.3. Gateway of course to be set to host Virtual Adapter (192.168.0.1), because no DHCP,VM of the DNS also to be set to static, set to your host DNS.

Under Windows 2003, you can also configure the host as a fully functional NAT server.

One of the advantages of Host only is that it is very flexible and more similar to a physical network. For example, you can select one of the VMs to use as a DHCP server, and then select one for DNS. The topology is as follows:

4.NAT

This way can be simply considered to add a NAT service on host only, and some magic is used, some people do not like this way, because it is a little different from the physical network, the reason is this magic, what magic? NAT service does not connect Host Virtual adapter with physical network card! It's equivalent to a virtual network card! By default, this unknown NIC is plugged into the second slot on the VMNET8 switch. Assuming that the network number configured by VMware for your virtual machine is 192.168.221.0, then this nameless network card is 192.168.221.2, and host virtual Adapter is 192.168.221.1, the configuration of your VM's network connection is set to get IP and DNS automatically, because this NAT service also provides the DHCP service, and the DHCP service can provide the IP of the DNS server in addition to providing the VMS with IP.

Nat mode, host virtual adapter does not provide a special role, host virtual adapter in various configurations have played a similar role, is to communicate with the host. If VMware Tools is installed, the virtual machine can use Folder sharing, and how to use it slightly. This service is through the host Virtual adapter. (Refer to the VMware documentation for this) topology see below:

⒌DHCP server. The DHCP (Dynamic Host Configuration Protocol) service installs automatically for your host when Vmwareworkstation is installed, which is an auto-start service (5) that turns your host into a DHCP server that can be used for "host only" and "NAT" The configured virtual machine automatically assigns a dynamic IP address, which provides a simpler and more automated way to assign IP addresses than to manually assign a static fixed IP address to the virtual machine.

DHCP (Dynamic Host Configuration Protocol) service

[Next Page]

⒍ the Ethernet adapter on the virtual machine. When you create a VM with the new Virtual Machine Wizard, regardless of the type of network you use, Vmwareworkstation will install an Ethernet adapter for the virtual machine you created, which appears as "AMD Pcnetpci" (6) in the virtual machine operating system. After testing, most of the operating system can identify the virtual hardware and install the appropriate driver for it, the adapter for the host and virtual machines, virtual machines and virtual machines connected to each other to provide a communication interface.

The Ethernet adapter on the virtual machine

Second, build a custom network

With the virtual network devices provided by VMware Workstation, we can build a more complex custom virtual network that can be fully traveled on your host, and it can also connect to one or more external physical networks, including home networking, small office networks or instant.

Creating a custom virtual network on Vmwareworkstation is simple, as long as we add one or more virtual Ethernet adapters and switches to the virtual machine, and then select the appropriate network type, but despite this, I also recommend that you draw a network connection sketch before you build a complex custom virtual network. Figure 1 is a connection sketch of a custom network that I drew, in the network shown in the diagram, a Web server connects to instant through a firewall, and an administrator's computer can connect to the Web server through a level two firewall.

To build this network, you must create a new four virtual machines, then use the Virtual Machine Settings dialog box to add virtual Ethernet adapters to them and choose the network connection type for them, plus you need to install the appropriate operating system and application software in each virtual machine. and to make the appropriate network settings in each virtual machine.

Below, we take advantage of the above network components provided by VMware Workstation to build this custom network in step, as shown in Figure 1.

⒈ create four new virtual machines with the New Virtual Machine Wizard: The first virtual machine uses two virtual Ethernet adapters, and when you create the virtual machine using the New Virtual Machines Wizard, select Use Bridge Network (7) to add the first Ethernet adapter directly to it.

New Virtual Machine creation

This way, the virtual machine can then connect to the Internet using the host's physical adapter, and the other three virtual machines can first select "Do not use Network connection" (8) on the New Virtual Machine wizard.

Select this option on the

⒉ Open the first virtual machine, do not start, click Edit Virtual machine settings on the summary view of VMware Workstation to open the Virtual Machine Settings dialog box, click Add to open the Add Hardware Wizard, 9, select Ethernet Adapter.

Adding an Ethernet Adapter

Then click Next to select the Custom Radio box and select the VMnet2 switch (10) from the drop-down list, and finally click Finish and click OK on the Virtual Machine Settings dialog box to add a second Ethernet adapter for the first virtual machine.

Select Device

⒊ Open the second virtual machine. Do not start, add an Ethernet adapter to the second virtual machine as described above and connect it to the switch "VMnet2".

[Next Page]


⒋ Open the third virtual machine. Do not start, add the first Ethernet adapter to the third virtual machine as described above and connect it to the switch "VMnet2".

⒌ Open the third virtual machine, do not start, and again follow the method described above to add a second Ethernet adapter to the third virtual machine and connect it to the switch "VMnet3".

⒍ Open the fourth virtual machine. Do not start it, add an Ethernet adapter to the fourth virtual machine and connect it to the switch "VMnet3" as described above.
  
⒎ after the above steps, this custom network "physical" connection we have completed, below we set up for this network The switch uses the subnet and the operating system support. First, let's determine the subnet address for the switch VMnet2. On the Vmwareworkstation menu bar, select the edit → virtual network settings command to open the Virtual Network Editor dialog box, switch to the Host Network Mappings tab, 11, click the > button after VMnet2 to open the Subnet dialog box (12), Enter a class C address, such as "192.168.64.0" and click OK, so we can manually assign the IP address in the subnet "192.168.64.0" to the virtual machine connected to the VMNET2 switch.


Set IP and Subnet masks

As we said above, Vmwareworkstation has a DHCP service installed for the host, and we can add VMnet2 to the list of DHCP services so that DHCP automatically assigns a subnet to the virtual machines connected to the VMNET2 switch 192.168.64.0 Dynamic IP address in the. On Figure 11, switch to the DHCP tab, click Add, select VMnet2 on the Open dialog box, and then click OK to return to the DHCP tab of the Virtual Network Editor dialog box, on which you click Apply, 13, VMnet2 and the subnets we set up for VMnet2 are added to the DHCP service list.

Add complete

⒏ in the same way, specify a subnet for the switch VMnet3, such as "192.168.65.0", and add it to the list of DHCP services.

⒐ Next, open each virtual machine in turn, and then install the operating system for the virtual machine.

⒑ the next job is to configure network support for each virtual machine's operating system, let's first configure the first virtual machine. The first Ethernet adapter for the first virtual machine uses the bridge network type, and then installs a PPPoE virtual dialer for it (the windowsxp comes with the PPPoE protocol, and if your virtual machine has the operating system installed, you can use no additional PPPoE virtual dialer.

In addition, if you are on a dedicated line and do not require a PPPoE virtual dialer to dial, if the virtual machine obtains its IP address from a DHCP server on the external network, then leave the default setting double-click the virtual dial-up connection that the virtual machine should be able to access the Internet.

⒒ for the second virtual Ethernet adapter in the first virtual machine, manually specify an IP address in the subnet specified for VMnet2, or leave the default setting to have the VMware Workstation's own DHCP service automatically assign it a dynamic IP address in a VMnet2 subnet.

⒓ in the second virtual machine, either manually assign an IP address to the subnet specified for VMnet2, or leave the default setting so that the VMware Workstation's own DHCP service automatically assigns it a dynamic IP address in a VMnet2 subnet.

⒔ in a third virtual machine, two Ethernet adapters are connected to switch VMnet2 and VMnet3 respectively. For each virtual Ethernet adapter, we can manually assign them a fixed IP address in the specified subnet of the switch to which it is connected, or let Vmwareworkstation's own DHCP service automatically assign them a dynamic IP address in the specified subnet of the switch to which they are connected.

Here we give an example, if this virtual machine is installed Windows 98, after launching it, on its desktop right-click on the Network Place icon opens the Networking dialog box, 14, first select the first Ethernet adapter bound TCP/IP, and then click Properties to open the TCP/IP Properties dialog box.


Agreement

15, select the "Specify IP Address" radio box, in the "IP Address" field, enter the VMnet2 subnet can be manually assigned (for the same subnet IP address, in order to prevent the same IP address assigned to two or more virtual machines, vmwareworkstation Manually assigned and automatically assigned IP addresses use different parts of this subnet) an IP address, such as "192.168.64.5", the subnet mask input "255.255.255.0", and finally click OK.

Specify IP

In this way, the IP address of the first Ethernet adapter is fixed by us as "192.168.64.5". Next, on the Network dialog box, select TCP/IP for the second Ethernet adapter binding, click Properties to open the TCP/IP Properties dialog box for the second Ethernet adapter, and still select the "Specify the IPs" Radio box, in the "IP address" In the column, enter an IP address that can be manually assigned in the VMNET3 subnet, such as "192.168.65.8" and after clicking "OK", we will specify an IP address for the two Ethernet adapters on the third virtual machine.

If you find it troublesome to assign IP addresses in this way, when you set the IP addresses of the two Ethernet adapters, select the "Get IP address automatically" box on the TCP/IP Properties dialog box for their bound The vmwareworkstation's own DHCP service automatically assigns IP addresses to both Ethernet adapters in the respective subnets of VMnet2 and VMnet3.

⒕ in the fourth virtual machine, manually assign an IP address to the subnet specified for VMnet3, or leave the default setting to have the VMware Workstation's own DHCP service automatically assign it a dynamic IP address in a VMnet3 subnet.

⒖ through the above steps, the formation of our custom virtual network is basically completed, and then the next task is to install the required application software for each virtual machine.

Detailed VMware Network settings

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.