Linux virtual machine LAN Adapter configuration

Source: Internet
Author: User

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

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.