Chinaunix首页 | 论坛 | 博客
  • 博客访问: 680411
  • 博文数量: 291
  • 博客积分: 10025
  • 博客等级: 上将
  • 技术积分: 2400
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-04 12:04
文章分类

全部博文(291)

文章存档

2008年(102)

2007年(112)

2006年(75)

2004年(2)

我的朋友

分类:

2007-03-29 14:52:48

Let’s say that you want to do some testing of network applications using VMware. This is the perfect use for a VMware’s virtualization technology. By default, most people connect their virtual machines to the bridged (VMnet0) network. This is great for connecting to the Internet and downloading patches or registering the OS. However, once you have done that, many times, you want to connect two or more virtual machines together to create a private network lab environment. Let’s talk about how to do that.

Before we talk about changing the network of a virtual host, let’s learn about the different VMware networks that are available. By default there are three virtual networks created on a VMware server. They are:


VMnet0 – Bridged
VMnet1 – Host-only
VMnet8 – NAT

To configure VMware networks, inside the VMware server management interface, go to Host à Virtual Network Settings, like this:

Once inside the virtual network settings, you will see a summary of the virtual networks, like this:

Here you can see the three different virtual networks that I talked about above.

Inside this Virtual Network Editor, as it is called, is where you make all VMware network changes. The configuration of these virtual networks and how they match up with the virtual machines can get complex.

Now that we know what virtual networks are available, let’s talk about how to change from the bridged (VMnet0) network to a network that can be shared by our two lab machines.

Changing the Network on a VM

We want to modify our two Windows XP machines to be on the same private host network so that we can have a virtual lab environment. Keep in mind that we still want to use DHCP for host IP address assignment. Fortunately, VMware offers a built in DHCP server to assign IP addresses to these virtual machines who will now be on their own network. This DHCP server is enabled by default and, once the virtual machines are on the proper VMnet, the DHCP server will provide them an IP address.

To change from the bridged (VMnet0) network to the host-only (VMnet1) network, first, make sure that both machines are powered off. You cannot modify the network configuration if they are started or suspended.

Next, double-click on the Ethernet adaptor in each machine. Currently, you should see that it is set to Bridged.

You will now have the network adaptor configuration window below. Click on the Host-only adaptor.

Now click OK to save these changes.

Next, power on both machines. Once booted, both these machines should only be able to communicate with one another and only each other. No other machines on your internal network or any other virtual machines should be able to communicate with these virtual machines (unless their network adaptor is also set to VMnet1/Host-only). You can verify this by opening up the CMD prompt on both machines and running IPCONFIG /ALL. You should see something like this:

(IPCONFIG output from Machine 1)

(IPCONFIG and ping output from Machine 2)

Notice in the output above how each machine has an IP address on the same network. Machine 1 is 192.168.1.129. Machine 2 is 192.168.1.128. These IP addresses were assigned by the DHCP server at 192.168.1.254. That is actually the VMware built-in DHCP server for the VMnet1 network.

On the output from Machine 2, notice that I was able to ping 192.168.1.129 successfully. This shows that I can ping Machine 1 in my net lab network.

阅读(540) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~