Vmwarevm Internet access configuration

Source: Internet
Author: User


Vmwarevm Internet Configuration vmvm Internet Settings: 1. bridging method: applicable: the host machine accesses the Internet through the LAN, and there are redundant private IP addresses in the LAN to access the Internet, then you can access the internet through bridging. The virtual machine can access each other with the host machine, and the virtual machine can access the internet. Virtual Machine <---> host and Virtual Machine <----> Internet Communication 1. Virtual Machine menu VM --> settings --> hardware --> Network Adapter select Bridged 2. Virtual Machine menu Edit --> Virtual Machine select Automatic bridge to physical Network www.2cto.com in Network Editor --> Automatic Bridging. 3. Set the virtual machine to a static IP address, configure an IP address with the same network segment as the host, set the same mask and gateway, and restart the network. 2. NAT mode: Applicable: No redundant IP addresses can be allocated to virtual machines, A virtual machine can only connect to vmnet8 through a virtual network, which is equivalent to borrowing the IP address of the host machine to access the Internet. 1. VM menu VM --> settings --> hardware --> Network Adapter select NAT 2. VM menu Edit --> Virtual Network Editor --> remove Automatic bridge to physical Network from Automatic Bridging, enable DHCP and NAT respectively. 3. VM must be enabled in the network connection of the host machine. No IP address is required. The default DHCP mode is available, the most important thing is that the two services on your host must be enabled: VMware DHCP Service and VMware NAT Service 4. Set the Virtual Machine Nic to the DHCP mode, and you do not need to configure parameters such as IP addresses to restart the network. You can also manually set the IP address to the same network segment as vmnet8, and the gateway to the gateway of vmnet8 (/etc/vmware/vmnet8/nat. conf) to check the vmnet8 gateway, which is usually xxx. xxx. xxx.2. The netmask and broadcast settings are the same as those of vmnet8, And the dns settings are the same as those of the host. For example: vmnet8: ip: 172.16.249.1 gw: 172.16.249.2 VM settings: ip: 172.16.249.100 gw: 172.16.249.2 www.2cto.com 3. Host-only mode applicable: virtual Machine <---> VM communication uses vmnet1 by default. Set the Virtual Machine ip address to the same network segment as vmnet1 and the gateway to the ip address of vmnet1. the other settings are the same as vmnet1. the dns settings are the same as those of the host. For example: vmnet1 ip: 172.16.245.1 Virtual Machine Settings: ip: 172.16.245.100 gateway: 172.16.245.1 In this mode, the virtual machine and Internet communication settings are as follows: 1. enable Host Routing 2. set iptables to make the host a nat server 3. echo 1>/proc/sys/net/ipv4/ip_forward so that the host has the routing function 4. iptables-t nat-a postrouting-o eth0-s 172.16.245.0/24-j MASQUERADE this rule means that the source ip addresses from 172.16.245.0/24 packets are disguised as eth0 ip addresses, to implement communication between virtual machines and the Internet, if the network interface is ppp + or pppoe, you need to change it to-o pppoe. Of course,-s 172.16.245.0/24 must also modify www.2cto.com's understanding of the three Internet access methods according to the actual situation: 1. in this mode, VMWare virtualizes an operating system like an independent host in the LAN, which can access any machine in the network. In the bridge mode, you need to manually configure the IP address and subnet mask for the virtual system, and also need to be in the same network segment as the host machine, so that the virtual system can communicate with the host machine through www.2cto.com. At the same time, because the virtual system is an independent host system in the LAN, You can manually configure its TCP/IP configuration information to access the Internet through the LAN gateway or router. The relationship between a virtual system in the bridge mode and the host machine is like connecting two computers on the same Hub. If you want them to communicate with each other, You need to configure the IP address and subnet mask for the virtual system. Otherwise, the communication will fail. If you access the Internet through a LAN and the virtual machine uses the bridge connection mode, you only need to set the IP address of the virtual machine to the same network segment as the local machine, and the subnet, gateway, and DNS can be the same as the local machine to access the Internet, you can also access the local area network. If you are using a dial-up Internet connection, virtual machines need to establish broadband connections and dial-up Internet access in the system of the virtual machine, but cannot access the Internet at the same time as the host machine. 2. NAT (network address translation mode) uses the NAT mode to allow the virtual system to access the public network through the network where the host machine is located through the NAT (Network Address Translation) function. That is to say, you can use the NAT mode to access the Internet in a virtual system. 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 in NAT mode cannot communicate with other real hosts in the local LAN. The biggest advantage of using the NAT mode is that it is very simple for a virtual system to access the Internet. You do not need to configure any other configurations. You only need the host machine to access the Internet and the virtual machine to access the Internet. Www.2cto.com 3. host-only (host mode) in some special network debugging environments, you can adopt the host-only mode to isolate the real environment from the virtual environment. In host-only mode, all virtual systems can communicate with each other, but the virtual system and the real network are isolated, and the vmwarevm cannot access the Internet. Tip: in host-only mode, the virtual system and the host machine system can communicate with each other, because the two machines are connected through twisted pair wires. In host-only mode, the TCP/IP configuration information of the virtual system (such as the IP address, gateway address, and DNS server) is created by VMnet1 (host-only) DHCP servers in the virtual network are dynamically allocated. 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.

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.