Configure a bridged network interface for KVM using RHEL 5.4 or later?
environment
- Red Hat Enterprise Linux 5.4 or later
- Red Hat Enterprise Linux 6.0 or later
- KVM virtual machines
question
- How do I configure a bridged network interface for KVM using Red Hat Enterprise Linux 5.4 or later?
- On RHEL 6, what is the recommended procedure for creating a virtual machine network that can receive an external IP address?
- How to configure bridge network for my kvm guest ?
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
ifdowncommand. 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-eth0defines 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-scriptsdirectory calledifcfg-br0or similar. Thebr0is 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
ifupcommand:
# 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?的更多相关文章
- 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 ...
- [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 ...
- [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 ...
- openwrt network interface(openwrt中的网络接口)
这篇算是对openwrt网络接口的一个翻译吧,源地址:http://wiki.openwrt.org/doc/networking/network.interfaces network的接口类型:物理 ...
- docker的网络-Container network interface(CNI)与Container network model(CNM)
Overview 目前围绕着docker的网络,目前有两种比较主流的声音,docker主导的Container network model(CNM)和社区主导的Container network in ...
- [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 ...
- 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 ...
- Linux-debian系统 /etc/network/interface 文件解读
原文 http://wiki.slimdevices.com/index.php/SqueezeOS_networking 话说Debian系的网卡配置跟Redhat系很不一样,Redhat是放在/e ...
- LWIP network interface 网卡 初始化 以 STM32 为例子 后面会有 用 2G 或者4G 模块 用 PPP拨号的 形式 虚拟出网卡 所以先以 这个为 前提
LWIP network interface 网卡 初始化 以 STM32 为例子 后面会有 用 2G 或者4G 模块 用 PPP拨号的 形式 虚拟出网卡 所以先以 这个为 ...
随机推荐
- 【.net 深呼吸】细说CodeDom(1):结构大观
CodeDom 是啥东东?Html Dom听过吧,XML Dom听过吧.DOM一般可翻译为 文档对象模型,那 Code + DOM呢,自然是指代码文档模型了.如果你从来没接触过 CodeDom,你大概 ...
- C# - 值类型、引用类型&走出误区,容易错误的说法
1. 值类型与引用类型小总结 1)对于引用类型的表达式(如一个变量),它的值是一个引用,而非对象. 2)引用就像URL,是允许你访问真实信息的一小片数据. 3)对于值类型的表达式,它的值是实际的数据. ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(69)-微信公众平台开发-功能概述
系列目录 为什么要先发这个文章? 因为接下来的文章是关于微信开发的系列,心中一定要有一个概念,知道自己接下来要做什么功能. 而且微信到处都是坑,我首先要把微信与本地跑通起来才敢发布,否则中间出现坑导致 ...
- spring的BeanFactory加载过程
ApplicationContext spring = new ClassPathXmlApplicationContext("classpath*:spring/applicationCo ...
- 每天一个设计模式-7 生成器模式(Builder)
每天一个设计模式-7 生成器模式(Builder) 一.实际问题 在讨论工厂方法模式的时候,提到了一个导出数据的应用框架,但是并没有涉及到导出数据的具体实现,这次通过生成器模式来简单实现导出成文本,X ...
- 【JS基础】对象
delete 可以删除对象属性及变量 function fun(){ this.name = 'mm'; } var obj = new fun(); console.log(obj.name);// ...
- css选择器
常用css选择器,希望对大家有所帮助,不喜勿喷. 1.*:通用选择器 * { margin: 0; padding: 0; } 选择页面上的全部元素,通常用于清除浏览器默认样式,不推荐使用. 2.#i ...
- Git学习笔记一:新建本地仓库及初始化
1.百度搜索Git下载安装,直接按默认选项安装即可. 例如:Git-2.7.2-32-bit_setup.1457942412.exe 2.配置Git信息,建立版本仓库 (Alt+PrintScerr ...
- windows 7(32/64位)GHO安装指南(U盘制作篇)~
本篇接着上篇的介绍,为同学讲解U盘启动盘的制作.虽然本篇大白菜的官网上也有类似的教程,但是为了完整性,我将在这里为大家细细的讲解.在这里说一下,系统包和软件包的下载大家可以自行下载,很简单的,小主就不 ...
- firebug不能加载JS文件 ,无法进行JS脚本调试
提示: 本页面不包含 Javascript 如果 <script> 标签有 "type" 属性,其值应为 "text/javascript" 或者& ...