The translation is temporarily closed for contributions due to maintenance, please come back later.

Translation

(itstool) path: sect2/para
English
The Rapid Spanning Tree Protocol (<acronym>RSTP</acronym> or 802.1w) provides backwards compatibility with legacy <acronym>STP</acronym>. <acronym>RSTP</acronym> provides faster convergence and exchanges information with neighboring switches to quickly transition to forwarding mode without creating loops. FreeBSD supports <acronym>RSTP</acronym> and <acronym>STP</acronym> as operating modes, with <acronym>RSTP</acronym> being the default mode.
Context English Chinese (Simplified) (zh_CN) State
In FreeBSD, <citerefentry><refentrytitle>if_bridge</refentrytitle><manvolnum>4</manvolnum></citerefentry> is a kernel module which is automatically loaded by <citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry> when creating a bridge interface. It is also possible to compile bridge support into a custom kernel by adding <literal>device if_bridge</literal> to the custom kernel configuration file. 在 FreeBSD 中, <citerefentry><refentrytitle>if_bridge</refentrytitle><manvolnum>4</manvolnum></citerefentry> 是一个内核模块, 当创建桥接接口时, <citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>会自动加载。也可以通过在自定义内核配置文件中加入<literal>device if_bridge</literal>来为内核添加桥接功能。
The bridge is created using interface cloning. To create the bridge interface: 网桥使用端口克隆创建。使用以下命令创建网桥:
<prompt>#</prompt> <userinput>ifconfig bridge create</userinput>
bridge0
<prompt>#</prompt> <userinput>ifconfig bridge0</userinput>
bridge0: flags=8802&lt;BROADCAST,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
ether 96:3d:4b:f1:79:7a
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
<prompt>#</prompt> <userinput>ifconfig bridge create</userinput>
bridge0
<prompt>#</prompt> <userinput>ifconfig bridge0</userinput>
bridge0: flags=8802&lt;BROADCAST,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
ether 96:3d:4b:f1:79:7a
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
When a bridge interface is created, it is automatically assigned a randomly generated Ethernet address. The <literal>maxaddr</literal> and <literal>timeout</literal> parameters control how many <acronym>MAC</acronym> addresses the bridge will keep in its forwarding table and how many seconds before each entry is removed after it is last seen. The other parameters control how <acronym>STP</acronym> operates. 创建网桥接口时,会自动分配一个随机生成的以太网地址。<literal>maxaddr</literal>和<literal>timeout</literal>参数控制网桥将在转发表中保留多少个<acronym>MAC</acronym>地址,以及每个条目在最后一次被看到后多少秒后才会被删除。其他参数用于控制<acronym>STP</acronym>行为。
Next, specify which network interfaces to add as members of the bridge. For the bridge to forward packets, all member interfaces and the bridge need to be up: 接下来,指定要添加为网桥成员的网络接口。为了使网桥转发数据包,所有成员接口和网桥都必须处于启用状态:
<prompt>#</prompt> <userinput>ifconfig bridge0 addm fxp0 addm fxp1 up</userinput>
<prompt>#</prompt> <userinput>ifconfig fxp0 up</userinput>
<prompt>#</prompt> <userinput>ifconfig fxp1 up</userinput>
<prompt>#</prompt> <userinput>ifconfig bridge0 addm fxp0 addm fxp1 up</userinput>
<prompt>#</prompt> <userinput>ifconfig fxp0 up</userinput>
<prompt>#</prompt> <userinput>ifconfig fxp1 up</userinput>
The bridge can now forward Ethernet frames between <filename>fxp0</filename> and <filename>fxp1</filename>. Add the following lines to <filename>/etc/rc.conf</filename> so the bridge is created at startup: 该网桥现在可以在<filename>fxp0</filename>和<filename>fxp1</filename>之间转发以太网帧。将以下行添加到<filename>/etc/rc.conf</filename>,以便在启动时创建网桥:
cloned_interfaces="bridge0"
ifconfig_bridge0="addm fxp0 addm fxp1 up"
ifconfig_fxp0="up"
ifconfig_fxp1="up"
cloned_interfaces="bridge0"
ifconfig_bridge0="addm fxp0 addm fxp1 up"
ifconfig_fxp0="up"
ifconfig_fxp1="up"
If the bridge host needs an <acronym>IP</acronym> address, set it on the bridge interface, not on the member interfaces. The address can be set statically or via <acronym>DHCP</acronym>. This example sets a static <acronym>IP</acronym> address: 如果网桥主机需要<acronym>IP</acronym>地址,则将其设置在网桥接口上,而不是在成员接口上。该地址可以手工设置或通过<acronym>DHCP</acronym>分配。此示例将设置静态<acronym>IP</acronym>地址:
<prompt>#</prompt> <userinput>ifconfig bridge0 inet 192.168.0.1/24</userinput> <prompt>#</prompt> <userinput>ifconfig bridge0 inet 192.168.0.1/24</userinput>
It is also possible to assign an <acronym>IPv6</acronym> address to a bridge interface. To make the changes permanent, add the addressing information to <filename>/etc/rc.conf</filename>. 也可以将<acronym>IPv6</acronym>地址分配给网桥接口。要使更改持久化,请将地址信息添加到<filename>/etc/rc.conf</filename>中。
When packet filtering is enabled, bridged packets will pass through the filter inbound on the originating interface on the bridge interface, and outbound on the appropriate interfaces. Either stage can be disabled. When direction of the packet flow is important, it is best to firewall on the member interfaces rather than the bridge itself. 当启用数据包过滤功能时,桥接数据包将在桥接接口上的发端接口上的入站数据包通过过滤器,在适当的接口上的出站数据包通过过滤器。这两个阶段都可以禁用。当数据包流的方向很重要时,最好在成员接口上启用防火墙,而不是网桥本身。
The bridge has several configurable settings for passing non-<acronym>IP</acronym> and <acronym>IP</acronym> packets, and layer2 firewalling with <citerefentry><refentrytitle>ipfw</refentrytitle><manvolnum>8</manvolnum></citerefentry>. See <citerefentry><refentrytitle>if_bridge</refentrytitle><manvolnum>4</manvolnum></citerefentry> for more information. 该网桥有几个可配置选项,用于传递非<acronym>IP</acronym>和<acronym>IP</acronym>数据包,以及使用<citerefentry><refentrytitle>ipfw</refentrytitle><manvolnum>8</manvolnum></citerefentry>二层防火墙。详细信息请参阅 <citerefentry><refentrytitle>if_bridge</refentrytitle><manvolnum>4</manvolnum></citerefentry>。
Enabling Spanning Tree 开启Spanning Tree
For an Ethernet network to function properly, only one active path can exist between two devices. The <acronym>STP</acronym> protocol detects loops and puts redundant links into a blocked state. Should one of the active links fail, <acronym>STP</acronym> calculates a different tree and enables one of the blocked paths to restore connectivity to all points in the network. 为了使以太网网络正常运行,两个设备之间只能存在一条活动路径。<acronym>STP</acronym>协议会检测到环路,并将冗余链路置入阻塞状态。如果其中一条活动链路失效,<acronym>STP</acronym>会计算出不同的树,并使被阻塞的路径之一恢复到网络中所有点的连接。
The Rapid Spanning Tree Protocol (<acronym>RSTP</acronym> or 802.1w) provides backwards compatibility with legacy <acronym>STP</acronym>. <acronym>RSTP</acronym> provides faster convergence and exchanges information with neighboring switches to quickly transition to forwarding mode without creating loops. FreeBSD supports <acronym>RSTP</acronym> and <acronym>STP</acronym> as operating modes, with <acronym>RSTP</acronym> being the default mode. 快速生成树协议(<acronym>RSTP</acronym> 或 802.1w)兼容传统的<acronym>STP</acronym>协议。<acronym>RSTP</acronym> 提供了更快的收敛速度, 并与相邻交换机交换信息, 为了在不创建环路的情况下快速过渡到转发模式。FreeBSD 支持 <acronym>RSTP</acronym> 和 <acronym>STP</acronym> 作为工作模式, 其中 <acronym>RSTP</acronym> 是默认模式。
<acronym>STP</acronym> can be enabled on member interfaces using <citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>. For a bridge with <filename>fxp0</filename> and <filename>fxp1</filename> as the current interfaces, enable <acronym>STP</acronym> with: 可以使用<citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>在成员接口上启用<acronym>STP</acronym>。对于当前接口为<filename>fxp0</filename>和<filename>fxp1</filename>的网桥,使用以下命令启用<acronym>STP</acronym>:
<prompt>#</prompt> <userinput>ifconfig bridge0 stp fxp0 stp fxp1</userinput>
bridge0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
ether d6:cf:d5:a0:94:6d
id 00:01:02:4b:d4:50 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
root id 00:01:02:4b:d4:50 priority 32768 ifcost 0 port 0
member: fxp0 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 3 priority 128 path cost 200000 proto rstp
role designated state forwarding
member: fxp1 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 4 priority 128 path cost 200000 proto rstp
role designated state forwarding
<prompt>#</prompt> <userinput>ifconfig bridge0 stp fxp0 stp fxp1</userinput>
bridge0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
ether d6:cf:d5:a0:94:6d
id 00:01:02:4b:d4:50 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
root id 00:01:02:4b:d4:50 priority 32768 ifcost 0 port 0
member: fxp0 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 3 priority 128 path cost 200000 proto rstp
role designated state forwarding
member: fxp1 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 4 priority 128 path cost 200000 proto rstp
role designated state forwarding
This bridge has a spanning tree ID of <literal>00:01:02:4b:d4:50</literal> and a priority of <literal>32768</literal>. As the <literal>root id</literal> is the same, it indicates that this is the root bridge for the tree. 这个桥接的生成树ID为<literal>00:01:02:4b:d4:50</literal>,优先级为<literal>32768</literal>。由于<literal>root id</literal>是相同的,这表明这是该树的根桥。
Another bridge on the network also has <acronym>STP</acronym> enabled: 网络上的另一个网桥也启用了 <acronym>STP</acronym>:
bridge0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
ether 96:3d:4b:f1:79:7a
id 00:13:d4:9a:06:7a priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
root id 00:01:02:4b:d4:50 priority 32768 ifcost 400000 port 4
member: fxp0 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 4 priority 128 path cost 200000 proto rstp
role root state forwarding
member: fxp1 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 5 priority 128 path cost 200000 proto rstp
role designated state forwarding
bridge0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
ether 96:3d:4b:f1:79:7a
id 00:13:d4:9a:06:7a priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
root id 00:01:02:4b:d4:50 priority 32768 ifcost 400000 port 4
member: fxp0 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 4 priority 128 path cost 200000 proto rstp
role root state forwarding
member: fxp1 flags=1c7&lt;LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP&gt;
port 5 priority 128 path cost 200000 proto rstp
role designated state forwarding
The line <literal>root id 00:01:02:4b:d4:50 priority 32768 ifcost 400000 port 4</literal> shows that the root bridge is <literal>00:01:02:4b:d4:50</literal> and has a path cost of <literal>400000</literal> from this bridge. The path to the root bridge is via <literal>port 4</literal> which is <filename>fxp0</filename>. The line <literal>root id 00:01:02:4b:d4:50 priority 32768 ifcost 400000 port 4</literal>显示根网桥是<literal>00:01:02:4B:D4:50</literal>,从这个网桥的路径费用为<literal>400000</literal>。到 root 网桥的路径是通过<literal>port 4</literal>,它是<filename>fxp0</filename>。
Bridge Interface Parameters 桥接界面参数
Several <command>ifconfig</command> parameters are unique to bridge interfaces. This section summarizes some common uses for these parameters. The complete list of available parameters is described in <citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>. 有几个<command>ifconfig</command>参数是网桥接口所特有的。本节总结了这些参数的一些常用用途。可用参数的完整列表在 <citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>中描述。
private private
A private interface does not forward any traffic to any other port that is also designated as a private interface. The traffic is blocked unconditionally so no Ethernet frames will be forwarded, including <acronym>ARP</acronym> packets. If traffic needs to be selectively blocked, a firewall should be used instead. 私有接口不会转发流量到其他私有接口。流量被无条件阻止,因此不会转发任何以太网帧,包括<acronym>ARP</acronym>数据包。如果需要选择性地阻止流量,应使用防火墙。
span span
A span port transmits a copy of every Ethernet frame received by the bridge. The number of span ports configured on a bridge is unlimited, but if an interface is designated as a span port, it cannot also be used as a regular bridge port. This is most useful for snooping a bridged network passively on another host connected to one of the span ports of the bridge. For example, to send a copy of all frames out the interface named <filename>fxp4</filename>: 跨接端口传输网桥接收到的每一个以太网帧的副本。网桥上配置的跨接端口的数量是无限的,但如果一个接口被指定为跨接端口,则不能同时作为普通网桥端口使用。这对于被动地窥探桥接网络中连接到桥接端口之一的另一台主机上的桥接主机是最有用的。例如,将所有帧的副本发送到名为<filename>fxp4</filename>的接口:
<prompt>#</prompt> <userinput>ifconfig bridge0 span fxp4</userinput> <prompt>#</prompt> <userinput>ifconfig bridge0 span fxp4</userinput>
sticky sticky
If a bridge member interface is marked as sticky, dynamically learned address entries are treated as static entries in the forwarding cache. Sticky entries are never aged out of the cache or replaced, even if the address is seen on a different interface. This gives the benefit of static address entries without the need to pre-populate the forwarding table. Clients learned on a particular segment of the bridge cannot roam to another segment. 如果网桥成员接口被标记为 "粘性(sticky)",则动态学习的地址条目将被视为转发缓存中的静态条目。即使在不同的接口上看到该地址,粘性条目也不会从缓存中老化或被替换。这就带来了静态地址项的好处,而不需要预先填充转发表。在网桥的某个网段上学习的客户端不能漫游到另一个网段。

