Use the bridging method on the Virtual Machine for connection details. Virtual Machine details

Source: Internet
Author: User

Use the bridging method on the Virtual Machine for connection details. Virtual Machine details

In Centos, VWware uses the Bridge Mode and static IP addresses access the internet.

1. Set VMware first.

[Edit]-[Virtual Network Editor]

Select the bridge mode, VMnet0, and the network adapter of the physical host. Here, the network adapter I selected is the network adapter on the host.

Note that there are several virtual devices in the VMware network model:

VMnet0: This is the virtual switch used by VMware for virtual Bridging networks;

VMnet1: This is the virtual switch used by VMware in the Virtual Host-Only network;

VMnet8: This is the virtual switch used by VMware for virtual NAT networks;

VMware Network Adapter VMnet1: This is the virtual Nic used by the Host to communicate with the Host-Only virtual Network;

VMware Network Adapter VMnet8: This is the virtual Nic used by the Host to communicate with the NAT virtual Network;

2. Set the virtual machine. Select the bridging mode and copy the physical network connection status (Optional). After the test, the connection to the virtual machine is not affected.

3. Set static IP addresses.

A Virtual Machine configured as a bridge network connection mode is considered as part of the Ethernet of the host. The relationship between the virtual system and the host machine is like connecting two computers on the same Hub, you can access all the shared resources and network connections over Ethernet like a host, and directly share the Internet access lines of the host network to access the Internet. Mutual access between hosts and virtual machines and between virtual machines. The corresponding virtual machine is regarded as an independent physical machine on the Ethernet where the host is located. Each virtual machine uses the default VMnet0 Nic to connect to the host Ethernet, and the virtual network between the virtual machines is VMnet0. At this time, your virtual machine is like an independent physical machine in the LAN. The operating system in the virtual machine can PING other hosts, and other hosts can also PING the virtual machine. If you want them to communicate with each other, You need to configure the IP address and subnet mask for the virtual system. Otherwise, the communication will fail.

(1) Check the IP address of the host before configuration. (Note the NIC address on the Internet and Internet)

(2) set the IP address of the Linux Virtual Machine Based on the IP address of the physical host.

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

TYPE = "Ethernet"

PROXY_METHOD = "none"

BROWSER_ONLY = "no"

BOOTPROTO = "static" # static, static IP address, instead of dhcp, automatically obtains the IP address

DEFROUTE = "yes"

20174_failure_fatal = "no"

IPV6INIT = "yes"

IPV6_AUTOCONF = "yes"

20176_defroute = "yes"

20176_failure_fatal = "no"

20176_addr_gen_mode = "stable-privacy"

NAME = "ens33"

UUID = "0c5f39b7-eb2b-4521-8e8c-020f7e2374de"

DEVICE = "ens33" # Virtual Machine Nic name

ONBOOT = "yes" # enable network configuration at startup

IPADDR = "10.16.0.32" # Set a static IP address, which must be in the same network segment as the physical host, but cannot be the same

PREFIX = "24"

GATEWAY = "10.16.0.1" # Same as physical host

20176_privacy = "no"

(3) restart the network service

Service network restart

(4) In the network configuration file (in fact, this step is not done, network connectivity is also normal, for the sake of rigor, it is added)

Vi/etc/sysconfig/network

(5) test network connectivity.

Virtual Machine 10.16.0.32 (minimum centos7 installation) ping Virtual Machine 10.1631631 (Standard centos installation)

Virtual Machine 10.16.0.32 ping host 10.16.0.18

Virtual Machine 10.16.0.32 ping LAN host 10.16.3.179

Host host 10.16.0.18 ping VM 10.16.0.32

Lan host 10.16.3.179 ping VM 10.16.0.32

Virtual Machine 10.16.0.32 ping Internet site www.baidu.com

(6) If you find that you cannot connect to the Internet, ping: unknown host appears.

The solution is as follows:

First, determine whether the host is connected to the vro and whether the vro can connect to the Internet.

Then, confirm by accessing the gateway. For example, you can ping 10.16.0.1 here.

Set the Domain Name Server and google's public DNS Service

Make sure that the gateway has been set

Grep GATEWAY/etc/sysconfig/network-scripts/ifcfg *

Here, I set 10.16.0.1 to the correct gateway.

If not, you can add a gateway in two ways:

(1) route add default gw 10.16.0.1

(2) manually write the/etc/sysconfig/network-scripts/ifcfg * file and restart the network service servicenetwork restart.

Make sure DNS is available, grep hosts/etc/nsswitch. conf

Finally, test ping-c 5www.baidu.com.

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.