本文提供在整合式服務路由器(ISR)中安裝的EtherSwitch網路模組的組態範例。 本檔案不會討論EtherSwitch服務模組的組態範例。
本文件沒有特定需求。
本文中的資訊係根據以下軟體和硬體版本:
Cisco IOS®軟體版本12.4或更高版本上的Cisco 2800系列路由器
NM-16ESW-PWR= 16埠10/100 EtherSwitch網路模組(NM)
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
此配置還可以用於以下硬體和軟體版本:
Cisco 2600/3600/3700/3800系列路由器。
請參閱Cisco EtherSwitch網路模組 — 產品手冊中的表4。
有兩種型別的EtherSwitch模組可用於Cisco ISR。它們是:
EtherSwitch網路模組(ESW)
EtherSwitch服務模組(ES)
ESW模組由路由器IOS配置。這些模組不運行單獨的軟體。軟體整合到主機路由器IOS中。您可以從主機路由器建立VLAN、配置VLAN、生成樹、VLAN中繼協定(VTP)等。路由器也會將VLAN資料庫檔案(vlan.dat)儲存在快閃記憶體中。本文檔顯示了ESW模組的配置示例。
有關ESW模組的更多資訊,請參閱Cisco EtherSwitch網路模組 — 產品手冊。
請參閱Cisco EtherSwitch網路模組功能指南以瞭解如何配置ESW模組。
ES模組具有自己的處理器、交換引擎和快閃記憶體,這些處理器和快閃記憶體獨立於主機路由器資源運行。在路由器中安裝ES模組後,您可以從主機路由器通過控制檯連線到ES模組。然後,您可以從ES模組建立VLAN、配置VLAN、生成樹、VTP等。ES模組基於Catalyst 3750平台。
有關ES模組的更多資訊,請參閱Cisco EtherSwitch服務模組 — 產品手冊。
請參閱Cisco EtherSwitch服務模組功能指南以瞭解如何管理ES模組。
請參閱Catalyst 3750系列交換機 — 配置指南,瞭解如何配置ES模組。
本節提供用於設定本文件中所述功能的資訊。
註:使用Command Lookup Tool(僅供已註冊客戶使用)可獲取本節中使用的命令的詳細資訊。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
預設情況下,所有埠都屬於VLAN1。您只能從VLAN資料庫模式建立VLAN。在VLAN資料庫模式下建立VLAN後,系統會建立vlan.dat檔,並將其儲存在路由器的快閃檔案系統中。您可以使用show vlan-switch指令檢視VLAN。在以下範例中,動態主機設定通訊協定(DHCP)伺服器(172.16.10.20)位於VLAN 10中。ip helper-address指令是在VLAN 10以外的所有VLAN上設定,以便從DHCP伺服器取得這些VLAN中裝置的IP位址。
| Router1 |
|---|
Create VLANs
Router1#vlan database
Router1(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
Router1(vlan)#vlan 51
VLAN 51 added:
Name: VLAN0051
Router1(vlan)#vlan 50
VLAN 50 added:
Name: VLAN0050
Router1(vlan)#vlan 100
VLAN 100 added:
Name: VLAN0100
Router1(vlan)#vlan 200
VLAN 200 added:
Name: VLAN0200
Router1(vlan)#exit
APPLY completed.
Exiting....
Router1#
Configure VLANs
Router1(config)#interface vlan 10
Router1(config-if)#ip address 172.16.10.1 255.255.255.0
Router1(config-if)#interface vlan 50
Router1(config-if)#ip address 172.16.50.1 255.255.255.0
Router1(config-if)#ip helper-address 172.16.10.20
Router1(config-if)#interface vlan 51
Router1(config-if)#ip address 172.16.51.1 255.255.255.0
Router1(config-if)#ip helper-address 172.16.10.20
Router1(config-if)#interface vlan 100
Router1(config-if)#ip address 172.16.100.1 255.255.255.0
Router1(config-if)#ip helper-address 172.16.10.20
Router1(config-if)#interface vlan 200
Router1(config-if)#ip address 172.16.200.1 255.255.255.0
Router1(config-if)#ip helper-address 172.16.10.20
|
Router1#show vlan-switch
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa1/0, Fa1/2, Fa1/3, Fa1/4,
Fa1/5, Fa1/6, Fa1/7, Fa1/8,
Fa1/9, Fa1/10, Fa1/11, Fa1/12
Fa1/13, Fa1/14, Fa1/15
10 VLAN0010 active
50 VLAN0050 active
51 VLAN0051 active
100 VLAN0100 active
200 VLAN0200 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
10 enet 100010 1500 - - - - - 0 0
50 enet 100050 1500 - - - - - 0 0
51 enet 100051 1500 - - - - - 0 0
100 enet 100100 1500 - - - - - 0 0
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
200 enet 100200 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
預設情況下,VTP模式是伺服器,域名為空。只能從VLAN資料庫模式配置VTP。唯一支援的生成樹模式是PVST+。預設中繼封裝為dot1q。如果將中繼埠配置為僅允許指定的VLAN,可能會收到一條錯誤消息Bad VLAN allowed list。在這種情況下,您可能需要允許預設VLAN 1-2、1002-1005以及自定義VLAN清單。因此,您還需要在連線到此TRUNK埠的鄰居交換機上允許預設VLAN和自定義VLAN以避免中繼不一致。
| Router1 |
|---|
VTP Configuration Router1#vlan database Router1(vlan)#vtp transparent Setting device to VTP TRANSPARENT mode. Router1(vlan)#vtp domain LAB Changing VTP domain name from NULL to LAB Router1(vlan)#exit APPLY completed. Exiting.... Spanning-Tree Configuration Router1(config)#spanning-tree vlan 1 root primary Router1(config)#spanning-tree vlan 10 root primary Router1(config)#spanning-tree vlan 50 root primary Router1(config)#spanning-tree vlan 51 root primary Router1(config)#spanning-tree vlan 100 root primary Router1(config)#spanning-tree vlan 200 root primary Trunk and Port Channel Configuration Router1(config)#interface port-channel 1 Router1(config-if)#switchport mode trunk !--- dot1q is the default encapsulation. Router1(config-if)#switchport trunk allowed vlan 100,200 Command rejected: Bad VLAN allowed list. You have to include all default vlans, e.g. 1-2,1002-1005. Command rejected: Bad VLAN allowed list. You have to include all default vlans, e.g. 1-2,1002-1005. Router1(config-if)#switchport trunk allowed vlan 1,1002-1005,100,200 Router1(config-if)#exit Router1(config)#interface range fastEthernet 1/0 - 1 Router1(config-if-range)#switchport mode trunk !--- dot1q is the default encapsulation. Router1(config-if-range)#switchport trunk allowed vlan 1,1002-1005,100,200 Router1(config-if-range)#channel-group 1 mode on Router1(config-if-range)#exit |
| Access1 |
|---|
Access1 Switch Configuration Access1(config)#vlan 100,200 Access1(config-vlan)#exit Access1(config)#vtp mode transparent Setting device to VTP TRANSPARENT mode. Access1(config)#vtp domain LAB Changing VTP domain name from NULL to LAB Access1(config)#interface port-channel 1 Access1(config-if)#switchport trunk encapsulation dot1q Access1(config-if)#switchport mode trunk Access1(config-if)#switchport trunk allowed vlan 1,1002-1005,100,200 Access1(config-if)#exit Access1(config)#interface range FastEthernet 0/1 - 2 Access1(config-if-range)#switchport trunk encapsulation dot1q Access1(config-if-range)#switchport mode trunk Access1(config-if-range)#switchport trunk allowed vlan 1,1002-1005,100,200 Access1(config-if-range)#channel-group 1 mode on Access1(config-if-range)#exit |
Router1#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 52 Number of existing VLANs : 10 VTP Operating Mode : Transparent VTP Domain Name : LAB VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x8D 0x71 0x37 0x29 0x6C 0xB0 0xF2 0x0E Configuration last modified by 172.22.1.197 at 2-20-07 22:31:06 Router1#
Router1#show interface fastethernet 1/0 trunk
Port Mode Encapsulation Status Native vlan
Fa1/0 on 802.1q trunk-inbndl 1
(Po1)
Port Vlans allowed on trunk
Fa1/0 1,100,200,1002-1005
Port Vlans allowed and active in management domain
Fa1/0 1,100,200
Port Vlans in spanning tree forwarding state and not pruned
Fa1/0 1,100,200
Router1#show spanning-tree summary
Root bridge for: VLAN1, VLAN10, VLAN50, VLAN51, VLAN100, VLAN200.
PortFast BPDU Guard is disabled
UplinkFast is disabled
BackboneFast is disabled
Name Blocking Listening Learning Forwarding STP Active
-------------------- -------- --------- -------- ---------- ----------
VLAN1 0 0 0 1 1
VLAN10 0 0 0 1 1
VLAN50 0 0 0 1 1
VLAN51 0 0 0 1 1
VLAN100 0 0 0 1 1
VLAN200 0 0 0 1 1
-------------------- -------- --------- -------- ---------- ----------
6 VLANs 0 0 0 6 6
接入埠配置類似於標準LAN交換機配置。
| Router1 |
|---|
Port for Server Configuration Router1(config)#interface fastEthernet 1/2 Router1(config-if)#switchport mode access Router1(config-if)#switchport access vlan 10 Router1(config-if)#spanning-tree portfast Router1(config-if)#speed 100 Router1(config-if)#duplex full Router1(config-if)#exit Port for Printer Configuration Router1(config)#interface fastethernet 1/3 Router1(config-if)#switchport mode access Router1(config-if)#switchport access vlan 51 Router1(config-if)#spanning-tree portfast Router1(config-if)#exit |
語音埠配置類似於標準LAN交換機配置。
| Router1 |
|---|
Configure the port for Voice Router1(config)#interface fastethernet 1/4 Router1(config-if)#switchport mode access Router1(config-if)#switchport access vlan 51 Router1(config-if)#switchport voice vlan 50 Router1(config-if)#spanning-tree portfast Router1(config-if)#mls qos trust cos |
這是ESW模組上的預設QoS配置:
Router1#show wrr-queue bandwidth
WRR Queue : 1 2 3 4
Bandwidth : 1 2 4 8
wrr-queue bandwidth is disabled
Router1#show wrr-queue cos-map
CoS Value : 0 1 2 3 4 5 6 7
Priority Queue : 1 1 2 2 3 3 4 4
wrr-queue cos map is disabled
Router1#show mls qos maps cos-dscp
Cos-dscp map:
cos: 0 1 2 3 4 5 6 7
--------------------------------
dscp: 0 8 16 26 32 46 48 56
Router1#show mls qos maps dscp-cos
Dscp-cos map:
dscp: 0 8 10 16 18 24 26 32 34 40 46 48 56
-----------------------------------------------
cos: 0 1 1 2 2 3 3 4 4 5 5 6 7
以下各節說明了這些配置:
您不能在第2層交換機埠上配置基於埠的QoS。隊列只能通過全域性配置進行配置。配置示例將CoS值對映到四個不同的隊列。當封包直接從交換器連線埠進入第2層引擎時,會被置於32 MB動態共用記憶體緩衝區中的四個佇列之一。來自語音VLAN上Cisco IP電話的任何語音承載資料包都會根據IP電話生成的802.1p值(CoS 5)自動置於最高優先順序(隊列4)中。然後,以加權循環配置為基礎為隊列提供服務。使用3的CoS或服務型別(ToS)的控制流量被置於隊列3中。
| Router1 |
|---|
Router1(config)#wrr-queue cos-map 1 0 1
Router1(config)#wrr-queue cos-map 2 2
Router1(config)#wrr-queue cos-map 3 3 4
Router1(config)#wrr-queue cos-map 4 5 6 7
!--- wrr-queue cos-map
|
驗證隊列引數:
Router1#show wrr-queue bandwidth WRR Queue : 1 2 3 4 Bandwidth : 1 2 4 8 !--- Default values WRR Queue : 1 2 3 4 Bandwidth : 1 16 64 255 !--- Configured values Router1#show wrr-queue cos-map CoS Value : 0 1 2 3 4 5 6 7 Priority Queue : 1 1 2 2 3 3 4 4 !--- Default values CoS Value : 0 1 2 3 4 5 6 7 Priority Queue : 1 1 2 3 3 4 4 4 !--- Configured values
此表顯示了配置後每個隊列的隊列數、CoS值和權重。
| 隊列編號 | CoS值 | 重量 |
|---|---|---|
| 1 | 0 1 | 1 |
| 2 | 2 | 16 |
| 3 | 3 4 | 64 |
| 4 | 5 6 7 | 255 |
| Router1 |
|---|
Router1(config)#interface fastethernet1/4 Router1(config-if)#mls qos trust cos !--- Trust the CoS value of the frames from the IP phone. Router1(config-if)#mls qos cos override !--- Reset the CoS value of the frames from PC to 0. Router1(config-if)#exit Router1(config)#interface range fastEthernet 1/0 - 1 Router1(config-if-range)#mls qos trust cos !--- Trust the CoS value of the frames from this trunk link. Router1(config-if-range)#exit |
本節介紹介面fa1/2上的管制器組態,以將FTP流量限製為5 Mbps。
| Router1 |
|---|
Router1(config)#ip access-list extended ACTIVE-FTP Router1(config-ext-nacl)#permit tcp any any eq ftp Router1(config-ext-nacl)#permit tcp any any eq ftp-data Router1(config-ext-nacl)#exit Router1(config)#class-map ACTIVE-FTP-CLASS Router1(config-cmap)#match class ACTIVE-FTP Router1(config-cmap)#exit Router1(config)#policy-map ACTIVE-FTP-POLICY Router1(config-pmap)#class ACTIVE-FTP-CLASS Router1(config-pmap-c)#police 5000000 conform-action transmit exceed-action drop Router1(config-pmap-c)#exit Router1(config-pmap)#exit Router1(config)#interface fastethernet1/2 Router1(config-if)#service-policy input ACTIVE-FTP-POLICY Router1(config-if)#exit |
在ESW模組中,策略器配置幾乎沒有限制。它們列示如下:
不支援在輸出方向具有ACL分類的策略對映,因此無法使用service-policy input policy-map-name interface configuration命令將其附加到接口。
在策略對映中,不支援名為class-default的類。交換機不會根據class class-default policy-map配置命令定義的策略對映來過濾流量。
您可以建立策略對映並僅應用於ESW介面的入口。在策略對映中,僅支援策略器。
Router1#show policy-map
Policy Map FINANCE-POLICY
Class FINANCE-CLASS
set cos 4
Router1(config)#interface fastethernet1/4
Router1(config-if)#service-policy input FINANCE-POLICY
%Error: FastEthernet1/4 Service Policy Configuration Failed.Only Police Action S
upported
不支援在VLAN或交換虛擬介面(SVI)級別進行管制。
目前沒有適用於此組態的驗證程序。
目前尚無適用於此組態的具體疑難排解資訊。
| 修訂 | 發佈日期 | 意見 |
|---|---|---|
1.0 |
19-Mar-2007
|
初始版本 |