Linux virtual machine Internet __linux

Source: Internet
Author: User

Virtual Machine Linux version: redhat9.0

To sum up: to ensure that the virtual machine system can access the Internet, you must first solve the virtual machine and the real host connection relationship. VMware mainly gives 3 kinds of models, we often have "bridge (bridging)" and

Nat (network address translation) mode. Virtual machine Setup method: Click Virtual machine → set "→" Ethernet, then select the connection mode.
  
  
1.bridge (bridging):
  
The IP address of the virtual Machine network card (local Area Connection) is set to the same IP segment as the real host, and the rest is the same as the host:
  
For example, host IP is 192.168.30.202, set virtual machine IP to 192.168.30.204. Netmask,broadcast,gateway,dns can realize virtual machine <----> host in the same host;

Computer <----> Internet communication.
  
This situation is suitable for LAN, and there is no special restrictions on the use of the situation, but also suitable for the real host or LAN host network sharing. If ADSL single dial-up users use this

mode, to log on to the Internet, first have to disconnect the real host's ADSL connection, and then set up in the virtual machine system ADSL dial-up connection, and the use of ADSL line account and password to log on to the Internet. namely virtual

The machine and the real host can not access the Internet at the same time.
2.nat (Network address translation):


This mode of virtual machine system through the virtual Machine Network special conversion, sharing the real host IP Internet. This method is more suitable for ADSL single dial-up users, real host dial-up Internet, virtual

The machine system can also be connected to the Internet at the same time. It should be noted that the IP address of the virtual machine "Local Area Connection" In this mode uses the "Automatically obtain IP" setting.
  
3.host-only (host only):


This clock can only implement the virtual machine <---> host communication, but the virtual machine <---> The Internet is unable to communicate




How VMware virtual machines go online.
1:nat share the Internet.
First turn on the network connection, disable the VMnet1, enable the local connection and VMNET8, and then dial to realize the sharing of the Internet, it should be noted that at this time the virtual machine IP and host share an IP address. Note: When the above operation is found to be still unable to access the Internet, you should pay attention to the status of the local connection IP access is automatically obtained, such as not to adjust it for automatic acquisition.
2, Virtual machine Bridge connected to the Internet.
The virtual machine is set up to bridge the Internet, and then establish a dial-up to achieve the virtual machine has extranet IP network. The virtual NIC does not need to be set.   Note: If you use a virtual machine bridge to connect to the Internet, then the physical machine will not be able to dial the Internet, only one computer can access the Internet. The steps for NAT are as follows: 1. Set your virtual NIC VMnet8 to automatically obtain IP, automatically obtain DNS server, enable.

2. The "Local connection" of the operating system in your virtual machine is also set to automatically obtain IP, automatically obtain the DNS server, (in the virtual machine, right key "local connection"-double click "Internet protocol", see if it is automatic. Fixed IP is also here to change. )

3. Of course, the Internet mode of the virtual machine selected as Nat slightly.
Right button you want to set the virtual machine select "Settings" (because some more than virtual one), in the "Hardware" selected "Ethernet", the right network connection to nat-OK.

4. Click "Edit" in the menu bar-select "Virtual network Settings", first "automatic bridging" to remove (remove hook),
Select "DHCP" To turn on the DHCP service, click "Start"-apply, and then turn on the "NAT" function in the same way.
Note:
Select the NIC Vmnet8 when NAT is selected

5. The most important thing is that your two services must be turned on: VMware DHCP Service and VMware NAT service several issues about virtual machines using NAT for Internet access:
If this is the case, the virtual machine will still not be able to surf the Internet. I suggest you check out the following areas to ensure that several services for NAT Internet access have been started. The specific operations are as follows:
Start---Settings-control Panel---management tools---services
Ensure that the VMware DHCP service and VMware NAT Service services are started

Many friends, when using VMware Workstation, create a virtual machine that uses NAT, but does not have access to the Internet in a virtual machine, possibly as follows:
1, the host is Windows XP Professional SP2 or Windows Server 2003 SP1, if this is the case, you need to shut down VMnet1, VMnet8 firewall. To do this, right-click the local area Connection select Properties → advanced → settings, click Advanced in the Windows Firewall dialog box and remove the "√" in front of VMnet1 and VMnet8.

2, your host installed rising, jiangmin or Skynet firewall, or other firewall software, these firewall software you did not make the correct configuration, resulting in VMware can not use its built-in NAT function to share the Internet, when the third party firewall software can be closed.

3, you may be in VMnet8 or VMNET1 enabled XP built-in "Internet Connection Sharing", you know, using VMware NAT features, you do not need to enable sharing on the host, because VMware has built-in NAT share. If so, remove the shares and restart the VMware NAT Service (or restart the computer)

4, you may be using the VMware Workstation "green" version or "compact" version. If so, install with a full version. If you need Chinese, you can install Chinese-language patches.

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.