Differences in three ways of surfing the Internet under vmwarevm

Source: Internet
Author: User


Differences between the three Internet Access Modes in vmwarevm: bridged, host-only, nat ① In this mode: www.2cto.com, A virtual machine is equivalent to a physical host in the network. You can manually set the IP address, subnet mask, and DNS, And the IP address must be in the same network segment as the host's IP address. In this way, the VM and the host are connected to two computers on the same HUB. As long as the host can access the Internet, the VM will also access the Internet in this mode. I entered linux and ifconfig found that only lo didn't have eth0 into/etc/sysconfig/network-scripts/to see if there is a ifcfg-eth0 file, for its vim/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE = eth0 # physical device name IPADDR = 192.168.1.10 # IP address NETMASK = 255.255.255.0 # mask value NETWORK = 192.168.1.0 # network address (optional)) BROADCAST = 192.168.1.255 # BROADCAST address (optional) GATEWAY = 192.168.1.1 # GATEWAY address ONBOOT = yes # [yes | no] (whether to activate the device during boot) USERCTL = no # [yes | no] (whether non-root users can control the device) BOOTPROTO = static # [none | static | boo Tp | dhcp] (no protocol used during boot | static allocation | BOOTP protocol | DHCP protocol) modify as needed, for example, modify DEVICE = eth0 # physical DEVICE name NETMASK = 255.255.255.0 # mask value GATEWAY = 192.168.1.1 # GATEWAY address ONBOOT = yes # [yes | no] (whether to activate the DEVICE during boot ).) BOOTPROTO = dhcp, service network restart the network service. Continue ifconfig. If you haven't run the eth0 command, it still works: ifconfig eth0 up to view your own IP address, and you will find that the virtual machine assigns you an IP address, you can PING your host on the same LAN, including other real hosts on the LAN. However, it is really different to ping the host. In this case, the windows Firewall is disabled, ping again to find that the connection is successful. In this case, you can Ping www.baidu.com and communicate with the Internet. ② In host-only mode, all virtual systems can communicate with each other, but the virtual system and the real network are isolated. Tip: in host-only mode, the virtual system and the host machine system can communicate with each other, equivalent to the two machines connected through twisted pair wires. The virtual network is interconnected and does not communicate with other non-host computers. In host-only mode, the TCP/IP configuration information of the virtual system (such as the IP address, gateway address, and DNS server) is) DHCP servers in the virtual network are dynamically allocated. However, if you manually set the virtual machine in the same network segment as the host machine, you can access the Internet. If you want to use VMWare to create a virtual system isolated from other machines in the network and perform some special network debugging, you can select the host-only mode. Before testing, you need to start the vmnet1 virtual network card and switch to this connection, service network restart network service check the vmnet1 IP address on the host machine. For example, if my IP address is 192.168.111.1, set the eth0 IP address to 192.168.111.xxx in linux and the host machine can be in the same network segment, check if the two can be pinged. ping www.baidu.com cannot communicate with the Internet. ③ Nat (network address translation mode) enables the virtual system to use the NAT (Network Address Translation) function to access the public network through the network of the host machine. That is to say, you can use the NAT mode to access the Internet in a virtual system. Make sure that the vmnet 8 Nic is in the starting status. Switch the network connection mode of vmware to nat ifconfig and find that the IP address has been allocated. In this case, Ping www.baidu.com but the host machine does not suffer. In NAT mode, the TCP/IP configuration information of the virtual system is provided by the DHCP server of the VMnet8 (NAT) Virtual Network and cannot be modified manually, therefore, the virtual system cannot communicate with other real hosts in the local area network. The biggest advantage of using the NAT mode is that it is very easy for the virtual system to access the Internet. You do not need to configure any other configurations, but only need the host machine to access the Internet. Three network connection settings for vmware: 1. bridge: by default, vmnet0 is used to set the virtual machine's ip address to 192.168.2.46 and the virtual machine ip address to 192.168.2.254. Netmask, broadcast, gateway, and dns are all the same as the host to implement Internet communication between Vm instances. 2. nat: vmnet8 DHCP is used by default. DHCP is used by default. As long as the physical function is connected to the network, the virtual machine can be connected.
Manual setting: (this is very important. You need to open the vmnet8 attribute under the Network attribute of the physical machine to view its default address. But do not change it.) set the IP address to the same network segment as vmnet8. set the gateway to the gateway (xxx. xxx. in xxx.2), you can find the vmnet8 gateway, usually edit-> virtual network setting-> Host Virtual Network Mapping, find VMNET8, click the icon on the left arrow, and select NAT, you can see that Gateway netmask, broadcast is set the same as vmnet8, and dns is set the same as host. (DNS saving is also acceptable. It will automatically let the Gateway Switch to the DNS.) For example, vmnet8 ip: 192.168.187.1 gw: 192.168.187.1.2 is the default of the system and cannot be changed. Virtual Machine Settings: ip: 192.168.187.254 gw: 192.168.187.1.2 dns is empty) or: 202.102.224.68 (in fact, you can think about it. In fact, this setting is the same as DHCP allocation, and there is nothing special, it also seems meaningless)
3. host-only: vmnet1 DHCP is used by default. By default, DHCP is used to form an independent virtual network isolated from the physical network, but one thing is that it can communicate with the host machine. Of course, you can manually specify the IP address, but you must select the IP address of VMNET1 as the network header.
 

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.