Build a Linux virtual LAN Using the NAT form of vmvm

Source: Internet
Author: User

Build a Linux virtual LAN Using the NAT form of vmvm

I. Preface
If you need to build a Linuxr network environment on your machine and prepare three virtual machines, one master and one slave, you are ready to use VM to create three Linux virtual machines. Linux uses CentOS 6.3, use these three virtual machines to build a small Virtual LAN. After the virtual machine is installed, there will be two more NICs (such as 1) in the network connection)



Figure 1
One is VMNet1 (bridging) and VMNet8 (NAT). For details, refer to the relevant information. The Small Lan I set up is connected through NAT.
Ii. Configure the network of VMNet8 and host machine
I work in my notebook, so I use wireless networks to access the Internet. The last one in 1 is wireless network connection 3. Right-click on it-attribute (2)


Figure 2
Select the share tab to enable network sharing... ", In" Home NetWork Connection ", select" VMNet8 (VMware NetWork Adpter ...)", Then confirm, 3


Figure 3
The network configuration of the host is complete.
3. Configure the VM Network
Right-click VMware Network Adapter VMNet 8 in, properties, 4


Figure 4
Double-click (TCP/IPv4), 5


Figure 5
Manual configuration is required here, which is not automatically obtained.
Open VM, edit -- Virtual Network Editor, 6


Figure 6
Click "NAT Settings", 7


Figure 7
Remember the gateway IP address. This gateway is the gateway in the virtual machine.
4. Configure the Virtual Machine Network
In step 2, we have configured the VMNet network and gateway. Now we have configured the network in the virtual machine. The network of the virtual machine must be in the same CIDR block as that of vmnet8.
I select the NAT network adapter, 8


Figure 8
Enter the virtual machine, open the terminal, enter the command: setup, select the network configuration, select the device, my is eth0, enter the device, enter the IP address, gateway, etc., 9


Figure 9
Both the gateway and DNS are configured in the red area. Click OK and return to configure another DNS. According to the information on the Internet, you can access the Internet, but I can't, so I still need to configure the firewall. Similarly, enter the command: setup, enter the firewall configuration, and close the firewall. 10


Figure 10
V. Summary
Now, I can access the Internet, because I am using a desktop, and I can use Firefox browser for hundreds of times.
Appendix
1. If you have changed the network configuration, you must restart the network service. The command is service network restart.
2. If there is no graphic interface, you can use the command to enter the directory/etc/sysconfig/network-scripts, use the command to open the edit ifcfg-eth0 file, enter the following content

 

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.