安装Bridge工具软件包

Linux可以工作在网桥模式,必须安装网桥工具bridge-utils,运行命令:

  yum install bridge-utils 或 apt-get install bridge-utils

Linux KVM Bridge逻辑结构图

通过命令行创建Bridge

注意:通过命令创建的Brdge在重启后会自动丢失,因此需要在网络配置文件中写入Brdge配置。

# 创建brdge br0
# brctl addbr br0 # 将br0绑定到ens33
# brctl addif br0 ens33

通过网络配置创建创建Bridge

CentOS系统:https://zhidao.baidu.com/question/1046233341920860299.html

Ubuntu Bridge配置示例

auto ens33
iface ens33 inet manual auto br0
iface br0 inet static
address 192.168.1.2
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
bridge_ports eth0
bridge_bridgeprio 32767
bridge_portprio eth0 129
bridge_fd 5

参数

IFACE OPTIONS

       A   little  explanation  on  the  new  options  that  can  be  used  on
/etc/network/interfaces to setup the bridge, so you don't have to go
and look at the scripts... bridge_ports interface specification
this option must exist for the scripts to setup the bridge, with
it you specify the ports you want to add to your bridge, either
using "none" if you want a bridge without any interfaces or you
want to add them later using brctl, or a list of the interfaces
you want to add separated by spaces, for example:
bridge_ports eth0 eth4
You should not put any lines to configure the interfaces that
will be used by the bridge, as this will be setup automatically
by the scripts when bringing the bridge up. If you need to specify the interfaces more flexibly, you can use
the following syntax (most useful on a Xen dom0):
bridge_ports regex (eth|vif).*
This means to evaluate (as in egrep(1)) the expressions that
follow after "regex" until either the end or a "noregex"
statement is reached. The regular expressions are evaluated
against all local interfaces and those that match are added. Specifying "all" is short for "regex eth.* em.* p[0-9].*
noregex" and will get all the ethX and biosdevname-format (emX
and pX) interfaces added to the bridge. Carrying this to the extremes, the following is valid syntax:
bridge_ports all regex if.0 noregex ext0 regex vif.*
This will add all ethX interfaces, the ifX0 interfaces, the ext0
interface and all vifX interfaces. bridge_ageing time
set ageing time, default is 300, can have a fractional part. bridge_bridgeprio priority
set bridge priority, priority is between 0 and 65535, default is
32768, affects bridge id, lowest priority bridge will be the
root. bridge_fd time
set bridge forward delay to time seconds, default is 15, can
have a fractional part. bridge_gcint time
set garbage collection interval to time seconds, default is 4,
can have a fractional part. Available on Linux kernel versions
< 2.6.0. bridge_hello time
set hello time to time seconds, default is 2, can have a
fractional part. bridge_hw MAC address
set the Ethernet MAC address of the bridge to the specified one.
There were some concerns of how this was done in the past, see:
http://bugs.debian.org/271406 but we are doing it on a new way
now that shouldn't be as bad, see: http://bugs.debian.org/725786
however you should know what you are doing before using this
option. bridge_maxage time
set max message age to time seconds, default is 20, can have a
fractional part. bridge_maxwait time
forces to time seconds the maximum time that the Debian bridge
setup scripts will wait for the bridge ports to get to the
forwarding status, doesn't allow factional part. If it is equal
to 0 then no waiting is done. bridge_pathcost port cost
set path cost for a port, default is 100, port is the name of
the interface to which this setting applies. bridge_portprio port priority
set port priority, default is 32, affects port id, port is the
name of the interface to which this setting applies. On Linux
kernels older than 2.6.0 the max value is 255, the default 128.
Newer kernels have a maximum value of 63 and a default of 32. bridge_stp state
turn spanning tree protocol on/off, state values are on or yes
to turn stp on and any other thing to set it off, default has
changed to off for security reasons in latest kernels, so you
should specify if you want stp on or off with this option, and
not rely on your kernel's default behaviour. bridge_waitport time [ports]
wait for a max of time seconds for the specified ports to become
available, if no ports are specified then those specified on
bridge_ports will be used here. Specifying no ports here should
not be used if we are using regex or "all" on bridge_ports, as
it wouldn't work.

