brctl 命令
2016-06-13 by dongnan
举个栗子
安装 docker 后出现一个桥接设备 docker0
brctl show
bridge name    bridge id        STP enabled    interfaces
docker0        8000.0242c542737d    no        veth42e6b00
                                              vetha28b4a2
                                              vethb2d503f
                                              vethc9ff647
关闭网桥设备
ip link set dev docker0 down
删除网桥设备
brctl delbr docker0
帮助
命令功能
man brctl
NAME
       brctl - ethernet bridge administration
SYNOPSIS
       brctl [command]
DESCRIPTION
       brctl is used to set up, maintain, and inspect the ethernet bridge configuration in the linux kernel.
       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.
命令参数
brctl --help
Usage: brctl [commands]
commands:
    addbr         <bridge>        add bridge
    delbr         <bridge>        delete bridge
    addif         <bridge> <device>    add interface to bridge
    delif         <bridge> <device>    delete interface from bridge
    hairpin       <bridge> <port> {on|off}    turn hairpin on/off
    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          [ <bridge> ]        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