brctl 的使用
brctl 作用: 用来进行以太网桥接(bridge)的管理
主要用法如下:
root@hbg:/# brctl --help
BusyBox v1.22.1 (2016-02-24 11:41:04 CST) multi-call binary.
Usage: brctl COMMAND [BRIDGE [INTERFACE]]
Manage ethernet bridges
Commands:
show Show a list of bridges // 显示桥接信息
addbr BRIDGE Create BRIDGE // 增加桥接端口
delbr BRIDGE Delete BRIDGE // 删除桥接端口
addif BRIDGE IFACE Add IFACE to BRIDGE // 为桥接端口增加绑定接口
delif BRIDGE IFACE Delete IFACE from BRIDGE // 删除桥接端口的绑定接口
setageing BRIDGE TIME Set ageing time
setfd BRIDGE TIME Set bridge forward delay
sethello BRIDGE TIME Set hello time
setmaxage BRIDGE TIME Set max message age
setpathcost BRIDGE COST Set path cost
setportprio BRIDGE PRIO Set port priority
setbridgeprio BRIDGE PRIO Set bridge priority
stp BRIDGE [1/yes/on|0/no/off] STP on/off // 是否参与生成树协议
用法如下:
root@hbg:/# brctl show
bridge name bridge id STP enabled interfaces
br-net 7fff.78c2c0e3004d yes eth0
wlan0
可以看到,目前的桥接接口名称为br-net, 它绑定了两个端口 eth0 和 wlan0.
root@hbg:/# brctl addif br-net eth1
[ 1133.440000] device eth1 entered promiscuous mode
root@hbg:/# brctl show
bridge name bridge id STP enabled interfaces
br-net 7fff.78c2c0e3004d yes eth0
wlan0
eth1
为桥接接口br-net增加绑定接口 eth1, 增加完后查看到已经绑定成功。
root@hbg:/# brctl delif br-net eth1
[ 1248.150000] device eth1 left promiscuous mode
[ 1248.160000] br-net: port 3(eth1) entered disabled state
root@hbg:/# brctl show
bridge name bridge id STP enabled interfaces
br-net 7fff.78c2c0e3004d yes eth0
wlan0
删除桥接接口 br-net 绑定的端口eth1,删除完成后查看已经删除成功。
root@hbg:/# brctl addbr br-lan // 增加了桥接接口"br-lan"
root@hbg:/# brctl show
bridge name bridge id STP enabled interfaces
br-net 7fff.78c2c0e3004d yes eth0
wlan0
br-lan 8000.000000000000 no // 新增的桥接接口默认为“未使能”的
root@hbg:/# brctl addif br-lan eth1 // 为桥接接口br-lan 绑定端口eth1
[ 1375.780000] device eth1 entered promiscuous mode
root@hbg:/# brctl show
bridge name bridge id STP enabled interfaces
br-net 7fff.78c2c0e3004d yes eth0
wlan0
br-lan 8000.78c2c0e3004e no eth1
root@hbg:/# brctl stp br-lan 1 // 参与生成树协议
root@hbg:/# brctl show
bridge name bridge id STP enabled interfaces
br-net 7fff.78c2c0e3004d yes eth0
wlan0
br-lan 8000.78c2c0e3004e yes eth1 // 参与生成树协议,接收和发送BPDU(Bridge Protocol Data Units)
root@TVWS:/# brctl delbr br-lan
[ 1635.570000] device eth1 left promiscuous mode
[ 1635.570000] br-lan: port 1(eth1) entered disabled state
root@TVWS:/#
root@TVWS:/# brctl show
bridge name bridge id STP enabled interfaces
br-net 7fff.78c2c0e3004d yes eth0
wlan0
直接删除桥接接口“br-lan”,查看结果删除成功。
brctl 的使用的更多相关文章
- brctl创建虚拟网卡详解
brctl创建虚拟网卡详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 很久之前我分享过一篇关于搭建Openvpn的笔记,在笔记的最后我分享了一个脚本,是用来创建虚拟网卡的,今天 ...
- brctl 命令详解
安装网桥管理工具包:bridge-utile ```# yum install bridge-utils -y``` ```使用brctl命令创建网桥br1```# brctl addbr br1`` ...
- Linux下通过brctl配置网桥
什么是网桥 网桥是一种在链路层实现中继,对帧进行转发的技术,根据MAC分区块,可隔离碰撞,将网络的多个网段在数据链路层连接起来的网络设备. 简单的理解就是交换机. Linux下配置网桥主要用 brct ...
- brctl命令
有五台主机.其中一台主机装有linux ,安装了网桥模块,而且有四块物理网卡,分别连接同一网段的其他主机.我们希望其成为一个网桥,为其他四台主机(IP分别为192.168.1.2 ,192.168.1 ...
- linux下brctl配置网桥
原文:http://zhumeng8337797.blog.163.com/blog/static/1007689142011643834429/ 先装好网卡,连上网线,这是废话,不用说了. 然后开始 ...
- linux brctl command not found
[root@localhost ~]# brctl-bash: brctl: command not found 解决方法: [root@localhost ~]# yum install bridg ...
- Linux 网桥配置命令:brctl
Linux网关模式下将有线LAN和无线LAN共享网段实现局域网内互联: 思路其实很简单:就是将虚拟出一个bridge口,将对应的有线LAN和无线LAN都绑定在这个虚拟bridge口上,并给这个brid ...
- centos7 配置虚拟交换机(物理交换机truckport设置)(使用brctl)
感谢朋友支持本博客.欢迎共同探讨交流,因为能力和时间有限.错误之处在所难免,欢迎指正! 假设转载,请保留作者信息. 博客地址:http://blog.csdn.net/qq_21398167 原博文地 ...
- brctl和虚拟网桥
1 创建空的虚拟网桥 brctl addbr br0 这个时候可以认为该虚拟网桥有多个虚拟接口,但是没有实际的网卡接口和该虚拟网桥相连的. 2 将eth0网卡连接到br0 网卡只有一个接口,这个接口是 ...
随机推荐
- <hdu - 1600 - 1601> Leftmost Digit && Rightmost Digit 数学方法求取大位数单位数字
1060 - Leftmost Digit 1601 - Rightmost Digit 1060题意很简单,求n的n次方的值的最高位数,我们首先设一个数为a,则可以建立一个等式为n^n = a * ...
- 2014 ACM/ICPC Asia Regional Beijing Site
1001 A Curious Matt 1002 Black And White 1003 Collision 1004 Dire Wolf 1005 Everlasting L 1006 Fluor ...
- tableviewcell 点击 设置
table?.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) //设置cell 下边线 位置 table?.se ...
- USACO 3.2 Contact
ContactIOI'98 The cows have developed a new interest in scanning the universe outside their farm wit ...
- NASPhoto Station不只是储存的强大照片管理功能
减少漫长的讨论时间,进而让你的艺术作品更符合客户需求.Photo Station 让你集中存储照片.随处分享及存取相簿并轻松收集朋友和客户反馈. 串流照片到大屏幕电视 DS photo 支援 Appl ...
- LoadRunner错误处理函数
节选自<LoadRunner虚拟用户开发指南> 在脚本的Run-time Settings中,可以设置在脚本运行过程中发生错误的处理方式.进入到Run-time Settings中,切换到 ...
- PAT乙级1027. 打印沙漏(20)
本题要求你写个程序把给定的符号打印成沙漏的形状.例如给定17个“*”,要求按下列格式打印 ***** *** * *** ***** 所谓“沙漏形状”,是指每行输出奇数个符号:各行符号中心对齐:相邻两 ...
- 基于html5 canvas 的强大图表插件【Chart.js】
名词解释 Chart.js:是基于html5和canvas的强大图表插件,支持多样的图表形式,柱状线性饼环极地雷达等等: canvas:只兼容到IE9 excanvas.js:强大的第三方兼容插件,可 ...
- hdu 3045 Picnic Cows(斜率优化DP)
题目链接:hdu 3045 Picnic Cows 题意: 有n个奶牛分别有对应的兴趣值,现在对奶牛分组,每组成员不少于t, 在每组中所有的成员兴趣值要减少到一致,问总共最少需要减少的兴趣值是多少. ...
- 2.MyBatis有代理增删改
2.1 创建一个javaweb项目MyBatis_Part1,并创建如下sql脚本 create user holly identified by sys; grant dba to holly; c ...