Virtual Machine IP Configuration Summary

Source: Internet
Author: User
Tags virtual environment


    • Learning Précis-writers

      • Basic configuration process

      • Configuring IP Manually

      • Recognize network interface Devices

    • Learning doubts

    • After-school real exercise

    • Expand Learning

Learning précis-writers Basic Configuration Process

1. Set the connection mode of the virtual machine's network (bridged (bridge mode), Nat mode, host-only mode)
2. Enter the Linux terminal, run the dhclient command (# #NAT方式与桥接方式使用, and the network environment has a router), automatically obtain the IP address, command after the completion of the use, Ifconfig eth0 View network card information to see if there is access to the IP.
3. If the IP is not available, configure the IP manually, and you can obtain a static setting for the IP address.
4. Setting the static IP; using commandsvim /etc/sysconfig/network-scripts/ifcfg-eth0Edit the configuration file for the NIC

   device=eth0bootproto=nonehwaddr=00:0c:29:33:f7:3aonboot=yesipaddr=192.168.205.3    # #使用dhclient获取的IP地址NETMASK =255.255.255.0gateway=192.168.205.2dns1=192.168.205.1dns2=8.8.8.8 

5. After saving the configuration file, restart the network sysconfig Network Restart , ifconfig eth0 See if the network card information has an IP address.

6. ping 192.168.205.3(你设定的IP) whether to ping the external network.

Configuring IP Manually

1. Bridge Connection mode

  • In this way, the IP of the virtual system can be set to the same network segment as the native system, the virtual system is equivalent to a separate machine within the network, and the local machine is plugged into a switch, the other machines in the network can access the virtual system, the virtual system can also access other machines within the network, and of course, two-way access to the

  • In this mode, the VMware virtual operating system is like a separate host in the LAN, which 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. At the same time, because this virtual system is a separate host system in the LAN, it is possible to manually configure its TCP/IP configuration information to enable access to the Internet through a LAN gateway or router.
    The relationship between a virtual system using bridging mode and a host machine is like two computers connected to the same hub. To make them communicate with each other, you need to configure the IP address and subnet mask for the virtual system, or you will not be able to communicate.
    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.

  • Manual configuration process: Select the IP address that belongs to the same network segment as your real machine's IPs, configure the network card configuration file, restart the net

    onboot=yesnm_controlled=yes#bootproto=dhcpbootproto=staticipaddr=192.168.0.101netmask=255.255.255.0gateway= 192.168.0.1dns1=114.114.114.114dns2=8.8.8.8arpcheck=no  ## determining if ip  address is already in use for device eth0  is the Linux network adapter configuration ARP check caused, turn this off, Error when using 
      • Case:
        ip Address: 192.168.1.10
        subnet mask: 255.255.255.0
        default gateway: 192.168.1.1 (fill in your own network)
        preferred dns:8.8.8.8
        virtual system Local Area Connection settings:
        ip Address: 192.168.1.11
        subnet mask: 255.255.255.0
        preferred dns:8.8.8.8
        So the virtual system is equivalent to a real machine in the network can surf the Internet.

2. Nat Mode Connection

  • This approach also enables two-way access to the native system and the virtual system. But other machines in the network cannot access the virtual system, but the virtual system can access other machines in the network through the NAT protocol of the native system, and can surf the internet like a physical machine.

  • Using NAT mode, the virtual system uses the NAT (network address translation) function to access the public network through the network where the host machine resides. 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 virtual system access to the Internet is very simple, you do not need to do any other configuration, only the host machine can access the Internet.

  • Manual configuration Process
    1. Setting up NAT on a virtual machine
    If you are in the English version of VMware, this setting:
    edit-> Virtual Network setting-> nat-> Vmnet 8 Gateway IP address:192.168.205.2 netmask:255.255.255.0 NAT service:started-> OK

    2. Modify the network card settings for the virtual machine
    Double-click the network Card small icon in the lower right corner of the virtual machine, and the mouse moves past will show "Ethernet: ...",
    Device status both need to be hooked;
    Network connection need to select the last item (custom:specific virtual network) Select Vmnet8 (NAT)
    Last Click OK

    3. To your computer (XP)
    Right-click Network Places and properties, right-click VMware Network Adapter VMnet8, double-click Internet Protocol (TCP/IP), and manually set IP to 192.168.2 05.1 Subnet mask for 255.255.255.0 gateway and DNS are set to 192.168.205.2-> OK, OK

    4. Set up your virtual machine IP (Linux)
    Vim/etc/sysconfig/network-scripts/ifcfg-eth0 content is as follows:
    Device=eth0
    Bootproto=none
    hwaddr=00:0c:29:33:f7:3a
    Onboot=yes
    ipaddr=192.168.205.3
    netmask=255.255.255.0
    gateway=192.168.205.2

    5. Vim/etc/resolv.conf content is as follows:
    Search Localdomain
    NameServer 192.168.205.2

  • Case:
    Modify the virtual network card of the physical host VMware Network Adepter VMnet8, for example, set to 192.168.10.10, the Mask is 255.255.255.0
    virtual system local Connection settings
    Subnet mask: 255.255.255.0
    So the virtual system can be the same as the local host network, the specific gateway based on the actual situation set

3. Host-only mode

  • As the name implies, the network communication between the virtual machine and the host can only be carried out, the virtual system cannot be accessed by other machines in the network, and the virtual system cannot access other machines.

  • In some special network debugging environments, it is required to isolate the real environment from the virtual environment, then you can use the host-only mode. In host-only mode, all virtual systems can communicate with each other, but virtual systems and real networks are isolated.
    Note: In host-only mode, the virtual system and the host machine system can communicate with each other, which is equivalent to the two machines connected by twisted pair wires.

  • Case:
    This approach is set up in the same way as bridge mode, as long as the physical host is set up in the VMware Network Adepter VMnet1 and the virtual system is locally connected in the same network segment.
    Local connection settings for this machine
    IP Address: 192.168.2.10
    Subnet Mask: 255.255.255.0
    Virtual system Local Area Connection settings
    IP Address: 192.168.2.11
    Subnet Mask: 255.255.255.0

recognize network interface devices

VMNET0: Virtual Switch for Virtual Bridge network
VMNET8: Virtual Switch for virtual NAT network

vmware Network Adepter vmnet1:host The virtual network card used to communicate with host-only virtual networks

VMware Network adepter vmnet8:host Virtual network card for communication with NAT virtual networks

Learning Doubts after-school real Exercise Expand Learning
    1. Configure static IP (NAT) for Ubuntu 12.04 under VMware virtual machines

    2. Differentiate three ways to connect virtual machines

    3. Virtual machine networking principle   650) this.width=650; src=" Http://www.apelearn.com/bbs/data/attachment/forum /month_1108/1108221133b69742b651083ba0.jpg "alt=" virtual machine networking Mode principle "style=" padding:0px;margin:0px;border:0px; Vertical-align:middle; "/>


Virtual Machine IP Configuration Summary

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.