1: Configure virtual machines
1-1: Open: Virtual Machine editor
Select the bridging mode under Vmnet information and select your network card in the Bridge to drop down list.
2: Find the Device Management interface, click on "Network Adapter", click on the right side of the bridge mode. "Replication Physical network connection status" can be selected.
3: Enter virtual machine to find the virtual machine NIC configuration file and modify it with vim command
Path: path is:/etc/sysconfig/network-scripts/
Configuration file is: Ifcfg-eth0
Configuration content:
Device= "Eth0" #网卡名
Hwaddr= "00:0c:29:3c:29:57" #MAC address (MAC address with system default)
Nm_controlled=yes #NM_CONTROLLED是network Manger parameters, real-time effective, no need to restart the network card after modification immediately effective.
Onboot=yes #激活网卡
Type= "Ethernet" # Network card type
Uuid= "9c2d542b-206f-4805-94c9-38ad1f67e792" #网卡设备id (this value is also used by the system default)
Bootproto=static/none #如果是局域网上网就选这个, and then configure the LAN network card, if it is directly connected to the set value is: BOOTP/DHCP, after you do not have to set the
ipaddr=192.168.120.248 IP Address
netmask=255.255.255.0 Subnet Mask
gateway=192.168.120.1 Network Management
dns1=114.114.114.114 DNS Address (blue callout part needs to be modified by itself)
4: After the modification is complete, run the command: Service network restart
If you find that you can ping the local area network IP but can not ping the domain name, it may be the problem of DNS, you can try to run this command:
Echo ' nameserver 168.95.1.1 ' >>/etc/resolv.conf
Linux virtual machine LAN Adapter configuration