Virtual Machine Linux Internet access

Source: Internet
Author: User

Host XP, virtual machine Linux

I. Nat

 

1. Select NAT (Vm-> setting-> network ADAP...) in the network connection mode of the VM ..)

 

2. view the gateway IP address of the vmnet8 Gateway (edit-> Virtual Network Editor-> net settings) of the virtual machine:

For example, 192.168.197.2

 

3. Set the host's VMware network adapter vmnet8 so that its IP address is 192.168.197.1

 

4. Set the Linux IP address, gateway, and mask on the virtual machine. VI/etc/sysconfig/network-scripts/ifcfg-eth0

 

Device = eth0

Bootproto = static

Onboot = Yes

Gateway = 192.168.197.2

Ipaddr = 192.168.197.9

Netmask = 255.255.255.0

 

5. Set DNS. VI/etc/resolv. conf

Search localdomain

Nameserver 192.168.197.2

 

6. Verify. Ping 192.168.197.1 Ping www.taobao.com

 

 

Ii. Bridge Mode bridged

1. Select bridged (Vm-> setting-> network ADAP...) in the network connection mode of the VM ..)

 

2. Choose Edit> Virtual Network editor --- "vmnet0" from the VMware menu ",
Select a real network adapter for bridging (do not select it automatically)

 

3. Set the Linux IP address on the Virtual Machine. If the local connection of the host is a fixed address, set the IP address of the virtual machine to the same as the local connection.

Network segment. If the local connection of the host is automatically obtained, the eth0 of the VM is also set to automatically obtained:

Device = eth0

Bootproto = DHCP

Onboot = Yes

 

4. Verify. Ping 192.168.197.1 Ping www.taobao.com

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.