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. 从Membership 到 .NET4.5 之 ASP.NET Identity

    我们前面已经讨论过了如何在一个网站中集成最基本的Membership功能,然后深入学习了Membership的架构设计.正所谓从实践从来,到实践从去,在我们把Membership的结构吃透之后,我们要 ...

  2. .NET Core的日志[2]:将日志输出到控制台

    对于一个控制台应用,比如采用控制台应用作为宿主的ASP.NET Core应用,我们可以将记录的日志直接输出到控制台上.针对控制台的Logger是一个类型为ConsoleLogger的对象,Consol ...

  3. BPM配置故事之案例14-数据字典与数据联动

    小明遇到了点麻烦,他昨天又收到了行政主管发来的邮件,要求把出差申请单改由H3 BPM进行,表单如下 行政主管的出差申请表 小明对表单进行了调整,设计出了一份适合在系统中使用的表单,但在"出差 ...

  4. ExecuteOrDelayUntilScriptLoaded 还是 SP.SOD.executeFunc?

    SharePoint 客户端 JS 开发时,要等待 SharePoint 对象都加载完毕再调用自己的方法(myFunction),可以有两种方式: ExecuteOrDelayUntilScriptL ...

  5. Linux常用命令

    命令格式与目录处理命令 ls 命令格式与目录处理命令 ls 命令格式:命令 [-选项][参数] 例:ls -la /etc 说明: 1)个别命令使用不遵循格式 2)当有多个选项时,可以写在一起 3)简 ...

  6. 前端开发小白必学技能—非关系数据库又像关系数据库的MongoDB快速入门命令(2)

    今天给大家道个歉,没有及时更新MongoDB快速入门的下篇,最近有点小忙,在此向博友们致歉.下面我将简单地说一下mongdb的一些基本命令以及我们日常开发过程中的一些问题.mongodb可以为我们提供 ...

  7. 2DToolkit官方文档中文版打地鼠教程(三):Sprite Collections 精灵集合

    这是2DToolkit官方文档中 Whack a Mole 打地鼠教程的译文,为了减少文中过多重复操作的翻译,以及一些无必要的句子,这里我假设你有Unity的基础知识(例如了解如何新建Sprite等) ...

  8. 舍弃Nunit拥抱Xunit

    前言 今天与同事在讨论.Net下测试框架的时候,说到NUnit等大多数测试框架的SetUp以及TearDown方法并不是显得那么完美,所以在公司内部的项目中采用了Xunit框架.那么究竟是什么样的原因 ...

  9. 浅谈浏览器http的缓存机制

    针对浏览器的http缓存的分析也算是老生常谈了,每隔一段时间就会冒出一篇不错的文章,其原理也是各大公司面试时几乎必考的问题. 之所以还写一篇这样的文章,是因为近期都在搞新技术,想“回归”下基础,也希望 ...

  10. 集成基于OAuth协议的单点登陆

    在之前的一篇文章中,我们已经介绍了如何为一个应用添加对CAS协议的支持,进而使得我们的应用可以与所有基于CAS协议的单点登陆服务通讯.但是现在的单点登陆服务实际上并不全是通过实现CAS协议来完成的.例 ...