Virtual machine Ubuntu Internet configuration process

Source: Internet
Author: User
Tags virtual environment

Recently started to play Linux, installed on the virtual machine Ubuntu, but has not been on the net, puzzled for a long time, today finally finished.

First of all, the three network modes of virtual machines:VMWareProvides three modes of operation, which areBridged (bridge mode ),NAT (network address translation mode ), and host-only (host mode) . LBridged (bridging mode )

In this mode, theVMware virtual operating system is like a separate host in the LAN, which can access any machine in the network. In bridging mode, you need to manually configure the virtual system with an IP address, subnet mask, and a host machine in the same network segment so that the virtual system can communicate with the host machine. At the same time, because this virtual system is a separate host system in the LAN, it is possible to manually configure its TCP/IP configuration information to enable access to the Internet through a LAN gateway or router. The relationship between a virtual system using bridging mode and a host machine is like two computers connected to the same hub. To make them communicate with each other, you need to configure the IP address and subnet mask for the virtual system, or you will not be able to communicate. If you want to use vmware to create a new virtual server within the LAN, to provide network services for LAN users, you should choose Bridging mode

Lhost-only (host mode )

In some special network debugging environments, it is required to isolate the real environment from the virtual environment, then you can use the host-only mode. In host-only mode, all virtual systems can communicate with each other, but virtual systems and real networks are isolated. Note : In host-only mode, the virtual system and the host machine system can communicate with each other, which is equivalent to the two machines connected by twisted pair wires. In host-only mode, the TCP/IP configuration information (such as IP address, gateway address,DNS server, etc.) of the virtual system is provided by the VMnet1 (host-only) virtual network DHCP server to dynamically allocate. If you want to use vmware to create a virtual system that is isolated from other machines in the network, you can choose Host-only mode for some special network debugging work .

LNAT (Network address translation mode )

Using NAT mode, the virtual system uses the NAT (Network address translation ) function to access the public network through the network where the host machine resides. In other words, the use of NAT mode enables access to the Internet in virtual systems. The TCP/IP configuration information for a virtual system in NAT mode is provided by the DHCP server of the VMNET8 (NAT) virtual network and cannot be modified manually, so the virtual system cannot communicate with other real hosts on the local area network. the biggest advantage of using NAT mode is that virtual system access to the Internet is very simple, you do not need to do any other configuration, only the host machine can access the Internet. If you want to use vmware to install a new virtual system, you can directly access the Internet without any manual configuration in the virtual system, it is recommended that you use NAT mode.

Bridging mode I've been doing this for a long time, in fact it's very simple, in bridging mode the host and virtual machine are equivalent to parallel operation, and are two independent machines in the LAN. But because of our school Sisu network need to use account, so host and virtual machine at the same time Sisu network need to have two accounts, depressed, only on campus network---

I've tried NAT mode, but I haven't figured it out yet, and today I finally got it.

Virtual Machine Linux under the NAT Internet mode is not the same as Windows, the Windows system as long as the direct selection of NAT Internet access, no additional configuration, and Linux to use the NAT way to the Internet need to make additional settings.

1. The VMware Network connection chooses the NAT mode.

2. See the Vmnet8,nat gateway configured as 192.168.x.2 in the NAT entry in the VMware Network configuration.

3, in Windows, see any network connection, you should find in addition to the original network card, there are more Vmnet1 and Vmnet8. Vmnet1 is the interface of Hostonly, and VMNET8 is the network interface of the NAT that we are going to use.

4, on the Windows host with ipconfig view VMnet8 IP address, is generally 192.168.x.1. At this time VMNET8 configuration should be automatic acquisition of IP, now to static IP, and this IP directly into the VMNET8, no gateway.

6, under the Linux network card IP configuration and VMnet8 a network segment of IP (192.168.x.z/255.255.255.0)

7, in Linux under the gateway configured to just look at the ip192.168.x.2 can.

8. DNS and Windows host are the same under Linux.

9. Run Command service network Restart under Linux to restart the Linux Web service.

One, configure IP

Ubuntu's network configuration information is placed in the/etc/network/interfaces,

(sudo gedit/etc/network/interfaces)

If the configuration dynamically obtains the IP, add the following to the above file:

Auto Eth0

Iface eth0 inet DHCP

If you configure a static IP, add the following:

Auto Eth0

Iface eth0 inet Static

Address 192.168.33.201

Netmask 255.255.255.0

Gateway 192.168.33.1 (Add the content directly to the newly opened file and save the exit)

If the configuration is active, you need to restart the NIC:

Ifconfig eth0 Down

Ifconfig eth0 up

Not root, add sudo to the front of the command

Then use the Ifconfig command to see if the IP is configured successfully, as shown in the results of the successful configuration:

Configuration is successful, you can see the configured IP information

If there is no successful configuration, you need to restart the network service

/etc/init.d/networking restart

Second, configure the DNS server

Ubuntu DNS server information, placed in the/etc/resolv.conf,

Add a DNS server address, such as 202.112.125.53, in the file above

nameserver 202.112.125.53 (Add the content directly to the newly opened file and save the exit)

Summary:

As long as the above steps are configured, you will be able to surf the internet, if not yet restart the machine to try.

Virtual machine Ubuntu Internet configuration process

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.