Linux virtual machines access the Internet in NAT Mode
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:
| 12345 |
IPADDR=192.168.200.5 // The IP address and the VMnet8 IP address are in the same CIDR block.NETMASK=255.255.255.0 // Subnet MaskGATEWAY=192.168.200.2 // Select the 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. |
| 12345678910111213141516171819 |
Nic configuration file /etc/sysconfig/network-scripts/ifcfg-Eth0 content DEVICE=Eth0 device name HWADDR=00:0c:29:ac:95:0cPhysical address of the device NM_CONTROLLED=No. whether to use NetworkManager to manage network interfaces. The default value is yes. ONBOOT=Yes whether to enable the network interface when the system or network service is started. The default value is no. IPADDR=192.168.1.1Define IP addresses NETMASK=255.255.255.0Define Subnet Mask TYPE=The Ethernet network type is Ethernet. BOOTPROTO=How to obtain the none IP Address None does not use any startup Protocol Dhcp uses the dhcp protocol as the startup protocol and obtains the IP address through the dhcp server. Use static IP addresses IPV6INIT=No. IPv6 Configuration supported USERCTL=No. allows normal users to control the network interface GATEWAY=192.168.1.254Default gateway address DNS1=222.222.222.222Specifies the DNS server address that the host can find DNS2=202.99.166.4 DNS3=202.99.160.68 |
This article permanently updates the link address: