Fedora 19 configure the bridge network of the KVM Virtual Machine

Source: Internet
Author: User

This article describes how to configure a bridge network under Fedora 19 to allow other machines in the LAN to access virtual machines in KVM. Note: Fedora 19 is the operating system of the host machine.

Start now!
To put it simply, follow these steps.
Disable SELinux (refer to the suggestions in the source. I do not recommend disabling SELinux here)
I have mentioned the installation and configuration of the virtual server KVM. I will not talk about it here (find the Fedora label ).
Disable NetworkManager to manage the network. Use the original network script to manage the network.
Apply the bridge network in KVM.
The following describes how to configure the bridging network in step 3.
Run ifconfig on the terminal to check the name of the network port you want to bridge (usually eth0 or em0). Here is p33p1!
Run in sequence under the terminal,
Su-c 'systemctl disable NetworkManager. Service'
Su-c 'systemctl enable network. Service'
Su-c 'systemctl stop NetworkManager. Service'
Check whether the DNS server in/etc/resolv. conf is correct. If nameserver is missing, run system-config-network to configure it. Then edit the file/etc/sysconfig/network-scripts/ifcfg-p33p1 (ifcfg-followed by your network port name) and paste my example for your reference.

View sourceprint? # Cat/etc/sysconfig/network-scripts/ifcfg-p33p1
NM_CONTROLLED = "no"
BOOTPROTO = none
DEVICE = "p33p1"
ONBOOT = "yes"
TYPE = Ethernet
DEFROUTE = yes
20174_failure_fatal = yes
IPV6INIT = no
NAME = Ethernet
HWADDR = 20: cf: 30: ac: c8: 2b
PREFIX0 = 24
BRIDGE = br0
USERCTL = no

Then create and edit the/etc/sysconfig/network-scripts/ifcfg-br0 file with the following content,

View sourceprint? [Root @ localhost ~] # Cat/etc/sysconfig/network-scripts/ifcfg-br0
DEVICE = br0
TYPE = Bridge
BOOTPROTO = dhcp
ONBOOT = yes

Please modify the specific values according to your actual situation. Based on my personal experience, delete unnecessary files starting with ifcfg in/etc/sysconfig/network-scripts/(mainly those connected by wireless networks, you can avoid errors in restarting the network through systemctl.
After the configuration is complete, restart Fedora and run ifconfig on the terminal to check whether the output is correct. My output is as follows.
[Root @ localhost ~] # Ifconfig
Br0: flags = 4163 <UP, BROADCAST, RUNNING, MULTICAST> mtu 1500
Inet 192.168.1.102 netmask 255.255.255.0 broadcast 192.168.1.255
Inet6 fe80: 22cf: 30ff: feac: c82b prefixlen 64 scopeid 0x20 <link>
Ether 20: cf: 30: ac: c8: 2b txqueuelen 0 (Ethernet)
RX packets 75070 bytes 108005211 (103.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 50912 bytes 4021320 (3.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Lo: flags = 73 <UP, LOOPBACK, RUNNING> mtu 65536
Inet 127.0.0.1 netmask 255.0.0.0
Inet6: 1 prefixlen 128 scopeid 0x10 Loop txqueuelen 0 (Local Loopback)
RX packets 38492 bytes 8994529 (8.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 38492 bytes 8994529 (8.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

P33p1: flags = 4163 <UP, BROADCAST, RUNNING, MULTICAST> mtu 1500
Ether 20: cf: 30: ac: c8: 2b txqueuelen 1000 (Ethernet)
RX packets 185871 bytes 264517286 (252.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 132653 bytes 10686277 (10.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 1 collisions 0

Virbr0: flags = 4163 <UP, BROADCAST, RUNNING, MULTICAST> mtu 1500
Inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
Ether 52: 54: 00: af: e1: da txqueuelen 0 (Ethernet)
RX packets 45 bytes 5220 (5.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 13 bytes 2649 (2.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

If so, the configuration of the bridge network is complete. Modify the network interface configuration of the KVM Virtual Machine and change Source deviec to the host bridging network, as shown in.

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.