By default, kvm uses NAT networking through a libvirt-managed bridge called virbr0
. If you require your guest to appear as another host on the same network as the hypervisor, a bridged interface may be used to achieve this. However, virtualization hosts configured to use KVM will not automatically create a bridged interface for the Ethernet devices on your system. A configuration must be created to set up the bridge when the network is started.
Note: The host should be accessed through a console or serial session as changes to the network configuration files may cause the network access to be lost.
Red Hat supply a KVM Bridge Configuration tool via the Customer Portal: https://access.redhat.com/labs/kvmbridgeconfiguration/
ifdown
command. For example:# ifdown eth0
Now two files will be created or modified to setup the bridge (ifcfg-brX
) and physical interface (ifcfg-ethX
). Change to the /etc/sysconfig/network-scripts
directory:
# cd /etc/sysconfig/network-scripts
ifcfg-eth0
defines the physical network interface which is part of a bridge:DEVICE=eth0 HWADDR=00:16:76:D6:C9:45 # change the hardware address to match the hardware address your NIC uses ONBOOT=yes BRIDGE=br0 NM_CONTROLLED=no
/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 the name is specified correctly in the previously created physical interface configuration (ifcfg-ethX
):DEVICE=br0 TYPE=Bridge BOOTPROTO=dhcp ONBOOT=yes DELAY=0
If using a static IP address, the configuration will look similar to:
DEVICE=br0 TYPE=Bridge BOOTPROTO=static IPADDR=<Static IP address> NETMASK=<Netmask> GATEWAY=<Gateway> ONBOOT=yes
ifup
command:# ifup eth0 # ifup br0
# ping www.redhat.com
/etc/sysctl.conf
:net.ipv4.ip_forward = 1 net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0
Apply the configurations:
# sysctl -p /etc/sysctl.conf
# service libvirtd reload
# brctl show
For more detailed information about bridged networking on KVM environment, please refer to the RHEL 5 or RHEL 6 Virtualization Guides.
Alternatively, a bridge can be created using the virt-manager GUI program, however this sort of bridge will be started with the libvirt service on boot, so should not be used as the primary network connectivity for the hypervisor.
http://xxxxxx/Linuxjc/1183618.html TechArticle
交叉編譯總結 libosscore.a libcurl.a libmysqlclient.a
Java中a=a+b 與 a+=b區別 以及和類型轉換的關系
Configure a VLAN (on top of a bond) with NetworkManager (nmcli) in RHEL7,nmclibond
Create a bridge using a tagged vlan (8021.q) interface,tagged8021.q
Configure a bridge interface over a VLAN tagged bonded interface,taggedbonded
How do I set up VLAN (802.1q) tagging on a network interface?,802.1qtagging