Three Network modes of Vmware

Source: Internet
Author: User

Many of my friends use VMware to test different systems. I will talk about my understanding of network settings based on my own experience. please correct me if it is not correct.
Bridge: This method is the simplest. 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.
Nat mode: In this mode, a virtual Nic vmnet8 (by default) appears inside the host. If you have experience as a NAT server, the vmnet8 here is equivalent to the NIC 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.
Hostonly:
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, virtual machines connected to vmnet8 can still be configured as 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.
1. Bridge Mode (everything is the same as host, only the IP address 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, 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 in production 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 192.168.255.1 is entered, it cannot be connected to the Internet. It can be kept here. In short, it cannot be written to an incorrect address.
3. hostonly Mode
(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
==================================
(1) bridged Mode
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 an independent machine in the network and 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, mutual access to the local system is not
Problem.
(2) Nat
This method can also achieve two-way access between the local system and the virtual system, but other machines in the network cannot access the virtual system. The virtual system can access other machines in the network through the local system using the NAT protocol.
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.
(3) Host-only mode
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.
(4) not use method
The Virtual System is a single machine.
In general, the bridged method is the most convenient and easy to use. however, if the local system is Win2000 and the network cable is not plugged in (or there is no nic at all), the Network is likely to be unavailable (most of the machines with PCI Nic ), in this case, you can only use the NAT mode or host-only. The two virtual NICs mentioned previously are prepared to adapt to the two network types.

Three Network Connection instances of Vmware
VMware has three Network Connection Methods: bridge, Nat, host-only. I spent a lot of time studying the three connections and wrote the research results into this bokee.
Three Terms: Use of VMware, basic computer knowledge and other basic knowledge, please read the book, here no longer explain.
Instance 1
The Bridge Connection VM can communicate with the host machine, and the host machine may conflict with the host machine's local area network (LAN) with the IP address on the Internet, such as www.baidu.com.
Host:
IP: 192.168.10.153
Submask: 255.255.255.0
Gateway: 192.168.10.1
DNS: 192.168.10.7
Vmnet1 Nic host-only
IP: 192.168.0.111
Submask: 255.255.255.0
Gateway: 192.168.0.111 or null
DNS: NULL
Vmnet8 Nic Nat
IP: 192.168.100.1
Submask: 255.255.255.0
Gateway: 192.168.100.2 or null
DNS: NULL
Virtual Machine:
IP: 192.168.10.154
Submask: 255.255.255.0
Gateway: 192.168.10.1
DNS: 192.168.10.7
Instance 2
The Nat connection VM can communicate with the host machine, but can communicate with the host machine on the Internet, such as www.baidu.com. (Vmnet8)
Host:
IP: 192.168.10.153
Submask: 255.255.255.0
Gateway: 192.168.10.1
DNS: 192.168.10.7
Vmnet1 Nic host-only
IP: 192.168.0.111
Submask: 255.255.255.0
Gateway: 192.168.0.111 or null
DNS: NULL
Vmnet8 Nic Nat
IP: 192.168.100.1
Submask: 255.255.255.0
Gateway: 192.168.100.2 or null
DNS: NULL
Virtual Machine:
IP: 192.168.100.3
Submask: 255.255.255.0
Gateway: 192.168.100.2 important !!! (NAT Gateway in VMware)
DNS: 192.168.10.7 (host DNS)
Instance 3
Host-only connects to the VM and can only communicate with the host, shielding the internet. (Vmnet1)
Host:
IP: 192.168.10.153
Submask: 255.255.255.0
Gateway: 192.168.10.1
DNS: 192.168.10.7
Vmnet1 Nic host-only
IP: 192.168.0.111
Submask: 255.255.255.0
Gateway: 192.168.0.111 or null
DNS: NULL
Vmnet8 Nic Nat
IP: 192.168.100.1
Submask: 255.255.255.0
Gateway: 192.168.100.2 or null
DNS: NULL
Virtual Machine:
IP: 192.168.0.113
Submask: 255.255.255.0
Gateway: null or 192.168.0.111 (vmnet1 address)
DNS: null or 192.168.10.7 (host DNS)

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.