How to make the VMware IP on the same network segment as the native IPoriginal May 08, 2017 17:28:56
First verify that the native IP
You can see the information:
Native ip:192.168.1.162
Gateway: 192.168.1.1
DNS server: 192.168.1.1
There are two types of virtual machine network adapters: VMnet1 and VMnet8.
View Virtual Machine network adapters
To open the virtual Machine Workbench:
Right-click under Target virtual machine, select settings, open the Virtual Machine Settings dialog box, and select network adapter
My computer's virtual machine configuration starts with Nat mode, as shown in
To view the properties of a network adapter, use the VMNET8 network adapter by default:
As can be seen, the virtual machine IP is 192.168.232.1, and our native 192.168.1.162 is not in the same network segment, this is because the virtual machine is located in the network is generally considered local LAN.
PS: Virtual machine IP Supplement: Assume that the virtual machine IP is 192.168.232.1, the virtual machine gateway is generally 192.168.232.2, 192.168.232.255 is generally broadcast IP,
After confirming the IP information of VMware and this machine, the question has not been answered, and we will then formally start the configuration,
Change VMware's network adapter to "Bridging mode"
Then click "OK" to save.
Click on the "Advanced" button, you can see the MAC address of VMware is "00:0c:29:49:40:79", this information is placed first, then the table
Configuring VMware's IP
There is an episode that found a problem in the/etc/sysconfig/network-scripts directory and there is no Ifcfg-eth0 file, only Ifcfg-lo file
Workaround:
Create a Ifcfg-eth0 file
Cd/etc/sysconfig/network-scripts
Touch Ifcfg-eth0
Editing a Ifcfg-eth0 file
Name=eth0 file name
Device=eth0 setting aliases
ipaddr=192.168.1.188 the IP address you want to set
netmask=255.255.255.0 Subnet Mask
network=192.168.1.0 belongs to the network, and IP the same network, the general last one is 0
gateway=192.168.1.1 Gateway
broadcast=192.168.1.255 broadcast address, same network as IP, general last one is 255
Whether the Onboot=yes is activated at startup, yes, or no
Userctl=no whether a non-root user can control the device, yes or no
Bootproto=static network allocation mode, static
Hwaddr=00:0c:29:49:40:79 MAC address, in front of view virtual machine adapter properties, see
After editing: Press ESC and enter ": Wq" after the carriage return to save;
Set dns:vim/etc/resolv.conf
NameServer 192.168.1.1
Restart eth0 at boot:
Vim/etc/rc.d/rc.local
Write: Ifup eth0
Restart Network Service
Service Network restart
Verify
Ping the native ping 192.168.1.162 on the virtual machine
Ping the virtual machine ping 192.168.1.188 on the host
Ping the external network on the virtual machine, such as Ping www.baidu.com
Can ping through, indicating that it has been configured.
Open firewall
(go) How to make the VMware IP on the same network segment as the native IP