Network configuration for CentOS under VM

Source: Internet
Author: User

There are two main types of network configuration under VMS: Bridge mode and NAT mode:

Personal Understanding:

Bridging mode: Virtual machine system as a stand-alone terminal participating network

Nat Mode: The virtual machine system participates as a sub-terminal of the host network

In the LAN, join us with A and B two PCs under the same router. A and B are on the same LAN, and the IP is 192.168.1.2 and 192.168.1.3 Subnet mask 255.255.255.0, gateway, DNS are 192.168.1.1 (LAN IP for routers)

Now, we're loading VMS on a, virtual boot three centos6.5 called a b C, respectively.

If bridging mode is used, a B c a B is located under the same LAN and can be accessed from each other. A b C can be assigned ip192.168.1.3-5 of three.

If NAT mode is used, then a b c and a B are not on the same LAN a B C is a NAT system within a. The interoperability of data between a B C and a is a local area network. But ABC and b are not interoperable.

The following is a configuration: (The Configuration Utility bridging mode.) The virtual machine system participates as a standalone terminal in the network, using static ip192.168.1.201, if you want to use NAT mode. Then replace the following configuration file gateway and DNS with VMNET8 IP,IP for the same network segment IP vmnetip)

Device= "Eth0"
Bootproto=static #静态分配ip
ipaddr=192.168.1.201 #ip
gateway=192.168.1.1 #网关
netmask=255.255.255.0 #子网掩码
Hwaddr= "00:0c:29:79:f5:af"
Ipv6init= "No"
Nm_controlled= "Yes"
onboot= "Yes"
Type= "Ethernet"
Uuid= "493298e6-6dc4-4e70-a0e3-05d24a31c53f"
dns1=192.168.1.1 #主dns

Related commands:

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Service Network restart

Attention:

The network and network manage are in conflict, so the Restartnetwork service needs to be closed before networkmanage

Permanently closed (restart effective):
Chkconfig NetworkManager off
Close immediately (this entry into force):
Service NetworkManager Stop

Network configuration for CentOS under VM

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.