How to configure the network under the "networked" virtual machine under Linux (terminal)

Source: Internet
Author: User

Deploy a CentOS system on virtual machine VMware these days toInternal NetworkingInstall the necessary software with the Yum command, but have not been able to static address networking, today finally found a way to set up the CentOS internal IP, external networking. The setup process is as follows: 1, the first is the network adapter set to NAT;2, then the IP settings, modify the contents of/etc/sysconfig/network-scripts/ifcfg-eth0: device=eth0type= Ethernetonboot=yes #开机自动调用BOOTPROTO =dhcp #动态ip设置, this is the necessary setting for internal internet defroute=yesname= "Eth0" netmask=255.255.255.0ipv4_ failure_fatal=yesipv6init=nouuid=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03dns1=8.8.8.8ipaddr=192.168.37.128prefix= 24gateway=192.168.37.1last_connect=1384407977

3, gateway settings through the virtual machine in the Edit->virtual network Editor->vmnet8->nat settings set to 192.168.37.1 the last restart Networking configuration, service xinetd Restart through ping www.baidu.com test to be able to surf the Internet. Solutions for problems with the CentOS 6.0+ network using VMware Configuration The various problem solutions for the CentOS 6.0+ network using VMware first describes the two types of network connectivity and differences that are commonly used by VMS: in this mode, VMware's virtual operating system is like a standalone host on a LAN that can access any machine in the network. In bridging mode, 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. Also, configure the gateway and DNS addresses to enable access to the Internet through a LAN gateway or router. NAT Network: The use of NAT mode is to let the virtual system with NAT (Network address translation) function, the host machine is located in the network to access the public network. In other words, the use of NAT mode enables access to the Internet in virtual systems. The TCP/IP configuration information for a virtual system in NAT mode is provided by the DHCP server of the VMNET8 (NAT) virtual network and cannot be modified manually, so the virtual system cannot communicate with other real hosts on the local area network. The biggest advantage of using NAT mode is that the virtual system access to the Internet is very simple, only the host machine can access the Internet, you do not need to configure the IP address, subnet mask, gateway, but the DNS address should be filled according to the actual situation. Add a DNS address in addition to the network card properties, you can also add it by tapping the Edit button in the Nat tab in the Virtual network editor in the virtual machine. If you just let the virtual function on the Internet, the two modes can be, with the bridge if you have a legitimate address in the LAN, such as your ADSL cat is the leading way by the function, if it is in the unit, it will be network management to your legitimate IP (now the company is the Mac and IP binding). Now is the host and virtual machine interoperability, if your ADSL led by the function, that shut down the virtual machine DHCP, select Bridge, check whether 2 machine is assigned the same network segment IP, shut down the firewall. Change to your own words is:A bridge is a virtual machine that is the equivalent of a separate computer with its own IP address. NAT is the IP of the shared host machine to access the network, which is accessible to the primary host computer for access to the network. 2, the first installation of CentOS configuration Network A, the use of bridging to connect the network (suitable for routing, switch users), configure static IP to achieve Internet access, LAN communication Vim/etc/sysconfig/network-scripts/ifcfg-eth0 device= "Eth0" Bootproto=none hwaddr= "00:23:54:de:01:69" onboot= "yes" type= "Ethernet" Userctl=no Ipv6init=no peerdns=yes netmask=255.255.255.0 ipaddr=192.168.1.110 gateway=192.168.1.1 DN s1=8.8.8.8 HWADDR, IPAddr, GATEWAY, DNS1 the actual configuration also needs to be configured according to its own network environment 2, clone clones a system configuration network environment cloning as the name implies is to copy an identical system from the original system, But we want to make the clone system connected to the Internet, we need to make some adjustments to the network environment when we have service network restart error message bringing up interface Eth0:device eth0 does not seem t o be present,delaying initialization. [Failed]vim/etc/udev/rules.d/70-persistent-net.rules record eth1 MAC address # PCI device 0x1022:0x2000 (pcnet32) subsystem== " NET ", action==" Add ", drivers=="? * ", attr{address}==" 00:0c:29:96:50:1e ", attr{type}==" 1 ", kernel==" eth* ", name=" eth0 "

# PCI Device 0x1022:0x2000 (pcnet32) subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:d5:65:00 ", attr{type}==" 1 ", kernel==" eth* ", Name=" eth1 "and then we need to modify the Vim/etc/sysconfig/network-scripts/ifcfg-eth0 to modify the original device eth0 For eth1 and corresponding MAC address device= "eth1" hwaddr= "00:0c:29:d5:65:00" nm_controlled= "yes" onboot= "yes" bootproto= "DHCP" service Network restart

Ping www.baidu.com can ping the instructions already connected to the network

How to configure the network under the "networked" virtual machine under Linux (terminal)

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.