"Persistent it male 4th" in VMware Virtual machine 4 in the Internet approach introduction

Source: Internet
Author: User

This paper mainly discusses the network mode of virtual machine in vmwareworkstation and the IP configuration of Linux operating system.

Environment: VMwareworkstation10.0 Centos6.5 operating system.

"Four ways to connect to the network in VMware"

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/87/23/wKiom1fVNBSAa7t7AADBTx9kCPs271.jpg-wh_500x0-wm_3 -wmp_4-s_335924213.jpg "title=" 1.jpg "alt=" Wkiom1fvnbsaa7t7aadbtx9kcps271.jpg-wh_50 "/>

(1)Bridge: This is the simplest way, directly bridge the virtual network card to a physical network card, and Linux next network card, binding two different address similar, in fact, the network card is set to promiscuous mode, so as to achieve the ability to listen to multiple IPs.

In this mode, the inside of the virtual Machine network card (for example, Linux under the eth0) directly connected to the network of physical network card, you can imagine that the virtual machine and host machine in a peer position, the network relationship is equal, no one who is behind the problem.

It's easy to use this way, if you can get more than 1 addresses. For friends who want to do all the networking experiments, because you can't control the virtual machine's network, it goes straight out.

(2)NAT mode : In this way the host has a virtual network card Vmnet8 (by default), if you have the experience of doing a NAT server, where the VMNET8 is equivalent to connecting to the intranet network card, and the virtual machine itself is the equivalent of running the machine on the Internet , the network card within the virtual machine (eth0) is independent of the vmnet8.

You will find that in this way, VMware's own DHCP is loaded into the Vmnet8 interface by default, so that the virtual machine can use the DHCP service. More importantly, VMware comes with a NAT service that provides address translation from Vmnet8 to extranet, so this is a real NAT server running, but for virtual machines. Obviously, if you have only one extranet address, this approach is appropriate.


(3)Host only:

This should be the most flexible way to be interested in a variety of network experiments. The only difference with NAT is that, in this way, there is no address translation service, so by default the virtual machine can only be accessed by the host, which is also the meaning of the hostonly name. By default, a DHCP service is also loaded onto vmnet1. This way the virtual machines connected to the VMNET8 can still be set to DHCP for easy system configuration.

Is this the way there is no way to connect to the external network, of course not, in fact, this way more flexible, you can use your own way, so as to achieve the most ideal configuration, for example:

A. Use your own DHCP service: first stop the VMware-brought DHCP service and make the DHCP service more uniform.

B. Use your own NAT to make it easy to join a firewall. Windows host can do a lot of NAT, simple as a Windows XP Internet share, complex as the NAT service in Windows Server.

C. Use your own firewall. Because you have complete control over the VMNET1, you can join (or experiment) the firewall between the VMNET1 and the extranet's network card.

As can be seen from the above, hostonly this mode is similar to the normal NAT server with the whole intranet, so you can easily carry out experiments related to it, such as fire-proof strong settings.

"Illustrative"

1,bridge mode (everything is the same as host, only IP cannot be the same as host) IP 192.168.39.222 netmask:255.255.252.0 Gateway : 192.168.39.254

Primary nameserve:192.168.39.252

2.NAT Mode

First, view the VMnet8 IP (e.g. 192.168.255.1) in host.

Start VMware, click the virtual network Setting, and pop up the Virtual Network Editor dialog box;

View Nat tab, log the Gateway IP address:192.168.255.2 for NAT

In config, fill in:

ip:192.168.255.5 (different addresses with 192.168.255.1 on the same network segment)

netmask:255.255.255.0 (same as 192.168.255.1 's hidden code)

Gateway IP: Complete the NAT Gateway in VMware 192.168.255.2

Primary nameserver: Fill in the same gateway as the host 192.168.39.252, so you can surf the Internet.

If you fill in the 192.168.255.1, you can not connect to Sisu network. It's not going to stop here, anyway. Wrong address

3.hostonly mode

(1) Check the properties of your network card, select "Advanced" tab, set to allow sharing, and set the allowed network interface to VMNET1

As can be seen from the above, hostonly this mode is similar to the normal NAT server with the whole intranet, so you can easily carry out experiments related to it, such as fire-proof strong settings.

(2) Plug in the properties of your VMnet1 and look at the settings of the TCP/IP protocol, and you find that it has been automatically set to

192.168.0.1/255.255.255.0,

(3) The settings under Windows are completed and transferred to the virtual machine running Linux. Set the IP address of your eth0 to static (if not selected at the time of installation).

Press the Red Hat icon-> System Settings-> Network (or other method you know) ip:192.168.0.2 (or other address on this segment) netmask:255.255.255.0

Default gateway:192.168.0.1 (VMnet1 address) DNS: Enter your own DNS (DNS in host) to save the settings. If you haven't set the host name: Cd/etc/sysconfig VI Network Edit hostname cd/etc VI hosts join:

192.168.0.2 yourhostname Restart service su

/sbin/service Network Restart

(4) test

Gateway: Ping 192.168.0.1 dns:ping dnsserver

Summary

(1) Bridged mode

In this way, the IP of the virtual system can be set to the same network segment as the native system, and the virtual system is equivalent to one within the network. Independent machine, with the machine in a hub, other machines in the network can access the virtual system, virtual system can also access other machines within the network, of course, and the local system of two-way access is .

(2) NAT mode

This method can also realize two-way access to the native system and the virtual system. However, other machines in the network cannot access the virtual system, and the virtual system can access other machines in the network through the NAT protocol of the native system. Nat IP Address configuration method: The virtual system first uses DHCP to obtain the IP address automatically, The VMware services in the native system assign an IP to the virtual system, and then, if you want to use a fixed IP for each boot, set the IP directly in the virtual system.

(3) host-only mode

As the name implies, the network communication between the virtual machine and the host can only be carried out, the virtual system cannot be accessed by other machines in the network, and the virtual system cannot access other machines.

(4) Not use mode

Not using the network, the virtual system is a single machine.

Generally speaking, the bridged mode is the most convenient and easy to use. But if the system is Win2000 and the network cable is not plugged (or there is no network card), the Internet is likely to be unavailable (most of the machines with PCI network cards are so), at this time can only be used NAT or host-only, The two virtual network cards mentioned earlier are intended to accommodate both networks.

Contact QQ1600157341

This article is from the "Persistent It Man" blog, please be sure to keep this source http://it3246.blog.51cto.com/7479386/1851714

"Persistent it male 4th" in VMware Virtual machine 4 in the Internet approach introduction

Related Article

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.