eth1
인터페이스 와 다음 을 포함하는 Linux 커널 가상 브리지가 있습니다 tap0
.
# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.00016c404fa3 no eth1
tap0
#
이제 가상 스위치의 MAC 주소 테이블을 보면 포트 번호 2
( tap0
인터페이스)와 3
( eth1
인터페이스)가 표시됩니다.
# brctl showmacs br0
port no mac addr is local? ageing timer
3 00:00:5e:00:01:c9 no 0.11
3 00:01:6c:40:2d:94 no 0.53
3 00:01:6c:40:4f:a3 yes 0.00
3 00:01:6c:55:3a:72 no 55.33
3 00:02:b3:8d:48:a7 no 0.53
3 00:0a:e4:2f:53:bb no 0.59
3 00:0b:82:0a:bc:cc no 16.98
3 00:0c:29:07:3e:de no 9.12
3 00:0c:29:94:95:39 no 156.77
3 00:11:25:8c:7a:1a no 16.50
3 00:11:5c:13:af:51 no 0.42
3 00:15:60:5f:73:ee no 84.73
3 00:16:3e:4b:8e:2f no 175.61
3 00:19:e2:94:0b:f0 no 7.48
3 00:19:e2:9e:df:f0 no 0.00
3 00:1c:c0:61:20:a9 no 68.12
3 00:23:7d:83:c8:9f no 26.35
3 00:25:9c:6e:74:e1 no 157.58
3 00:90:fb:47:d0:8c no 0.46
3 08:00:23:97:d0:87 no 14.62
3 24:be:05:1f:71:82 no 0.56
3 24:be:05:1f:71:85 no 0.51
3 24:be:05:25:95:8f no 0.55
3 4c:11:bf:98:ea:4f no 6.18
3 4c:11:bf:9c:60:52 no 32.01
3 78:24:af:37:10:70 no 51.89
3 78:24:af:37:11:06 no 50.89
3 88:51:fb:ec:45:1e no 7.12
2 f6:b8:99:06:0b:65 yes 0.00
#
가상 브리지에 연결하기 위한 포트 번호는 무엇입니까 1
?
답변1
다음은 브리지된 Linux 시스템 중 하나의 출력입니다. 를 사용하면 brctl showstp
브리지 관련 인터페이스와 해당 스패닝 트리 매개변수 목록을 인쇄할 수 있습니다. 괄호 안에는 인터페이스를 구성하는 인터페이스 인덱스가 있습니다. 이는 에서 참조되는 것입니다 brctl showmacs
.
# brctl show
bridge name bridge id STP enabled interfaces
br0 3000.0a32fb000000 yes tap0
tap1
tap14
tap3
tap4
tap5
tap8
tap9
# brctl showstp br0
br0
bridge id 3000.0a32fb000000
designated root 3000.0a32fb000000
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 15.00 bridge forward delay 15.00
ageing time 300.00
hello timer 0.06 tcn timer 0.00
topology change timer 0.00 gc timer 139.36
flags
tap0 (1)
port id 8001 state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 8001 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
tap1 (2)
port id 8002 state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 8002 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
tap14 (12)
port id 800c state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 800c forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
tap3 (3)
port id 8003 state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 8003 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
tap4 (4)
port id 8004 state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 8004 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
tap5 (5)
port id 8005 state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 8005 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
tap8 (6)
port id 8006 state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 8006 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
tap9 (8)
port id 8008 state forwarding
designated root 3000.0a32fb000000 path cost 100
designated bridge 3000.0a32fb000000 message age timer 0.00
designated port 8008 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
# brctl showmacs br0
port no mac addr is local? ageing timer
8 00:00:00:16:d7:28 yes 0.00
12 00:00:00:23:4c:3b yes 0.00
1 00:00:00:24:fb:74 yes 0.00
8 00:00:00:54:20:b5 no 44.91
2 00:00:00:5b:14:3d yes 0.00
6 00:00:00:6b:dc:8c no 45.22
4 00:00:00:81:6d:8d no 45.03
1 00:00:00:81:6d:92 no 45.00
2 00:00:00:a2:4f:16 no 7.24
8 00:00:00:a2:4f:7e no 53.66
2 00:00:00:a2:4f:9e no 25.54
2 00:00:00:b1:8a:35 no 44.86
3 00:00:00:b8:14:87 yes 0.00
5 00:00:00:c2:7b:d2 no 16.28
12 00:00:00:d4:6c:ea no 45.02
4 00:00:00:ee:25:9f yes 0.00
5 00:00:00:ef:01:b2 no 0.57
인터페이스 인덱스 번호가 왜 연속적이지 않은지 질문하실 수 있습니다. 음, 처음에는 브리지를 시작하고 여기에 인터페이스를 추가하면 그렇게 됩니다. 그런 다음 인터페이스를 삭제하면 브리지에 남아 있는 인터페이스의 번호가 재정렬되지 않습니다. 그러나 브리지에 인터페이스를 다시 추가하기 시작하면 이러한 구멍이 채워집니다.