Linux 创建Bridge的更多相关文章

  1. linux useradd(adduser)命令参数及用法详解(linux创建新用户命令)

    linux useradd(adduser)命令参数及用法详解(linux创建新用户命令) useradd可用来建立用户帐号.帐号建好之后,再用passwd设定帐号的密码.而可用userdel删除帐号 ...

  2. linux创建用户和用户组

    Linux创建用户.用户组 及 删除 在创建用户时,需要为新建用户指定一用户组,如果不指定其用户所属的工作组,自动会生成一个与用户名同名的工作组.创建用户user1的时候指定其所属工作组users,例 ...

  3. Linux创建修改删除用户和组

    Linux 创建修改删除用户和组 介绍 在日常的维护过程中创建用户操作用的相对会多一些,但是在这个过程中涉及到的知识点就不单单就是useradd了,接下来就来详细了解账号管理的相关信息. 用户信息 先 ...

  4. 一起来学习linux创建用户useradd命令

    linux创建用户useradd命令 原文地址:linux创建用户useradd命令 http://www.xfcodes.com/linuxcmd/user/24308.htm 一,adduser与 ...

  5. Linux 创建自定义命令

    Linux 创建自定义命令 Linux 可以创建自定义使用命令 这里我们采取使用“alias”命令.这里我们首先了解两个文件,通过这两个文件我们可以根据环境配置相应的自定义命令. 该文件内创建的自定义 ...

  6. linux创建定时任务,定时执行sql

    终于弄清楚一个问题了.linux创建定时任务,定时执行sql,其中分为两个case. case-1 sql语句较少,因此直接在 shell脚本中 写sql语句.如下: [oracle@Oracle11 ...

  7. Windows和Linux创建软链接和硬链接

    1.Wondows创建软链接和硬链接 mklink [/d] [/h] link target /d--创建目录软链接:默认为文件软链接:创建目录链接时必须使用该选项不然创出的软链接无效 /h--创建 ...

  8. linux 创建守护进程的相关知识

    linux 创建守护进程的相关知识 http://www.114390.com/article/46410.htm linux 创建守护进程的相关知识,这篇文章主要介绍了linux 创建守护进程的相关 ...

  9. [转帖] Linux 创建一个简单的私有CA、发证、吊销证书

    原创帖子地址:   https://blog.csdn.net/mr_rsq/article/details/71001810 Linux 创建一个简单的私有CA.发证.吊销证书 2017年04月30 ...

随机推荐

  1. 利用nginx搭建tomcat集群

    1.tomcat集群 利用nginx对请求进行分流,将请求平均的分给不同的tomcat去处理,减少单个tomcat的负载量,提高tomcat的响应速度. 2.创建多个tomcat服务器(同一个服务器上 ...

  2. c# 获取毫秒值,时间戳

    获取时间戳(秒) (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000 获取时间戳(毫秒) (DateTime. ...

  3. Android6.0系统添加那些新特性

        北京时间9月30日凌晨在美国旧金山举行2015年秋季新品公布会.在公布会上代号为"Marshmallow(棉花糖)"的安卓6.0系统正式推出.新系统的总体设计风格依旧保持扁 ...

  4. [原创]个人工具 - 对APK极限压缩并对齐的工具(58.ReExtremeZipAndAlignAPK)

    2014年9月13日:RootExplorer_v2.21.1_Aligned对齐后:在华为U8860(2.3.6).酷派8150S(4.0.3)上安装滑动列表时,崩溃.原版本(已对齐)则OK.(不知 ...

  5. 软件project--谈项目开发

    前段时间一直忙自考.着急赶项目进度,如今最终有时间回想这段时间的学习,突然发现自己已有半个月没有沉淀. 今天早上醒来.灵感如泉水般涌出,挡都挡不住.所以早上一到机房,便迫不及待的想大家分享灵感,希望大 ...

  6. Eureka 源码编译安装部署---Eureka运行eureka-server服务

    ---恢复内容开始--- 折腾了几天,终于运行好了,两个字:佩服 首先感谢这个大佬的博客支持:https://www.cnblogs.com/lifuping/p/5663127.html 1.首先在 ...

  7. PHP高级工程师的要求

    PHP 高级工程师1名,(3年以上工作经验  )   1.熟悉unix环境编程,如多线程/多进程,IO复用.锁.定时器.新号.信号量.共享内存.消息队列.文件系统2.熟悉php的stream.sock ...

  8. Unity3D引擎之渲染技术系列一

    笔者介绍:姜雪伟,IT公司技术合伙人,IT高级讲师,CSDN社区专家,特邀编辑,畅销书作者.国家专利发明人;已出版书籍:<手把手教你架构3D游戏引擎>电子工业出版社和<Unity3D ...

  9. 昂贵的聘礼 - poj 1062 (Dijkstra+枚举)

      Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 39976   Accepted: 11596 Description 年 ...

  10. python 3 关于requests库的 text / content /json

    最近在爬SDFDA的数据,刚开始用urllib.request 库,一直连不到数据 : 后来通过CHROME浏览器的F12,发现该 网站用的是JSON格式{}'Content-Type': 'appl ...