BRCTL Instructions for use

Source: Internet
Author: User

[Email protected] ~]# Brctl--help
Usage:brctl [Commands]
ADDBR <bridge> Add Bridge
DELBR <bridge> Delete Bridge
ADDIF <bridge> <device> add interface to bridge
Delif <bridge> <device> Delete interface from bridge
Setageing <bridge> <time> Set ageing time
Setbridgeprio <bridge> <prio> Set Bridge priority
SETFD <bridge> <time> Set Bridge forward delay
Sethello <bridge> <time> Set Hello time
Setmaxage <bridge> <time> set Max message age
Setpathcost <bridge> <port> <cost> set path cost
Setportprio <bridge> <port> <prio> Set Port priority
Show show a list of bridges
Showmacs <bridge> show a list of Mac Addrs
SHOWSTP <bridge> Show Bridge STP info
STP <bridge> {On|off} turn STP on/off

The name of the Addbr bridge #添加bridge;
The name of the Delbr bridge #删除bridge;
ADDIF Bridge name of the device name # Add interface to bridge;
Delif Bridge name Device Name # Remove an interface from bridge
Setageing Bridge name Time #设置老化时间, that is, the life cycle
Setbridgeprio Bridge name Priority # Set Bridge priority
SETFD Bridge Name Time #设置bridge转发延迟时间
Sethello Bridge Name Time #设置hello时间
Setmaxage Bridge Name Time #设置消息的最大生命周期
Setpathcost Bridge Name Port weight # Sets the weight of the path
Setportprio Bridge name Port Priority # Set Port priority
Show #显示bridge列表
Name of the Showmacs bridge #显示MAC地址
Name of the SHOWSTP bridge #显示bridge的stp信息
Name of the STP bridge {On|off} #开/off STP

Set up Linux let the bridge run Configure the bridge
We need to let Linux know the bridge, first tell it, we want a virtual Ethernet Bridge interface: (this will be performed on the host bridge, not a clear look at the test scenario)
[Email protected]:~> brctl ADDBR br0
Second, we don't need STP (spanning Tree Protocol) and so on. Because we have only one router, it is absolutely impossible to form a ring. We can turn this feature off. (This can also reduce packet contamination in the network environment):
[Email protected]:~> brctl STP br0 off
After these preparations, we can finally do something immediate. We add two (or more) Ethernet physical interfaces, meaning: we attach them to the newly generated logical (virtual) bridge interface Br0.
[Email protected]:~> brctl addif br0 eth0
[Email protected]:~> brctl addif br0 eth1
Now, our two Ethernet physical interfaces turned out to be two logical ports on the bridge. The two physical interfaces used to exist and the future will not disappear. If you don't believe me, go check it out. Now they are part of the logical bridge device, so the IP address is no longer required. Now let's release these IP addresses.
[Email protected]:~> ifconfig eth0 down
[Email protected]:~> ifconfig eth1 down
[Email protected]:~> ifconfig eth0 up
[Email protected]:~> ifconfig eth1 up

All right! We now have a box w/o with no IP address. OK, so if you want to configure your firewall or router with TP, you can only go through the local control port. You're not going to tell me you don't have a serial port on your machine, do you?
Note: The red part above is actually optional, in the experiment, I found that even if the original network card address is released, the bridge can also work! However, in order to be more normative, or to avoid any inexplicable problem, it is best to do as required, to carry out these four steps!

Finally, enable the Network Bridge [email protected]:~> ifconfig br0 up

Optional: We assign an IP address to this new bridge interface
[Email protected]:~> ifconfig br0

Or take the last two steps to synthesize one step:
[Email protected]:~> ifconfig br0 up
Just one more up!.

We're done here.
Close the bridge command

Brctl Delif Ena eth1;
Brctl Delif ena eth0;
Ifconfig ena down;
Brctl DELBR Ena;

Excerpted from

BRCTL Instructions for use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.