Configure static IP addresses for CentOS in bridging mode in VMware
1) set the virtual machine to use the bridge mode.
Open the new virtual machine and click the network adapter. Select the bridge mode.
2) set the working mode of VMware to bridging.
In the VMware menu, choose Edit> Virtual Network editor ]. Select VMnet0. In Bridge Connection mode, the bridge is connected to a wireless network or a local connection. Because I use a notebook and bridge to the wireless network, the bridge is connected to [1X1 11b/g/n Wireless LAN PCI Express half Mini Cart adapter ].
3) query the LAN gateway.
In windows, open cmd. Enter in cmd. Ipconfig/all. You can find the gateway of [1X1 11b/g/n Wireless lan pci Express half Mini Cart adapter. For example, the gateway is 192.168.1.1.
4) configure the Virtual Machine gateway. Open the centos command line.
# Vi/etc/sysconfig/network
5) configure the CentOS static IP address.
Here we assume that the static IP address is 192.168.1.211. Use Google's free dns: 8.8.8.8.
DEVICE = eth0
HWADDR = 00: 0C: 29: CB: 47: 28
TYPE = Ethernet
UUID = ea0bc70a-c20a-4507-b2ed-f9091a160f8c
ONBOOT = yes
NM_CONTROLLED = yes
# BOOTPROTO = dhcp
BOOTPROTO = static
IPADDR = 192.168.1.211
NETMASK = 255.255.255.0
IPV6INIT = no
DNS1 = 8.8.8.8
6) restart the NIC.
# Service network restart
7) check whether the network is normal.
1) can ping the Internet from the VM. (Can I ping www.baidu.com ).
2) Can the local host ping the VM in cmd. (Can ping 192.168.1.211 ).