Linux virtual machines access the Internet in NAT mode.

Source: Internet
Author: User

Linux virtual machines access the Internet in NAT mode.

1. Configure the local VM8 address

2. configure the Virtual Machine nat nic: Set the VM8 NIC address to the same CIDR block as the Linux host, gateway casually set 3, compile the NIC file vim/etc/sysconfig/network-scripts/ifcfg-eth0 main configuration is as follows:
IPADDR = 192.168.200.5 // the IP address and VMnet8 IP address are in the same network segment NETMASK = 255.255.255.0 // subnet mask GATEWAY = 192.168.200.2 // GATEWAY select your GATEWAY address in the WMware network editor DNS1 = 192.168.1.1 // the IP address of the primary DNS server is the real gateway of the host in windows.
Nic configuration file/etc/sysconfig/network-scripts/ifcfg-eth0 content DEVICE = eth0 DEVICE name HWADDR = 00: 0c: 29: ac: 95: the physical address of the 0c device NM_CONTROLLED = no whether to use NetworkManager to manage network interfaces. By default, yesONBOOT = yes enables this network interface when the system or network service starts, by default, noIPADDR = 192.168.1.1 defines the IP address NETMASK = 255.255.255.0 and defines the subnet mask TYPE = Ethernet network TYPE: Ethernet BOOTPROTO = noneIP acquisition method. none. No startup protocol is used. dhcp is used as the startup protocol, obtain the IP address through the dhcp server static use static IP address IPV6INIT = no whether IPv6 Configuration is supported USERCTL = no whether normal users are allowed to control the network interface GATEWAY = 192.168.1.254 default GATEWAY address DNS1 = 222.222.222.222 specify the host DNS server address that can be searched: DNS2 = 202.99.166.4DNS3 = 202.99.160.68

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.