Add a bridge Nic for kvm in linux

Source: Internet
Author: User
Adding a bridge Nic to kvm in linux vmware is a virtual machine used in windows. after installation, vmnet0, vmnet1, and vmnet8 are automatically added to the system, corresponding to the bridge, respectively, host-only, nat. Kvm is a virtual machine used in linux... adding a bridge Nic to kvm in linux vmware is a virtual machine used in windows. after installation, vmnet0, vmnet1, and vmnet8 are automatically added to the system, corresponding to the bridge, respectively, host-only, nat.
Kvm is a virtual machine used in linux. by default, only the nat network can be selected when selecting the network for kvm is installed, but the bridge mode cannot be selected because there is no corresponding bridge Nic. To enable kvm to use the bridge network, you need to add the bridge network adapter to the system. The following describes how to add a bridge network adapter: # cd/etc/sysconfig/network-scripts/# cp ifcfg-eth0 ifcfg-eth0.bak # cp ifcfg-eth0 ifcfg-bridge -- prepare to bridge the network adapter eth0 to the bridge network # cat ifcfg-eth0DEVICE = eth0BOOTPROTO = noneHWADDR = 00: 0c: 29: 80: 85: 4aNM_CONTROLLED = noONBOOT = yesTYPE = EthernetUUID = "f977c574-43a0-4e17-93d0-832b4e41f016" IPADDR = 192.168.1.102NETMASK = 255.255.255.020.6init = noUSERCTL = noifcfg-bridge this file is compared to the ifcfg-eth0 for modification, so let's cat it first. Make sure to modify the position # vi ifcfg-bridge DEVICE = bridge -- change the name BOOTPROTO = none # HWADDR = 00: 0c: 29: 80: 85: 4a -- comment or delete this line NM_CONTROLLED = noONBOOT = yesTYPE = Bridge -- modify bridge network type # UUID = "f977c574-43a0-4e17-93d0-832b4e41f016" -- comment or delete this line IPADDR = 192.168.1.102NETMASK = 255.255.255.01166init = noUSERCTL = no .. ........................................ .......... # vi ifcfg-eth0DEVICE = eth0BOOTPROTO = noneHWADDR = 00: 0c: 29: 80: 85: 4aNM_CONTROLLED = yesONBOOT = yesTYPE = EthernetUUID = "f977c574-43a0-4e17-93d0-832b4e41f016" IPADDR = 192.168.1.102NETMASK = 255.255.255.04256init = noUSERCTL = noBRIDGE = bridge -- add this line # sevice network restart # ip a 1: lo: Mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00: 00: 00: 00: 00: 00 brd 00: 00: 00: 00: 00: 00 inet 127.0.0.1/8 scope host lo inet6: 1/128 scope host valid_lft forever preferred_lft forever2: eth0: Mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00: 0c: 29: 80: 85: 4a brd ff: ff inet6 fe80: 20c: 29ff: fe80: 854a/64 scope link valid_lft forever preferred_lft forever3: bridge: Mtu 1500 qdisc noqueue state UNKNOWN link/ether 00: 0c: 29: 80: 85: 4a brd ff: ff inet 192.168.1.102/24 brd 192.168.1.255 scope global bridge inet6 fe80: 20c: 29ff: fe80: 854a/64 scope link valid_lft forever preferred_lft forever birdge network added in linux, when installing kvm, you can select the bridge network to set up a LAN.
 
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.