`
jimode2013
  • 浏览: 39887 次
社区版块
存档分类
最新评论

9.2.5. Network Bridge

 
阅读更多

A network bridge is a Link Layer device which forwards traffic between networks based on MAC addresses and is therefore also referred to as a Layer 2 device. It makes forwarding decisions based on tables of MAC addresses which it builds by learning what hosts are connected to each network. A software bridge can be used within a Linux host in order to emulate a hardware bridge, for example in virtualization applications for sharing a NIC with one or more virtual NICs. This case will be illustrated here as an example.

To create a network bridge, create a file in the /etc/sysconfig/network-scripts/ directory called ifcfg-brN, replacing N with the number for the interface, such as 0.

The contents of the file is similar to whatever type of interface is getting bridged to, such as an Ethernet interface. The differences in this example are as follows:

  • The DEVICE directive is given an interface name as its argument in the format brN, where N is replaced with the number of the interface.
  • The TYPE directive is given an argument Bridge or Ethernet. This directive determines the device type and the argument is case sensitive.
  • The bridge interface configuration file now has the IP address and the physical interface has only a MAC address.
  • An extra directive, DELAY=0, is added to prevent the bridge from waiting while it monitors traffic, learns where hosts are located, and builds a table of MAC addresses on which to base its filtering decisions. The default delay of 30 seconds is not needed if no routing loops are possible.
  • The NM_CONTROLLED=no should be added to the Ethernet interface to prevent NetworkManager from altering the file. It can also be added to the bridge configuration file in case future versions of NetworkManager support bridge configuration.

The following is a sample bridge interface configuration file using a static IP address:

Example 9.2. Sample ifcfg-br0 interface configuration file

 

DEVICE=br0
TYPE=Bridge
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
DELAY=0

 To complete the bridge another interface is created, or an existing interface is modified, and pointed to the bridge interface. The following is a sample Ethernet interface configuration file pointing to a bridge interface. Configure your physical interface in /etc/sysconfig/network-scripts/ifcfg-ethX, where X is a unique number corresponding to a specific interface, as follows:

 

 

Example 9.3. Sample ifcfg-ethX interface configuration file

 

DEVICE=ethX
TYPE=Ethernet
HWADDR=AA:BB:CC:DD:EE:FF
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=br0

 Note

 

For the DEVICE directive, almost any interface name could be used as it does not determine the device type. Other commonly used names include tap, dummy and bond for example. TYPE=Ethernet is not strictly required. If the TYPE directive is not set, the device is treated as an Ethernet device (unless it's name explicitly matches a different interface configuration file.)

You can refer to Section 9.2, “Interface Configuration Files” for a review of the directives and options used in network interface config files.

 

Warning

If you are configuring bridging on a remote host, and you are connected to that host over the physical NIC you are configuring, please consider the implications of losing connectivity before proceeding. You will lose connectivity when restarting the service and may not be able to regain connectivity if any errors have been made. Console, or out-of-band access is advised.

 

service network restart 

 

Restart the networking service, in order for the changes to take effect, as follows:

 

service network restart 

An example of a network bridge formed from two or more bonded Ethernet interfaces will now be given as this is another common application in a virtualization environment. If you are not very familiar with the configuration files for bonded interfaces then please refer to Section 9.2.4, “Channel Bonding Interfaces”

 

 

Create or edit two or more Ethernet interface configuration files, which are to be bonded, as follows:

 

DEVICE=ethX
TYPE=Ethernet
USERCTL=no
SLAVE=yes
MASTER=bond0
BOOTPROTO=none
HWADDR=AA:BB:CC:DD:EE:FF
NM_CONTROLLED=no

 Note

 

Using ethX as the interface name is common practice but almost any name could be used. Names such as tap, dummy and bond are commonly used.

 

Create or edit one interface configuration file, /etc/sysconfig/network-scripts/ifcfg-bond0, as follows:

 

DEVICE=bond0
ONBOOT=yes
BONDING_OPTS='mode=1 miimon=100'
BRIDGE=brbond0
NM_CONTROLLED=no

For further instructions and advice on configuring the bonding module and to view the list of bonding parameters, refer to Section 28.7.2, “Using Channel Bonding”

 

Create or edit one interface configuration file, /etc/sysconfig/network-scripts/ifcfg-brbond0, as follows:

 

DEVICE=brbond0
ONBOOT=yes
TYPE=Bridge
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NM_CONTROLLED=no

 

 Figure 9.1. A network bridge consisting of two bonded Ethernet interfaces.

 

We now have two or more interface configuration files with the MASTER=bond0 directive. These point to the configuration file named /etc/sysconfig/network-scripts/ifcfg-bond0, which contains the DEVICE=bond0 directive. This ifcfg-bond0 in turn points to the /etc/sysconfig/network-scripts/ifcfg-brbond0 configuration file, which contains the IP address, and acts as an interface to the virtual networks inside the host.

Restart the networking service, in order for the changes to take effect, as follows:

 

 

 

 

 

  • 大小: 106.9 KB
分享到:
评论

相关推荐

    com.market.chenxiang_9.2.5.apk

    com.market.chenxiang_9.2.5.apk

    bind9.2.5.zip

    Bind是Berkeley Internet Name Domain Service的简写,它是一款实现DNS服务器的开放源码软件。Bind原本是美国DARPA资助伯克利大学(Berkeley)开设的一个研究生课题,后来经过多年的变化发展,已经成为世界上使用...

    电脑软件小影 v9.2.5.rar

    《电脑软件小影 v9.2.5:全能视频编辑工具的深度解析》 电脑软件小影是一款广受用户喜爱的视频编辑软件,版本号v9.2.5代表着其在功能和性能上的进一步优化与提升。这款软件以其丰富的功能、易用的操作界面以及出色...

    25) Bimber - BringThePixel 开发的传播式杂志 WordPress 主题 v9.2.5.zip

    Bimber - BringThePixel 开发的病毒式杂志 WordPress 主题 v9.2.5 具有以下特点: 一、设计方面 时尚现代的外观:可能拥有吸引人的布局和视觉设计,适合打造各种类型的在线杂志或内容丰富的网站。 响应式设计:能够...

    闪电VCD格式转换器 v9.2.5.zip

    闪电VCD格式转换器是一款功能强大的VCD格式转换工具,本软件可以轻松将各种流行的视频格式转换为VCD、SVCD、DVD视频格式。例如:您可以将流行的RM, RMVB, FLV, MP4, 3GP, MPG, MKV, WMV, AVI, SWF, DVD, MOV, XviD, ...

    FotoMix(相片合成器) v9.2.5.zip

    FotoMix是一个多功能的图片合成软件,使用者可以将不同的图片组合在一起,从而建立各种各样有趣的图像。您可以尽情发挥想像,由此软件生成的作品,可以用来制作照片拼贴画、插图、壁纸、DVD封面,甚至可以将图片转印...

    精易模块[v9.2.5].ec

    超级模块写g必备的模块

    bind-9.2.3.tar.gz

    《bind-9.2.3 DNS服务器安装与配置详解》 在互联网的基础设施中,DNS(Domain Name System)系统扮演着至关重要的角色,它将人类可读的域名转化为机器可识别的IP地址,使得网络通信得以顺利进行。...

    PE-V9.2.5-9048001.apk

    PE-V9.2.5-9048001.apk

    Frida安装大冒险:离线版(附全套资源)

    `frida-tools-9.2.5.tar.gz`是Frida的命令行工具包,包含了诸如`frida-server`、`frida-ps`等实用工具。这些工具可以帮助我们在终端上与Frida交互,如查看已连接的设备、启动服务器等。这个文件是tar.gz格式,需要先...

    《activmq in action 》

    4.2.2. Using Network Protocols ................................................ 87 4.2.3. Using the Virtual Machine Protocol .............................. 105 4.3. Configuring Network Connectors .......

    docker-qna:具有IBM BigFix QnA的Dockerfile的集合

    $ docker build -t bigfix/qna-centos:9.2.5 . $ docker run -t -i bigfix/qna-centos:9.2.5 BESClientActionMastheadPath not set and no masthead found Q: name of operating system A: Linux CentOS 7.1.1503 T:...

    Linux Networking Subsystem

    1.3 Sample Network Example . . . . . . . . . . . . . . . . . . . . 1 2 Initialization 3 2.1 Function do basic setup() . . . . . . . . . . . . . . . . . . . . 3 2.2 Function sock init() . . . . . . . ....

    sloth:现代的基于浏览器的 XMPP 客户端 (WIP)

    2014-12-11 13:44:22.880:INFO:oejs.Server:main: jetty-9.2.5.v20141112 2014-12-11 13:44:22.904:INFO:oejs.ServerConnector:main: Started ServerConnector@4a59d584{HTTP/1.1}{0.0.0.0:5050} 2014-12-11 13:44:...

    spring-memcache-sample:示例 Spring 项目,使用基于 memcached 的缓存后端缓存注释

    决赛ORM 杰克逊2.4.4 JSON 支持小时2 1.4.182 嵌入内存数据库简单弹簧内存缓存3.5.1-快照注释性 Memcached 缓存缓存2.9.0 在 JVM 缓存中码头跑者9.2.5.v20141112 Jetty 网络管理器webapp-runner 7.0.40.1 Tomcat ...

    精通WindowsAPI.pdf

    第1章 Windows应用程序开发入门..........................................................................................16 1.1 第一个实例程序...............................................................

    C++标准库(第二版)英文版.pdf

    The C++ Standard Library A Tutorial and Reference (2nd Edition)+cppstdlib-code.zip C++标准库(第二版)英文版.pdf 非扫描版+源代码 Prefaceto the SecondEdition xxiii Acknowledgments for the Second...

    PHPCMS_V9.2.5

    PHPCMS V9.2.5是该系统的某个稳定版本,提供了一系列更新和改进,以提升用户体验和系统性能。 PHPCMS的核心特性包括: 1. **多站点管理**:PHPCMS支持多站点集群,可以方便地管理和维护多个独立网站,共享同一后台...

    melhores-livros:投票最佳书籍的 Schulze 方法的实现

    #最佳书籍 ... 排名是使用计算的,可以随时... 码头 9.2.5.v20141112 Jetty Runner 7.5.4.v20111024 其他设置 Maven 根据您的 IDE,您可能需要下载和/或配置 。 环境变量 要使用运行集成测试,必须配置以下变量: webdr

    OPNET网络仿真教程

    比较适合第1 部分 OPNET Modeler 简介 第1 章 OPNET 仿真概述...........................................................................................6 1.1 网络仿真简介 1.2 OPNET 简介 ...

Global site tag (gtag.js) - Google Analytics