bridge link на коммутаторах выведите параметры всех связанных с сетевым мостом интерфейсов.
[root@first ~]# bridge link
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5
[root@first ~]#
[root@second ~]# bridge link
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5
[root@second ~]#
stp_state, priority, bridge_id, designated_port, root_port.
[root@first ~]# ip -d link show br0 | grep root
bridge <...> stp_state 0 priority 32768 <...>
bridge_id 8000.8:0:27:26:29:ce designated_root 8000.8:0:27:26:29:ce root_port 0 <...>
[root@first ~]#
[root@second ~]# ip -d link show br0 | grep root
bridge <...> stp_state 0 priority 32768 <...>
bridge_id 8000.8:0:27:5a:86:5c designated_root 8000.8:0:27:5a:86:5c root_port 0 <...>
[root@second ~]#
ip link set dev br0 type bridge stp_state 1 на коммутаторах включите протокол STP. С помощью команд управления интерфейсами и сетевым мостом выведите параметры интерфейсов и моста.
[root@first ~]# ip link set dev br0 type bridge stp_state 1<Some time later>[root@first ~]# ip -d link show br0 | grep rootbridge <...> stp_state 1 priority 32768 <...> bridge_id 8000.8:0:27:26:29:ce designated_root 8000.8:0:27:26:29:ce root_port 0 <...>[root@first ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 [root@first ~]#
[root@second ~]# ip link set dev br0 type bridge stp_state 1<Some time later>[root@second ~]# ip -d link show br0 | grep rootbridge <...> stp_state 1 priority 32768 <...> bridge_id 8000.8:0:27:5a:86:5c designated_root 8000.8:0:27:26:29:ce root_port 1 <...>[root@second ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state blocking priority 32 cost 5 [root@second ~]#
bridge_id. У зависимого коммутатора при этом меняются значения designated_root и root_port.
Примечание
[root@second ~]# ip link set dev br0 type bridge priority 4096[root@second ~]# ip -d link show br0 | grep prioritybridge <...> priority 4096 <...> bridge_id 1000.8:0:27:5a:86:5c designated_root 1000.8:0:27:5a:86:5c root_port 0 <...>[root@second ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state listening priority 32 cost 5 <Some time later>[root@second ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5
<Some time later>[root@first ~]# ip -d link show br0 | grep prioritybridge <...> priority 32768 <...> bridge_id 8000.8:0:27:26:29:ce designated_root 1000.8:0:27:5a:86:5c root_port 1 <...>[root@first ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state blocking priority 32 cost 5 [root@first ~]#
[root@second ~]# bridge link set dev eth1 priority 63[root@second ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 63 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 [root@second ~]#
priority у соседа.
<Some time later>[root@first ~]# ip -d link show br0 | grep prioritybridge <...> priority 32768 <...> bridge_id 8000.8:0:27:26:29:ce designated_root 1000.8:0:27:5a:86:5c root_port 2 <...>[root@first ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state blocking priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state listening priority 32 cost 5 [root@first ~]#
[root@first ~]# bridge link set dev eth2 cost 20000[root@first ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state listening priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state blocking priority 32 cost 20000 <Some time later>[root@first ~]# bridge link3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 5 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state blocking priority 32 cost 20000 [root@first ~]#