Loading…

The Rapid Spanning Tree Protocol (<acronym>RSTP</acronym> or 802.1w) provides backwards compatibility with legacy <acronym>STP</acronym>. <acronym>RSTP</acronym> provides faster convergence and exchanges information with neighboring switches to quickly transition to forwarding mode without creating loops. FreeBSD supports <acronym>RSTP</acronym> and <acronym>STP</acronym> as operating modes, with <acronym>RSTP</acronym> being the default mode.
快速生成树协议(<acronym>RSTP</acronym> 或 802.1w)兼容传统的<acronym>STP</acronym></acronym>协议。<acronym>RSTP</acronym> 提供了更快的收敛速度, 并与相邻交换机交换信息, 为了在不创建环路的情况下快速过渡到转发模式。FreeBSD 支持 <acronym>RSTP</acronym> 和 <acronym>STP</acronym> 作为工作模式, 其中 <acronym>RSTP</acronym> 是默认模式。
8 months ago

Build error, needs editing.

8 months ago
The Rapid Spanning Tree Protocol (<acronym>RSTP</acronym> or 802.1w) provides backwards compatibility with legacy <acronym>STP</acronym>. <acronym>RSTP</acronym> provides faster convergence and exchanges information with neighboring switches to quickly transition to forwarding mode without creating loops. FreeBSD supports <acronym>RSTP</acronym> and <acronym>STP</acronym> as operating modes, with <acronym>RSTP</acronym> being the default mode.
快速生成树协议(<acronym>RSTP</acronym> 或 802.1w)兼容传统的<acronym>STP</acronym></acronym>协议。<acronym>RSTP</acronym> 提供了更快的收敛速度, 并与相邻交换机交换信息, 为了在不创建环路的情况下快速过渡到转发模式。FreeBSD 支持 <acronym>RSTP</acronym> 和 <acronym>STP</acronym> 作为工作模式, 其中 <acronym>RSTP</acronym> 是默认模式。
8 months ago
The Rapid Spanning Tree Protocol (<acronym>RSTP</acronym> or 802.1w) provides backwards compatibility with legacy <acronym>STP</acronym>. <acronym>RSTP</acronym> provides faster convergence and exchanges information with neighboring switches to quickly transition to forwarding mode without creating loops. FreeBSD supports <acronym>RSTP</acronym> and <acronym>STP</acronym> as operating modes, with <acronym>RSTP</acronym> being the default mode.
快速生成树协议(<acronym>RSTP</acronym> 或 802.1w)兼容传统的<acronym>STP</acronym></acronym>协议。<acronym>RSTP</acronym> 提供了更快的收敛速度, 并与相邻交换机交换信息, 为了在不创建环路的情况下快速过渡到转发模式。FreeBSD 支持 <acronym>RSTP</acronym> 和 <acronym>STP</acronym> 作为工作模式, 其中 <acronym>RSTP</acronym> 是默认模式。
9 months ago
Browse all component changes
User avatar dbaio

Translation comment

Build error, needs editing.

8 months ago

Glossary

English Chinese (Simplified) (zh_CN)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect2/para
Source string location
book.translate.xml:65535
String age
a year ago
Source string age
a year ago
Translation file
books/zh_CN/handbook.po, string 10992