
我們正在使用 Cisco Catalyst 1000 交換器(準確地說是 C100-16P-2G-L),並且在將標記的組播從一個連接埠傳遞到另一個連接埠時遇到了麻煩。我們想按原樣傳遞它(標記),我認為這應該是可能的,但如何配置(我們需要傳遞 vlan id = 257 的多播流量)?預設配置肯定不行。
與預設配置相關的一些其他詳細資訊:
- 已標記 (id=257) 多播不是路過!
- 未標記的多播是經過
- 標記單播是經過
這種類型的交換器預設 vlan=1,因此如果我發送標記有 vlan id=1 的多播流量,它就會取消標記 - 這不是我需要的。
我還發現:
Switch#show topology
Topology Address Family Associated VRF State
base ipv4 default UP
base ipv6 default DOWN
base ipv4 multicast default DOWN
base ipv6 multicast default DOWN
可能有關係,如何改變拓樸?
這些資料包是從主機發送的:
$ sudo mz v_eno1 -v -c 0 -d 1s -B 239.0.0.5 -t udp "dp=32000" -P "AAAA"
IP: ver=4, len=32, tos=0, id=0, frag=0, ttl=255, proto=17, sum=0, SA=198.19.4.250, DA=239.0.0.5,
payload=[see next layer]
UDP: sp=0, dp=32000, len=12, sum=0,
payload=41:41:41:41
....
在主機上擷取:
$ tcpdump -nn "udp port 32000 or (vlan and udp port 32000)" -e -i eno1 -Xvvv
16:20:02.364860 f6:e0:32:f0:7b:74 > 01:00:5e:00:00:05, ethertype 802.1Q (0x8100), length 50: vlan 257, p 0, ethertype IPv4, (tos 0x0, ttl 255, id 26302, offset 0, flags [none], proto UDP (17), length 32)
198.19.4.250.0 > 239.0.0.5.32000: [udp sum ok] UDP, length 4
0x0000: 4500 0020 66be 0000 ff11 9afb c613 04fa E...f...........
0x0010: ef00 0005 0000 7d00 000c 4640 4141 4141 ......}...F@AAAA
更新1
嘗試在傳入/傳出連接埠上設定中繼,但是:
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface GigabitEthernet1/0/2
Switch(config-if)#switchport mode trunk
Switch(config-if)#vlan dot1q tag native
^
% Invalid input detected at '^' marker.
Switch(config-if)#switchport trunk ?
allowed Set allowed VLAN characteristics when interface is in trunking mode
native Set trunking native characteristics when interface is in trunking
mode
pruning Set pruning VLAN characteristics when interface is in trunking mode
我應該選擇中繼模式嗎?
更新2
連接埠之一的目前設定:
Switch#show interfaces GigabitEthernet1/0/4 switchport
Name: Gi1/0/4
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: disabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
更新3
嘗試在 2 個連接埠上設定中繼後:
interface GigabitEthernet1/0/2
switchport trunk allowed vlan 257
switchport trunk native vlan 257
switchport mode trunk
interface GigabitEthernet1/0/4
switchport trunk allowed vlan 257
switchport trunk native vlan 257
switchport mode trunk
還是沒有穿越…
答案1
此特定交換器型號不允許標記本機 VLAN,根據思科文檔:
一般限制
- 不支援本機 VLAN 標記,且本機 VLAN dot1q 標記 命令不可用。
如果您希望在中繼介面上標記 VLAN 1(預設本機 VLAN),則需要將本機 VLAN 變更為不同的 VLAN 編號,如下所示:
switchport trunk native vlan 12
了解大多數終端設備(PC、印表機、伺服器等)通常不理解標記幀並將其視為損壞而丟棄,因此您必須確保連接到中繼介面的設備支援並配置為理解標記幀(中繼)。
此外,第 2 層安全最佳實務是永遠不要使用 VLAN 1 或中繼本機 VLAN。將存取介面指派給不同的 VLAN 編號,並使用該switchport trunk allowed
指令限制中繼介面上的本徵 VLAN。
預設 VLAN 和本徵 VLAN 是兩個不同的概念,儘管預設情況下它們都是 VLAN 1。