Four Virtual Machine Nic modes in VMware

Source: Internet
Author: User

1. Bridge Mode ).

Simple Description:

In this way, the IP address of the virtual system can be set to the same network segment as the local system. The virtual system is equivalent to one in the network. an independent machine is inserted in a hub together with the local machine. Other machines in the network can access the virtual system, and the virtual system can also access other machines in the network, of course, it is not a problem with the two-way access of the local system.

Details:

This method is the easiest. You can directly bridge the virtual network card to a physical network card. It is similar to binding two different addresses to the next network card in Linux. In fact, you can set the network card to the hybrid mode, this allows you to listen on multiple IP addresses.
In this mode, the network card (for example, eth0 in Linux) inside the virtual machine is directly connected to the network where the physical network card is located. It can be imagined that the virtual machine and the host machine are in the same status, the network relationship is equal, and no one is behind it.
This method is easy to use, provided that you can get more than one address. it is not suitable for users who want to conduct various network experiments, because you cannot control the network of the virtual machine and it goes out directly.

Settings:

Everything is the same as host, only the IP address cannot be the same as host

For example, when the network of the virtual machine's host entity machine is disconnected, the virtual machine cannot communicate with the host in the bridging mode. This is host-only. Is it a bit of a feeling? Haha.

To put it a little farther, if you want to use the bridge mode, you can install a virtual network card in the host machine to complete network communication between the virtual machine and the host machine.

 

2. Nat Mode

Simple Description:

This method can also achieve two-way access between the local system and the virtual system. however, other machines in the network cannot access the virtual system. The virtual system can use the NAT protocol to access other machines in the network. nat IP Address Configuration method: the virtual system uses DHCP to automatically obtain the IP address. VMWare services in the local system will assign an IP address to the virtual system. If you want to use a fixed IP Address at each start, set this IP address directly in the virtual system.

Details:
In this way, a virtual Nic vmnet8 (by default) appears inside the host. If you have experience as a NAT server, the vmnet8 here is equivalent to a network adapter connected to the Intranet, the Virtual Machine itself is equivalent to a machine running on the Intranet, and the network adapter (eth0) in the virtual machine is independent of vmnet8.
In this way, the DHCP service provided by VMware is loaded to the vmnet8 interface by default, so that the virtual machine can use the DHCP service. more importantly, VMWare comes with the NAT service, which provides address translation from vmnet8 to the Internet. Therefore, a real Nat server is running, it is only for virtual machines. obviously, this method is suitable if you only have one Internet address.

Settings:

First, check the vmnet8 IP address (e.g. 192.168.255.1) in the host ).
Start VMWare, and click Edit virtual network setting... , The virtual network editor dialog box is displayed;
View the NAT tab and record the NAT gateway IP Address: 192.168.255.2
In config, enter:
IP: 192.168.255.5 (different addresses in the same CIDR block as 192.168.255.1)
Netmask: 255.255.255.0 (same as the password of 192.168.255.1)
Gateway IP: Enter the NAT Gateway 192.168.255.2 in VMware.
Primary nameserver: Enter the same gateway as 192.168.39.252 in the host, so that you can surf the Internet.
If you enter 192.168.255.1, you cannot connect to the Internet.

 

3. hostonly Mode

Simple Description:

As the name suggests, this method only supports Network Communication between virtual machines and hosts. Other machines in the network cannot access the virtual system or other machines.

Details:
This should be the most flexible method. If you are interested, you can conduct various network experiments. the only difference with Nat is that there is no address translation service in this mode. Therefore, by default, virtual machines can only access the host, which is also the name of hostonly. by default, a DHCP service is also loaded to vmnet1. in this way, the VM connected to vmnet8 can still be set to DHCP to facilitate system configuration.
Is there no way to connect to the Internet in this way? Of course not. In fact, this method is more flexible. You can use your own method to achieve the best configuration, for example:
A. Use your own Dhcp Service: First stop the DHCP service provided by VMware to make the DHCP service more unified.
B. Use your own Nat to facilitate the addition of the firewall. There are many Nat methods for Windows host, such as Internet sharing for Windows XP and complex Nat services for Windows Server.
C. Use your own firewall. Because you have full control over vmnet1, you can add (or test) a firewall between the network card of vmnet1 and the Internet.
As you can see from the above, the hostonly mode is similar to the normal Nat server with the entire intranet, so you can easily conduct relevant experiments, such as setting a strong fire prevention.

Settings:

(1) view the attributes of your Nic connected to the Internet, select the "advanced" label, set to allow sharing, and set the allowed network interface to vmnet1
(2) Check the attributes of your vmnet1 instance and the settings of the TCP/IP protocol.
192.168.0.1/255.255.255.0,
(3) The settings in windows are completed and transferred to the virtual machine running Linux. Set your eth0 IP address to static (if no static IP address is selected during installation ).
Press the Red Hat icon-> system settings-> network (or other methods you know)
IP: 192.168.0.2 (or other addresses on this network segment)
Netmask: 255.255.255.0
Default Gateway: 192.168.0.1 (vmnet1 address)
DNS: enter your own DNS (the DNS used in the host)
Save settings. If you have not set the Host Name:
CD/etc/sysconfig
VI Network
Edit hostname
CD/etc
VI hosts
Join:
192.168.0.2 yourhostname
Restart the service
Su
/Sbin/service network restart
(4) test
Gateway: Ping 192.168.0.1
DNS: Ping dnsserver

4. Not use method
The Virtual System is a single machine.

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.