热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

linux下实现双网卡桥接

文章标题:linux下实现双网卡桥接。Linux是中国IT实验室的一个技术频道。包含桌面应用,Linux系统管理,内核研究,嵌入式系统和开源等一些基本分类

  Name名称

  brctl - ethernet bridge administration brctl - 以太网桥管理

  Synopsis简介

  brctl [command] brctl [命令]

  Description描述

  brctl is used to set up, maintain, and inspect the ethernet bridge configuration in the linux kernel.brctl是用于建立,维护和检查Linux内核的以太网桥配置研究。

  An ethernet bridge is a device commonly used to connect different networks of ethernets together, so that these ethernets will appear as one ethernet to the participants.一个以太网是以太网桥设备以及常用的不同的网络连接,使这些以太网将作为一个以太网的参与者。

  Each of the ethernets being connected corresponds to one physical interface in the bridge.目前的以太网连接各对应一个物理接口的桥梁。 These individual ethernets are bundled into one bigger ('logical') ethernet, this bigger ethernet corresponds to the bridge network interface.这些个别以太网是以太网捆绑成一个更大的('逻辑')以太网,这对应于更大桥网络接口。

  Instances实例

  The command brctl addbr creates a new instance of the ethernet bridge.该命令brctl addbr <名称创建一个新的以太网桥的实例。 The network interface corresponding to the bridge will be called .该网络接口对应的桥梁将被称为<名称。

  The command brctl delbr deletes the instance of the ethernet bridge. <名称>命令brctl delbr删除以太网桥的实例<名称。 The network interface corresponding to the bridge must be down before it can be deleted!该网络接口对应的桥梁,必须下才能被删除!

  The command brctl show shows all current instances of the ethernet bridge.命令brctl显示显示当前所有的以太网桥的实例。

  Ports端口

  Each bridge has a number of ports attached to it.每个桥有一个连接到它的端口数。 Network traffic coming in on any of these ports will be forwarded to the other ports transparently, so that the bridge is invisible to the rest of the network (ie it will not show up in traceroute http://translate.googleusercontent.com/translate_c?hl=zh-CN&langpair=en%7Czh-CN&u=http://linux.die.net/man/8/traceroute&rurl=translate.google.com.hk&usg=ALkJrhgJakROF--e1An0sDTvEZMCZO7DQA> (8) ).未来的网络流量在这些港口的任何会被转发到其他港口透明,使无形的桥梁,是网络的其余部分的(即它不会出现在了的traceroute (8))。

  The command brctl addif will make the interface a port of the bridge .该命令brctl addif 将使接口 1 港口桥。 This means that all frames received on will be processed as if destined for the bridge.这意味着在收到的所有帧将被处理,好像注定了桥梁。 Also, when sending frames on , will be considered as a potential output interface.此外,在发送框架上,将被视为一个潜在的输出接口。

  The command brctl delif will detach the interface from the bridge .该命令brctl delif 将分离的桥梁接口从。

  The command brctl show will show some information on the bridge and its attached ports.该命令将显示brctl显示一些端口信息的桥梁及其附属。

  Ageing老龄化

  The bridge keeps track of ethernet addresses seen on each port.这座桥的以太网保持跟踪每个端口看到地址。 When it needs to forward a frame, and it happens to know on which port the destination ethernet address (specified in the frame) is located, it can 'cheat' by forwarding the frame to that port only, thus saving a lot of redundant copies and transmits.当它需要提出一个框架,它发生在哪个端口知道目标以太网地址(框架中指定)的位置,它可以'欺骗'的帧转发到该端口只,从而节省了大量的冗余拷贝与传输。

  However, the ethernet address location data is not static data.然而,以太网地址位置数据不是静态数据。 Machines can move to other ports, network cards can be replaced (which changes the machine's ethernet address), etc.机器可以转移到其他港口,网络卡可以更换(从而改变了机器的以太网地址)等

  brctl showmacs shows a list of learned MAC addresses for this bridge. showmacs brctl显示的MAC地址列表获悉此桥。

  brctl setageingtime

  brctl setgcint

  Spanning Tree Protocol生成树协议

  Multiple ethernet bridges can work together to create even larger networks of ethernets using the IEEE 802.1d spanning tree protocol.多个以太网桥可以共同创造更大的网络,以太网使用IEEE 802.1D生成树协议。 This protocol is used for finding the shortest path between two ethernets, and for eliminating loops from the topology.这个协议是用来找出两个以太网之间的最短路径,拓扑结构和消除循环的。 As this protocol is a standard, linux bridges will interwork properly with other third party bridge products.由于此协议是一个标准,Linux的桥梁将妥善互通的桥梁与其他第三方产品。 Bridges communicate with eachother by sending and receiving BPDUs (Bridge Protocol Data Units).桥梁沟通海誓山盟通过发送和接收BPDUs讯息(桥协议数据单元)。 These BPDUs can be recognised by an ethernet destination address of 01:80:c2:00:00:00.这些BPDUs讯息可识别以太网目标地址的01:80:c2的:00:00:00。

  The spanning tree protocol can also be turned off (for those situations where it just doesn't make sense, for example when this linux box is the only bridge on the LAN, or when you know that there are no loops in the topology.)生成树协议还可以关闭意识(对于那些情况下它只是不作,例如在Linux机器这是唯一的桥梁,或当在局域网上,你知道,有没有循环中的拓扑。)

  brctl (8) can be used for configuring certain spanning tree protocol parameters. brctl(8)可用于配置某些生成树协议参数。 For an explanation of these parameters, see the IEEE 802.1d specification (or send me an email).对于这些参数的解释,看到了IEEE 802.1d的规格(或向我发送电子邮件)。 The default values should be just fine.默认值应该只是罚款。 If you don't know what these parameters mean, you probably won't feel the desire to tweak them.如果你不知道这些参数的意思是,你可能不会觉得他们的愿望来调整。

  brctl stp controls this bridge instance's participation in the spanning tree protocol. brctl污水处理厂 控制此桥实例的协议参与生成树。 If is "on" or "yes" the STP will be turned on, otherwise it will be turned off.如果是“开”或“是”的污水处理厂将被打开,否则将被关闭。 When turned off, the bridge will not send or receive BPDUs, and will thus not participate in the spanning tree protocol.当关闭时,桥将不会发送或接收BPDUs讯息,并因此不参与生成树协议。 If your bridge isn't the only bridge on the LAN, or if there are loops in the LAN's topology, DO NOT turn this option off.如果你的桥是不是在局域网上的唯一桥梁,或者有在局域网的拓扑结构的循环,不要关闭此选项。 If you turn this option off, please know what you are doing.如果你关闭此选项,请知道自己在做什么。

  brctl setbridgeprio sets the bridge's priority to . brctl setbridgeprio 设置桥的优先。 The priority value is an unsigned 16-bit quantity (a number between 0 and 65535), and has no dimension.优先级值是一个无符号16位的数量(1 0和65535之间的数字),没有任何方面。 Lower priority values are 'better'.低优先级值是'好'。 The bridge with the lowest priority will be elected 'root bridge'.最低的优先大桥将是当选'根桥'。

  brctl setfd

  brctl sethello

  brctl setmaxage

  brctl setpathcost sets the port cost of the port to . brctl setpathcost <端口设置端口<端口端口的成本为。 This is a dimensionless metric.这是一个无量纲指标。

  brctl setportprio sets the port 's priority to . brctl setportprio <端口设置端口<端口的优先。 The priority value is an unsigned 8-bit quantity (a number between 0 and 255), and has no dimension.优先级值是一个无符号8位的数量(0至255个号码和),并没有尺寸。 This metric is used in the designated port and root port selection algorithms.该指标用于在指定端口和根端口选择算法。


推荐阅读
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • 学习SLAM的女生,很酷
    本文介绍了学习SLAM的女生的故事,她们选择SLAM作为研究方向,面临各种学习挑战,但坚持不懈,最终获得成功。文章鼓励未来想走科研道路的女生勇敢追求自己的梦想,同时提到了一位正在英国攻读硕士学位的女生与SLAM结缘的经历。 ... [详细]
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • 一、Hadoop来历Hadoop的思想来源于Google在做搜索引擎的时候出现一个很大的问题就是这么多网页我如何才能以最快的速度来搜索到,由于这个问题Google发明 ... [详细]
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • 云原生边缘计算之KubeEdge简介及功能特点
    本文介绍了云原生边缘计算中的KubeEdge系统,该系统是一个开源系统,用于将容器化应用程序编排功能扩展到Edge的主机。它基于Kubernetes构建,并为网络应用程序提供基础架构支持。同时,KubeEdge具有离线模式、基于Kubernetes的节点、群集、应用程序和设备管理、资源优化等特点。此外,KubeEdge还支持跨平台工作,在私有、公共和混合云中都可以运行。同时,KubeEdge还提供数据管理和数据分析管道引擎的支持。最后,本文还介绍了KubeEdge系统生成证书的方法。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • “你永远都不知道明天和‘公司的意外’哪个先来。”疫情期间,这是我们最战战兢兢的心情。但是显然,有些人体会不了。这份行业数据,让笔者“柠檬” ... [详细]
  • 生成对抗式网络GAN及其衍生CGAN、DCGAN、WGAN、LSGAN、BEGAN介绍
    一、GAN原理介绍学习GAN的第一篇论文当然由是IanGoodfellow于2014年发表的GenerativeAdversarialNetworks(论文下载链接arxiv:[h ... [详细]
  • [译]技术公司十年经验的职场生涯回顾
    本文是一位在技术公司工作十年的职场人士对自己职业生涯的总结回顾。她的职业规划与众不同,令人深思又有趣。其中涉及到的内容有机器学习、创新创业以及引用了女性主义者在TED演讲中的部分讲义。文章表达了对职业生涯的愿望和希望,认为人类有能力不断改善自己。 ... [详细]
  • 本文介绍了Hyperledger Fabric外部链码构建与运行的相关知识,包括在Hyperledger Fabric 2.0版本之前链码构建和运行的困难性,外部构建模式的实现原理以及外部构建和运行API的使用方法。通过本文的介绍,读者可以了解到如何利用外部构建和运行的方式来实现链码的构建和运行,并且不再受限于特定的语言和部署环境。 ... [详细]
  • 本文介绍了Perl的测试框架Test::Base,它是一个数据驱动的测试框架,可以自动进行单元测试,省去手工编写测试程序的麻烦。与Test::More完全兼容,使用方法简单。以plural函数为例,展示了Test::Base的使用方法。 ... [详细]
  • 计算机存储系统的层次结构及其优势
    本文介绍了计算机存储系统的层次结构,包括高速缓存、主存储器和辅助存储器三个层次。通过分层存储数据可以提高程序的执行效率。计算机存储系统的层次结构将各种不同存储容量、存取速度和价格的存储器有机组合成整体,形成可寻址存储空间比主存储器空间大得多的存储整体。由于辅助存储器容量大、价格低,使得整体存储系统的平均价格降低。同时,高速缓存的存取速度可以和CPU的工作速度相匹配,进一步提高程序执行效率。 ... [详细]
  • 本文介绍了Linux系统中正则表达式的基础知识,包括正则表达式的简介、字符分类、普通字符和元字符的区别,以及在学习过程中需要注意的事项。同时提醒读者要注意正则表达式与通配符的区别,并给出了使用正则表达式时的一些建议。本文适合初学者了解Linux系统中的正则表达式,并提供了学习的参考资料。 ... [详细]
  • Ubuntu 9.04中安装谷歌Chromium浏览器及使用体验[图文]
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
author-avatar
平凡咸伟
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有