為語音 VLAN 設定 Dell PowerConnect 5500 系列交換器
摘要: 本文提供為語音 VLAN 設定 Dell PowerConnect 5500 系列交換器的必要步驟。
症狀
語音 VLAN 是 PowerConnect 55xx 系列交換器的一項功能,可使用服務等級 (CoS) 自動優先處理交換器內 VoIP 流量。當交換器存在混合流量環境和高頻寬使用情況時,此功能有助於防止通話品質下降。本文還介紹了將 VoIP 電話新增到網路的簡便性,所需的設定很少或根本無需設定。
若要設定交換器,系統管理員可新增:
- 電話的 MAC 組織唯一識別碼 (OUI) 到交換器的 OUI 表格。
- 在 VLAN 資料庫中建立 VLAN 後的全域語音 VLAN ID。
原因
在此範例中,00:03:b5 是 MAC OUI,Joes_VoIP_Phones 是廠商名稱。
Console(config)# voice vlan oui-table add 0003b5 Joes_VoIP_Phones
在此範例中,VLAN 10 是 VoIP 流量的所在位置。
Console(config)# vlan database
Console(config-vlan)# vlan 10
Console(config-vlan)# exit
Console(config)# voice vlan id 10
在連接 VoIP 電話的連接埠上,為了啟用語音 VLAN,連接埠不能是 VLAN 的靜態成員。
在連接埠 13、交換器單元 1 上,從中繼中移除 VLAN 10 並啟用語音 VLAN。
Console(config)# interface gigabitethernet 1/0/13
Console(config-if)# switchport mode trunk
Console(config-if)# switchport trunk allowed vlan remove 10
Console(config-if)# voice vlan enable
管理員將電話插入至為語音 VLAN 設定的交換器介面。使用與語音 VLAN ID 和 MAC OUI 相符的標籤進入交換器的電話流量會動態指派給語音 VLAN。交換器預設會自動將 VoIP 流量指派給 CoS 6,並使其優先於較低佇列中的其他流量。任何進入交換器連接埠的未標記流量 (如 PC 資料),都會指派給原生 VLAN。當連接埠處於中繼模式時,原生預設為 VLAN 1。
除預設值外,可以變更語音 VLAN 的 CoS 設置,並於出口上備註流量,但這是不必要的。CoS 6 是針對 VoIP 流量建議的最高優先順序。CoS 7 是可指派的最高優先順序,但通常僅用於控制流量,不建議用於大多數過境流量。如果決定優先使用差異式服務區分碼 (DSCP),則可將「信任 CoS」的設定變更為「信任 DSCP」。這將允許交換器信任已指派的 DSCP 值,並根據指派值對其進行優先處理。通常,DSCP 46 或快速轉送是用於 VoIP 優先順序的值。交換器已經有 DSCP 對佇列的對應,可將 DSCP 46 對應至高優先順序佇列 6。DSCP 46 預設會指派給與 CoS 6 相同的交換佇列。您可以在 QoS 進階模式中變更此對應表。信任 DSCP 設定會影響全域交換器,並考慮在信任模式下進入交換器連接埠的所有流量。如果進入連接埠的其他流量具有高於該流量的 DSCP 值,則會優先處理其他流量。如需有關 QoS 設定的詳細資訊,請參閱 PowerConnect 5548 支援頁面上的 PowerConnect 5548 使用者指南。
「語音 VLAN 安全」設定預設為未啟用。這表示一旦在連接埠上啟用了語音 VLAN,就允許具有無法辨識之 OUI 的訊框存取語音 VLAN。如果在連接埠上啟用了「語音 VLAN 安全」設定,則會捨為具有無法辨識之 OUI 的語音 VLAN 標記的任何訊框。
在這裡,我們在連接埠 13 交換器單元 1 上啟用「語音 VLAN 安全」。如果插入連接埠的使用者嘗試針對 VLAN 10 (即語音 VLAN) 標記其 PC 流量,交換器便會捨棄流量。
Console(config)# interface gigabitethernet 1/0/13
Console(config-if)# voice vlan secure
設定與所連接之其他 VoIP 裝置 (如電話系統伺服器 (PBX) 或 VoIP 交換器) 的介面時,最佳作法是靜態指派連接埠。這是因為這些類型的裝置大多不知道 VLAN,這表示它們不支援 VLAN 標記。要在連接埠上啟用語音 VLAN 或動態新增裝置,必須為語音 VLAN 標記流量。將裝置靜態新增至 VLAN 時,連接靜態新增裝置的連接埠不會啟用語音 VLAN 功能。預設不會優先處理來自裝置的流量。若要優先處理此流量,當已為流量指派 CoS 或 DSCP 值時,則可以使用 CoS 和 DSCP 信任模式。如果未為入口流量指派 CoS 或 DSCP 值,則必須為交換器定義 QoS 原則以優先處理該流量。
在此範例中,交換器處於 QoS 進階模式,可提供更精細的 QoS 功能,並允許設定 QoS 原則。
console(config)# qos advanced
首先,必須設定允許 VoIP 流量的存取控制清單 (ACL)。這會符合以子網路為基礎的流量以進行簡化。還有其他許多參數可用於比對超出本討論範圍的特定流量。
console(config)# ip access-list extended voip
console(config-ip-al)# permit ip any 192.168.10.0 0.0.0.255
console(config-ip-al)# exit
現在,我們正在建立 ACL 來比對 LAN 資料流量或 VoIP 以外的任何流量。這是假設 VoIP 流量隔離到單獨的子網路和 VLAN 中,這通常是最佳作法。
console(config)# ip access-list extended LAN
console(config-ip-al)# permit ip any any
console(config-ip-al)# exit
此步驟設定了與 voip ACL 相符的名為 voip 的類別對應,和與之前建立的 LAN ACL 相符的名為 LAN 的類別對應。
console(config)# class-map voip
console(config-cmap)# match access-group voip
console(config-cmap)# exit
console(config)# class-map LAN
console(config-cmap)# match access-group LAN
console(config-cmap)# exit
現在,我們建立一個名為 voice 的原則對應,該對應會先比對類別對應 voip,然後比對類別對應 LAN。
console(config)# policy-map voice
console(config-pmap)# class voip
在這裡,我們賦予原則對應一個動作 (設定佇列 6)。如果流量與類別對應 voip 相符,它會將流量優先放入交換器佇列 6。
console(config-pmap-c)# set queue 6
console(config-pmap-c)# exit
在指派給原則對應的下一個動作中,如果流量與類別對應 LAN 相符,則交換器會設定為信任已指派給輸入封包或訊框的 CoS 或 DSCP 值。如果沒有指派給輸入流量的 CoS 或 DSCP 值,交換器預設會將流量放入佇列 2。佇列 2 主要採用「盡力而為」機制,這表示它會以「先到先得」的方式轉送流量。
console(config-pmap)# class LAN
console(config-pmap-c)# trust cos-dscp
console(config-pmap-c)# exit
console(config-pmap)# exit
現在已經建立 QoS 原則,我們將其指派給交換器單元 1 上的連接埠 1 和 2。連接埠 1 是我們到網路上另一個交換器或路由器的上行鏈路,連接埠 2 則連接到我們的 PBX 伺服器。
console(config)# interface range gigabitethernet 1/0/1-2
console(config-if-range)# service-policy input voice
console(config-if-range)# exit
連接埠 2 連接到 PBX,這是 VLAN 不知道的。介面在存取模式下設定,以便傳送未標記的流量。
console(config)# interface gigabitethernet 1/0/2
console(config-if)# switchport access vlan 10
console(config-if)# exit
連接埠 1 是我們的上行鏈路,可在兩個 VLAN 上傳送和接收流量。這是在中繼模式下設定,以將所有 VLAN 新增至介面。VLAN 1 未標記,因為其預設為原生,而且會標記 VLAN 10。
console(config)# interface gigabitethernet 1/0/1
console(config-if)# switchport mode trunk
console(config-if)# exit
最後一步是與跨距樹通訊協定 (STP) 相關的設定。當網路拓撲中涉及二或多個交換器時,建議在存取層的所有交換器上全域啟用 STP。為了縮短網路聚合時間,最好使用 IEEE 802.1w 快速跨距樹通訊協定 (RSTP),而非 IEEE 802.1d STP。在 PowerConnect 55xx 系列交換器上,RSTP 預設為啟用。可以接受全域停用 RSTP 或 STP,以釋出交換資源並降低網路複雜度。警告!!!若未先洽詢網路系統管理員及/或充分評估停用此通訊協定的風險,尤其是在生產環境中,則不應停用 RSTP。
處理執行 RSTP 或 STP 的網路時,建議所有端點裝置都應啟用「跨距樹 PortFast」。Portfast 可讓您在網路拓撲變更期間立即聚合,並防止連接埠在連結狀態變更時觸發拓撲變更。
在這裡,我們將停用連接到 VoIP 電話的連接埠 13 交換器單元 1 上的 STP。
console(config)# interface gigabitethernet 1/0/13
console(config-if)# spanning-tree disable
console(config-if)# exit
在連接到 PBX 伺服器的連接埠 2 交換器單元 1 上,我們正在啟用 STP PortFast。
console(config)# interface gigabitethernet 1/0/2
console(config-if)# spanning-tree portfast
console(config-if)# end
以上總結了 PowerConnect 55xx 系列交換器的語音 VLAN 基本組態。請記住,上述組態只是範例,可能不是所有網路環境都必需的。除了語音 VLAN 之外,還有其他方法可以在 55xx 系列交換器和整個網路上優先處理 VoIP 流量。此功能旨在優先處理交換器內的本機流量,可能無法解決所有服務品質問題。以下部分列出了用於對語音 VLAN 進行故障診斷的命令,以及反映所討論命令的範例組態。
注意:本文件專為 PowerConnect 55xx 韌體代碼 4.0.1.0 所編寫。未來韌體版本可能會變更裝置功能、命令語法,以及與本文件範圍相關的其他事項。
可用的故障診斷命令:
console# show voice vlan console#show interfaces switchport
console# show qos map dscp-queue console#show interfaces access-lists counters
console# show qos interface buffers console#show interfaces access-lists
console# show qos interface queuing console#show mac address-table
console# show access-lists console#show mac address-table count
console# show policy-map console#show vlan
console# show spanning-tree detail console#show cpu utilization
console# show spanning-tree bpdu console#show logging
console# show rmon statistics <interface> console#show tech-support
console# show interfaces status console#show tech-support memory
console# show interfaces configuration console#show tech-support config
解析度
交換器組態範例:
- 0001e3 是 Siemens 交換器 MAC 位址的前 6 位數
- Siemens_AG_phone 是使用者指派的任意名稱。
console# conf t
console(config)# vlan database
console(config)# vlan 10 exit
console(config)# voice vlan oui-table add 000181 Nortel
console(config)# voice vlan oui-table add 0001e3 Siemens_AG_phone
console(config)# voice vlan oui-table add 00036b Cisco_phone
console(config)# voice vlan oui-table add 0003b5 Joes_VoIP_Phones
console(config)# voice vlan oui-table add 00096e Avaya
console(config)# voice vlan oui-table add 000fe2 H3C_Aolynk
console(config)# voice vlan oui-table add 001049 Shoretel
console(config)# voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone
console(config)# voice vlan oui-table add 00907a Polycom/Veritel_phone
console(config)# voice vlan oui-table add 00e0bb 3Com_phone
console(config)# voice vlan id 10
console(config)# qos advanced
console(config)# ip access-list extended voip
console(config)# permit ip any 192.168.10.0 0.0.0.255
console(config)# exit
console(config)# ip access-list extended LAN
console(config)# permit ip any any exit
console(config)# class-map voip
console(config)# match access-group voip
console(config)# exit
console(config)# class-map LAN
console(config)# match access-group LAN
console(config)# exit
console(config)# policy-map voice
console(config)# class voip
console(config)# set queue 6
console(config)# exit
console(config)# class LAN
console(config)# trust cos-dscp exit
console(config)# exit
console(config)# interface gigabitethernet1/0/1
console(config)# service-policy input voice
console(config)# switchport mode trunk
console(config)# interface gigabitethernet1/0/2
console(config)# spanning-tree portfast
console(config)# service-policy input voice
console(config)# switchport access vlan 10
console(config)# interface gigabitethernet1/0/13
console(config)# spanning-tree disable
console(config)# switchport mode trunk
console(config)# switchport trunk allowed vlan remove 10
console(config)# voice vlan enable
console(config)# voice vlan secure
Default settings: Service tag:
SW version 4.0.1.0 (date 12-Apr-2011 time 17:40:25) Gigabit Ethernet Ports
=============================
no shutdown speed 1000 duplex full
negotiation
flow-control on
mdix auto
no back-pressure interface vlan 1
interface port-channel 1 - 32
spanning-tree
spanning-tree mode RSTP qos basic
qos trust cos
eee enable