Detailed CentOS under the VMware bridge mode, static IP network _vmware

Source: Internet
Author: User
Tags centos

VMware in the network settings bridged is also on the Linux under the VMware Bridge mode, static IP network configuration, but at that time more with the graphical interface to achieve, not strong commonality. Production environment, very few Linux installation graphical interface. Simply the original blog also do not modify, a new one got. Here I use the CentOS6.5 minimal system to demonstrate. Currently, because CentOS belongs to the Red Hat series, the approach described in this article is also true for the Linux network configuration of the Redhat series.

One, the bridge mode of VMware settings:

Vmware-> "edit"-> "Virtual network Edit"

Second, the bridge mode of virtual machine settings:

Third, the bridge mode to set the static IP address

A virtual machine configured to bridge network connection mode is used as a part of the host Ethernet, the virtual system and the host machine, like two computers connected to the same hub, that can access all the shared resources and network connections in the Ethernet as a host. Internet access lines that can be directly shared with the host network. Between the host and the virtual machine, as well as between the virtual machines can exchange visits. The corresponding virtual machine is treated as a separate physical machine on the ethernet of the host, the virtual machines are connected with the host Ethernet through the default VMNET0 network card, and the virtual networks between virtual machines are VMnet0. Your virtual machine is like a stand-alone physical machine on a local area network. The operating system in the virtual machine can ping other hosts, and in turn other hosts can ping the virtual machine. To communicate with each other, you need to configure the IP address and subnet mask for the virtual system, otherwise you will not be able to communicate.

So before I configure, I want to look at the physical host's IP address: (I have a physical host with WiFi access card)

1. Ipconfig view the IP address of the physical host (the IP address of the network card used for the extranet)

2. Set the IP address of the Linux virtual machine according to the IP address of the physical host:

Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 #虚拟机网卡名称.
Type=ethernet
Onboot=yes #开机启用网络配置.
Nm_controlled=yes
Bootproto=static #static, static IP, rather than DHCP, automatically gets the IP address.
ipaddr=192.168.31.77 #设置我想用的静态ip地址, and the physical host on the same network segment, but not the same.
netmask=255.255.255.0 #子网掩码, just like the physical host.
getway=192.168.31.1 #和物理主机一样
dns1=8.8.8.8 #DNS, write Google's address on it.
hwaddr=00:0c:29:22:05:4c
Ipv6init=no
Userctl=no

I use the Xshell connected Linux, so it looks more clear:

Restart Network services:

[root@xiaolyu77 ~]# Service Network restart

3. Add the gateway address to the network configuration file/etc/sysconfig/network.

Copy Code code as follows:
[root@xiaolyu77 ~]# vim/etc/sysconfig/networknetworking=yeshostname=xiaolyu77gateway=192.168.31.1 #网关地址, Gateway address to the same physical host

4. Test:

1 Virtual Machine Ping Physical host:

[Root@xiaolyu77 ~]# Ping 192.168.31.160

2 physical host ping virtual machine

C:\users\administrator>ping 192.168.31.77

3 Virtual machine Test external network:

[Root@xiaolyu77 ~]# Ping www.baidu.com

OK, it's done!

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.