CentOS 6.7 Configure static IP and build a virtual local area network

Source: Internet
Author: User

first, the preparation of knowledge:

The virtual machine has 3 virtual machine switches installed by default, VMnet0, VMnet1, and VMnet8, and these 3 individual virtual switches function differently, as follows:

1. VMnet0 (default bridged)

In bridging mode, VMware the virtual operating system is like a separate host in the LAN, which can access any machine in the network. You need to manually configure the virtual system with an IP address, subnet mask, and a host machine in the same network segment so that the virtual system can communicate with the host machine. If you want to use VMware to Create a new virtual server within the LAN, to provide network services for LAN users, you should choose bridging mode.

2. VMnet1 (host-only)

in some special network debugging environments, it is required to isolate the real environment from the virtual environment, then you can use host-only mode. In host-only mode, all virtual systems can communicate with each other, but the virtual system and the real network are separated.

3. VMnet8 (NAT, networkaddress translation)

in theNATNetwork, you will use theVMnet8Virtual Switch,Hoston thevmwarenetwork Adapter VMnet8the virtual network card is connected toVMnet8on the switch, come withVPC(VirtualPC) to communicate, butVMware Network Adapter VMnet8the virtual network card is only used for andVMnet8Virtual Switch network segment for communication,It is not forVMnet8the network segment provides routing capabilities in a virtualNATunder the networkVPCis aUsing a virtualNATServer-connectedInternetthe. After using this method,VPCyou can andHostvisited each other,VPCable to connect onInternet.

second, how to view the virtual switch in the host

Open the CMD window in host and view it with Ipconfig, as


This shows the information for the VMNET1 and VMnet8 two virtual switches

Three, start the configuration

1. In the virtual machine-and settings, select the network card, select Eth1

2. CentOS 6.5 default NIC is inactive, run ifconfig to view IP information first

3. If no network card is turned on (not showing eth1 or ethx), only one IO, run ifconfig eth1 up to activate eth0 network card, run ifconfig to see if it is turned on successfully.


4. Here you can set the network card to open automatically, the method is as follows:

A) vi/etc/sysconfig/network-scripts/ifcfg-eth1

b) Find Onboot to modify it to Yes


5. For IP configuration, run Setup at the command line (requires root, switch to root user method: Run the SU command, enter the password)



6. DHCP does not use (no * number), note: Here the IP needs to be with the virtual Machine network card IP in the same network segment, see the method see step two

7. After configuration, go back to the command line, run the service network restart restart the NIC, run ifconfig to see if the IP is configured successfully

8. The IP check that is set on the client ping is able to ping through.


9. Connect to a VPC using putty or Xshell


Iv. End of configuration

Use this method to connect multiple vpcs to the same virtual local area network, Linux small white, welcome everyone to criticize correct!


CentOS 6.7 Configure static IP and build a virtual local area network

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.