Brctl command

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 08:33, 8 April 2008 (edit)
Christoph78 (Talk | contribs)
(Show)
← Previous diff
Revision as of 18:59, 9 January 2009 (edit) (undo)
Alvin (Talk | contribs)
m
Next diff →
Line 1: Line 1:
 +You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Telnet/SSH_and_the_Command_Line|SSH/Telnet & The CLI]] / brctl '''
 +
BRCTL is used to create a bridge between two interfaces. BRCTL is used to create a bridge between two interfaces.
Line 95: Line 97:
[[Category:English documentation]] [[Category:English documentation]]
[[Category:commandline command reference]] [[Category:commandline command reference]]
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-<div style="display:none"> 
-[l_sp_30] 
-[http://there-it-go-the-whistle-song-juelz-santana.ocom.pl there it go the whistle Song Juelz Santana] 
-[http://rascal-flatts-me-and-my-gang.ocom.pl Rascal Flatts Me and My Gang] 
-[http://neil-sedaka-the-best-of.ocom.pl Neil Sedaka The Best Of] 
-[http://alison-krauss-a-hundred-miles-or-more-a-collection.ocom.pl Alison Krauss A Hundred Miles or More A Collection] 
-[http://nickelback-all-the-right-reasons.ocom.pl Nickelback All The Right Reasons] 
-[http://martina-mcbride-waking-up-laughing.ocom.pl Martina McBride Waking Up Laughing] 
-[http://fergie-featuring-ludacris-glamorous.ocom.pl Fergie Featuring Ludacris Glamorous] 
- 
-[http://miguel-bose-papito-cd1.ocom.pl Miguel Bose Papito CD1] 
-[http://beyonce-b-day-delux-edition.ocom.pl Beyonce B Day Delux Edition] 
-[http://kou-shibasaki-kiki.ocom.pl Kou Shibasaki Kiki]  
-[http://christophe-willem-inventaire.ocom.pl Christophe Willem Inventaire] 
-[http://elton-john-rocket-man-the-definitive-hits.ocom.pl Elton John Rocket Man - the Definitive Hits] 
-[http://carrie-underwood-some-hearts.ocom.pl Carrie Underwood Some Hearts] 
-[http://the-cranberries-fee-fi-fo.ocom.pl The Cranberries Fee Fi Fo] 
-[http://joe-ain-t-nothing-like-me-ep.ocom.pl Joe Ain t Nothing Like Me EP] 
-[http://rem-sad-professor.ocom.pl REM Sad professor] 
-[http://kat-tun-cartoon-kat-tun-ii-you-cd1.ocom.pl KAT-TUN Cartoon KAT-TUN II You CD1] 
-[http://dj-tiesto-elements-of-life.ocom.pl DJ Tiesto Elements Of Life] 
-[http://robin-thicke-the-evolution-of-robin-thicke.ocom.pl Robin Thicke The Evolution of Robin Thicke] 
-</div> 

Revision as of 18:59, 9 January 2009

You are here: DD-WRT wiki mainpage / SSH/Telnet & The CLI / brctl

BRCTL is used to create a bridge between two interfaces.

Contents

Bridges

View

To view the current bridges, use the following command on a SSH/Telnet terminal:

 brctl show

The command will then output a bridge name (Often br0 or br1), bridge ID (Used to uniquely specify the bridge), and the current settings for STP (Spanning Tree Protocol). The output wil be formated similar to this:

 bridge name     bridge id               STP enabled
 br0             8000.001217318d3e       yes

Add

A bridge can be added using the following command, with <name> being replaced with the name of the bridge being replaced.

 brctl addbr <name>

Delete

Where name is the user specified name of the bridge. To delete a bridge, one would use

brctl delbr <name>

Interfaces

Although the preceding commands simply create an instance of a bridge, in order to use them, one must add interfaces to a bridge. The bridge "br0" is standard bridge on DD-WRT.

Show

In order to show the current interfaces that are members of a bridge, we use a command similar to the "show" command:

 brctl showbr br0 (for V23SP2: brctl showstp br0)

This would generate output similar to the following:

 br0
  bridge id              8000.001217318d3e
  designated root        8000.001217318d3e
  root port                 0                    path cost                  0
  max age                  20.00                 bridge max age            20.00
  hello time                2.00                 bridge hello time          2.00
  forward delay             0.00                 bridge forward delay       0.00
  ageing time              42.30                 gc interval                4.00
  hello timer               1.28                 tcn timer                  0.00
  topology change timer     0.00                 gc timer                   2.02
 flags
 
 vlan0 (1)
  port id                8001                    state                   forwarding
  designated root        8000.001217318d3e       path cost                100
  designated bridge      8000.001217318d3e       message age timer          0.00
  designated port        8001                    forward delay timer        0.00
  designated cost           0                    hold timer                 0.00
  flags
 
 eth1 (2)
  port id                8002                    state                   forwarding
  designated root        8000.001217318d3e       path cost                100
  designated bridge      8000.001217318d3e       message age timer          0.00
  designated port        8002                    forward delay timer        0.00
  designated cost           0                    hold timer                 0.00
  flags

Here we can see that the bridge contains two members, eth0 and vlan0.

Add

To add a interface to a bridge, the command syntax is

 brctl addif <brname> <ifname>

Where <brname> is the existing bridge name, and ifname is the interface you want to add.

Remove

To remove a interface from a bridge, the syntax is very similar

brctl delif <brname> <ifname>

Other Features

There are a few other features that brctl offers, but they are beyond the scope of this page. In order to get a better understanding of them, you should read the brctl Manual Page.

One KEY thing to note is that the brctl commands slightly differ from the man page. Especially the "show" command. The documentation that i suggested recommends "brctl show <brname>" but in DD-WRT the proper syntax is "brctl showbr <brname>". If you have any doubts, simply type "brctl" and a list of available commands will be displayed.

External Links

http://www.tinc-vpn.org/examples/bridging
http://linuxcommand.org/man_pages/brctl8.html