environment

  • Red Hat Enterprise Linux 5.4 or later
  • Red Hat Enterprise Linux 6.0 or later
  • KVM virtual machines

question

resolution

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.

Configuration Tool

Red Hat supply a KVM Bridge Configuration tool via the Customer Portal:  https://access.redhat.com/labs/kvmbridgeconfiguration/

Manual Configuration

  • If the interface that will be bridged is currently running, stop it using the 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
  • Open the network script for the device you are adding to the bridge. In this example, 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
  • Create a new network script in the /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
  • Start the Ethernet device and the bridge device using the ifup command:
# ifup eth0
# ifup br0
  • Test to make sure that the host can still communicate with the network:
# ping www.redhat.com
  • Add the lines below into /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
  • Now, reload the libvirt daemon:
# service libvirtd reload
  • Check the bridges:
# 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.


Configure a bridged network interface for KVM using RHEL 5.4 or later?的更多相关文章

  1. How do I configure a Wired Ethernet interface

    1.In order to configure the Wired Ethernet interface the MDI must be connected to the PC using the U ...

  2. [INS-41112] Specified network interface doesnt maintain connectivi

    OS: Oracle Linux Server release 6.3 DB: Oracle 11.2.0.3 安装11.2.0.3.0的RAC,在安装GRID时报错: [INS-41112] Spe ...

  3. [Solved] install Gentoo in VBox: network interface eth0 does not exist

    ERROR:interface eth0 does not exist; ensure that you have loaded the correct kernel moudle for your ...

  4. openwrt network interface(openwrt中的网络接口)

    这篇算是对openwrt网络接口的一个翻译吧,源地址:http://wiki.openwrt.org/doc/networking/network.interfaces network的接口类型:物理 ...

  5. docker的网络-Container network interface(CNI)与Container network model(CNM)

    Overview 目前围绕着docker的网络,目前有两种比较主流的声音,docker主导的Container network model(CNM)和社区主导的Container network in ...

  6. [INS-40724] No locally defined network interface matches the SCAN subnet.

    环境如下 OS:AIX 7.1 DB:11.2.0.4 2节点RAC 报错信息 在安装11.2.0.4 RAC的时候报如下错误 INS-40724] No locally defined networ ...

  7. Oracle Grid 11.2.0.4 安装是出现“[INS-41112] Specified network interface doesnt maintain connectivity across cluster”错误

    最新文章:Virson's Blog 安装Oracle 11.2.0.4 的RAC,在Grid 安装时报错: [INS-41112]Specified network interface doesnt ...

  8. Linux-debian系统 /etc/network/interface 文件解读

    原文 http://wiki.slimdevices.com/index.php/SqueezeOS_networking 话说Debian系的网卡配置跟Redhat系很不一样,Redhat是放在/e ...

  9. LWIP network interface 网卡 初始化 以 STM32 为例子 后面会有 用 2G 或者4G 模块 用 PPP拨号的 形式 虚拟出网卡 所以先以 这个为 前提

    LWIP   network interface   网卡 初始化    以  STM32  为例子  后面会有 用  2G 或者4G 模块 用 PPP拨号的 形式  虚拟出网卡  所以先以 这个为 ...

随机推荐

  1. Fis3前端工程化之项目实战

    Fis3项目 项目目录结构: E:. │ .gitignore │ fis-conf.js │ index.html │ package.json │ README.md │ ├─material │ ...

  2. 旺财速啃H5框架之Bootstrap(五)

    在上一篇<<旺财速啃H5框架之Bootstrap(四)>>做了基本的框架,<<旺财速啃H5框架之Bootstrap(二)>>篇里也大体认识了bootst ...

  3. JavaScript进阶之路(一)初学者的开始

    一:写在前面的问题和话 一个javascript初学者的进阶之路! 背景:3年后端(ASP.NET)工作经验,javascript水平一般般,前端水平一般般.学习资料:犀牛书. 如有误导,或者错误的地 ...

  4. C语言 · 4-3水仙花数

    问题描述 打印所有100至999之间的水仙花数.所谓水仙花数是指满足其各位数字立方和为该数字本身的整数,例如 153=1^3+5^3+3^3. 样例输入 一个满足题目要求的输入范例.例:无 样例输出 ...

  5. (系统架构)标准Web系统的架构分层

    标准Web系统的架构分层 1.架构体系分层图 在上图中我们描述了Web系统架构中的组成部分.并且给出了每一层常用的技术组件/服务实现.需要注意以下几点: 系统架构是灵活的,根据需求的不同,不一定每一层 ...

  6. [笔记]HAproxy reload config file with uninterrupt session

    HAProxy is a high performance load balancer. It is very light-weight, and free, making it a great op ...

  7. 免费道路 bzoj 3624

    免费道路(1s 128MB)roads [输入样例] 5 7 21 3 04 5 13 2 05 3 14 3 01 2 14 2 1 [输出样例] 3 2 04 3 05 3 11 2 1 题解: ...

  8. document.compatMode

    在我电脑屏幕上显示的 电脑是 1920*1080这是在document.compatMode:css1Compat模式 window.screen.availWidth 1920 window.scr ...

  9. Idea下用SBT搭建Spark Helloworld

    没用过IDEA工具,听说跟Eclipse差不多,sbt在Idea其实就等于maven在Eclipse.Spark运行在JVM中,所以要在Idea下运行spark,就先要安装JDK 1.8+ 然后加入S ...

  10. 在VMware上安装CentOS -7

    1.下载好VMware 2.准备好CentOS的镜像文件 3.打开VMware创建新的虚拟机 选择自定义高级后按下一步 继续下一步 选择稍后安装操作系统 客户机操作系统选择Linux,版本选择Cent ...