/etc/sysconfig/network-scripts/
directory).
# chkconfig NetworkManager off # chkconfig network on # service NetworkManager stop # service network start
NM_CONTROLLED=no
" to the ifcfg-*
scripts used in the examples.
Change to the network scripts directory
/etc/sysconfig/network-scripts
directory:
# cd /etc/sysconfig/network-scripts
Modify a network interface to make a bridge
/etc/sysconfig/network-scripts/ifcfg-eth0
is used. This file defines eth0
, the physical network interface which is set as part of a bridge:
DEVICE=eth0 # change the hardware address to match the hardware address your NIC uses HWADDR=00:16:76:D6:C9:45 ONBOOT=yes BRIDGE=br0
MTU
variable to the end of the configuration file.
MTU=9000
Create the bridge script
/etc/sysconfig/network-scripts
directory called ifcfg-br0
or similar. The br0
is the name of the bridge, this can be anything as long as the name of the file is the same as the DEVICE parameter, and that it matches the bridge name used in step 2.
DEVICE=br0 TYPE=Bridge BOOTPROTO=dhcp ONBOOT=yes DELAY=0
TYPE=Bridge
, is case-sensitive. It must have uppercase 'B' and lower case 'ridge'.
Restart the network
# service network restart
Configure iptables
iptables
to allow all traffic to be forwarded across the bridge.
# iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT # service iptables save # service iptables restart
iptables
rules. In /etc/sysctl.conf
append the following lines:
net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0
sysctl
.
# sysctl -p /etc/sysctl.conf
Restart the libvirt service
libvirt
service with the service
command.
# service libvirtd reload
Verify the bridge
brctl
).
# brctl show bridge name bridge id STP enabled interfaces virbr0 8000.000000000000 yes br0 8000.000e0cb30550 no eth0
virt-manager
and libvirt, which guests can be attached and have full network access.
virbr0
bridge. Do not attempt to attach a physical device to virbr0
. The virbr0
bridge is only for Network Address Translation (NAT) connectivity.