Linux virtual machine NAT mode networking

Source: Internet
Author: User
Tags get ip

1, open the Network properties, click Change adapter settings, open the virtual network card VMNET8 properties (note first enabled), open IPV4, manually set the IP address 192.168.4.1 as an example, subnet mask 255.255.255.0; default gateway 192.168.4.2; preferred DNS 192.168.4.2 (same as default gateway), confirm exit; 650) this.width=650; src= http://s3.51cto.com/wyfs02/M00/73/14/ Wkiom1xz6tlxkaldaahjmtmucqy498.jpg "title=" set Virtual NIC Ip,dns "alt=" Wkiom1xz6tlxkaldaahjmtmucqy498.jpg "/>

2, if the real machine with a wireless network, then open the WLAN properties (default is automatically get Ip,dns, do not manually set), turn on sharing options, tick "Allow other network users to connect through this computer's Internet connection", home network connection Select "Ethernet", and then tick " Allow other network users to control or disable the shared Internet connection "to confirm the exit; (the" shared "word after the wireless network name.) (Ethernet-like). _________________________650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/73/14/ Wkiom1xz7q6yep4laadexcyzlha396.jpg "title=" Wireless card sharing Settings "alt=" Wkiom1xz7q6yep4laadexcyzlha396.jpg "/>

3. Open VMware, click Edit, click Virtual Network Editor, check VMnet8 (NAT mode), tick "Connect host virtual adapter to this network", set subnet IP to 192.168.4.0, subnet mask default is 255.255.255.0, confirm exit; 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/14/wKiom1Xz69mT8SoMAAJHLxtyYns373.jpg "title=" Virtual Network Editor Settings " alt= "Wkiom1xz69mt8somaajhlxtyyns373.jpg"/>

4, use VIM to edit the network interface configuration file/etc/sysconfig/network-scripts/ifcfg-eth0, as follows:

Device=eth0 (Network interface name default)

Onboot=yes (network interface activated on Linux system startup)

Bootproto=static (The configuration of the network interface is set to static to indicate that DHCP is used to dynamically obtain an address using statically specified IP addresses)

ipaddr=192.168.4.3 (the IP address of the virtual machine and the virtual network card in the real machine VMnet8 the same network segment)

netmask=255.255.255.0 (Subnet mask)

gateway=192.168.4.2 (the default gateway is the same as the virtual network card)

dns1=192.168.4.2 (DNS1 is the preferred DNS, you can add an alternate dns--dns2) (DNS is the same as the default gateway)

You can use ": wq!" When you set it up. Save exit; 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/11/wKioL1Xz7oTRM2qxAADSrBGgJ6g264.jpg "title=" Edit the network interface configuration file "alt=" Wkiol1xz7otrm2qxaadsrbggj6g264.jpg "/>

5, use "ping www.baidu.com" to detect whether the configuration was successful. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/12/wKioL1Xz8L_wM3zUAAL0c18tE6g893.jpg "title=" Detects if the virtual machine is networked "alt=" Wkiol1xz8l_wm3zuaal0c18te6g893.jpg "/>





This article is from the "Mind Printing Xuan" blog, please be sure to keep this source http://10080392.blog.51cto.com/10070392/1694130

Linux virtual machine NAT mode networking

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.