1. 程式人生 > >轉Cisco 6509 詳盡交換機的配置

轉Cisco 6509 詳盡交換機的配置

6509介紹 
Cisco Catalyst 6500系列交換機提供3插槽、6插槽、9插槽和13插槽的機箱,以
及多種整合式服務模組,包括數千兆位網路安全性、內容交換、語音和網路分析模組。
Catalyst 6500系列中的所有型號都使用了統一的模組和作業系統軟體,形成了能夠
適應未來發展的體系結構,由於能提供操作一致性,因而能提高IT基礎設施的利用
率,並增加投資回報。從48埠到576埠的10/100/1000以太網布線室到能夠支
持192個1Gbps或32個10Gbps骨幹埠,提供每秒數億個資料包處理能力的網路核
心,Cisco Catalyst 6500系列能夠藉助冗餘路由與轉發引擎之間的故障切換功能提
高網路正常執行時間。 
提高網路正常執行時間,提高網路彈性。提供資料包丟失保護,能夠從網路故障中快
速恢復。能夠在冗餘控制引擎間實現快速的1~3秒狀態故障切換。 
提供可選的高效能Cisco Catalyst 6500系列Supervisor Engine 720、無源背板、
多引擎的冗餘;並可利用Cisco EtherChannel?技術、IEEE 802.3ad鏈路匯聚、IEEE
802.1s/w和熱備份路由器協議/虛擬路由器冗餘協議(HSRP/VRRP)達到高可用性  
不需要部署外部裝置,直接在6500機箱內部署整合式的千兆位的網路服務模組,以
簡化網路管理,降低網路的總體成本。這些網路服務模組包括: 
l 千兆位防火牆模組--提供接入保護 
l 高效能入侵檢測系統(IDS)模組--提供入侵檢測保護 
l 千兆位網路分析模組--提供可管理性更高的基礎設施和全面的遠端超級(RMON)支
持 
l 高效能SSL模組--提供安全的高效能電子商務流量 
l 千兆位VPN和基於標準的IP Security(IPSec)模組--降低的網際網路和內部專網的
連線成本。  
整合式內容交換模組(CSM)能夠為Cisco Catalyst 6500系列提供功能豐富的高性
能的伺服器和防火牆網路負載平衡連線,以提高網路基礎設施的安全性、可管理性和
強大控制 
基於網路的應用識別(NBAR)等軟體特性可提供增強網路管理和QoS控制機制。  
利用分散式Cisco Express Forwarding dCEF720平臺提供400Mpps交換效能。支援
多種Cisco Express Forwarding(CEF)實現方式和交換矩陣速率。 
多協議第3層路由支援滿足了傳統的網路要求,並能夠為企業網路提供平滑的過渡機
制。支援IPv6,並提供高效能的IPv6服務。提供MPLS及MPLS/VPN的支援,並具有
豐富的MPLS服務。增強的資料、語音和視訊服務 
提供10/100和10/100/1000介面模組,藉助在介面模組內增加電源子卡就可讓這些
介面模組提供線上的電源,提供IEEE 802.3af的支援,保護今天的投資。 
每臺裝置可提供576個支援語音的,具有線上電源的10/100/1000M銅線介面。提供
192個GBIC千兆位乙太網介面。可提供高密度的OC-3 POS介面的通道化的OC-48接
口。 
2. 連線裝置 
2.1. 從console連線 
第一次對6000交換機進行配置,必須從console進入。  
首先先將機器上架,按要求接好電源,然後用隨機附帶的Console線和轉接頭將交換
機的console口與PC的串列埠相聯,如下: 
   
Com口設定如下: 
9600 baud  
8 data bits  
No parity  
1 stop bits 
檢查電源無誤後,開電,可能會出現類似下面的顯示,按黑粗體字回答:  
System Bo otstrap, Version 7.7(1) 
Copyright (c) 19 94-20 03 by cisco Systems, Inc. 
Cat6k-Sup720/SP processor with 524288 Kbytes of main memory 
 
Autoboot executing command: "boot bootflash:" 
 
Self decompressing the image :
#########################################################################
#########################################################################
#########################################################################
# [OK] 
 
              Restricted Rights Legend 
 
Use, duplication, or disclosure by the Government is 
subject to restrictions as set forth in subparagraph 
(c) of the Commercial Computer Software - Restricted 
Rights clause at FAR sec. 52.227-19 and subparagraph 
(c) (1) (ii) of the Rights in Technical Data and Computer 
Software clause at DFARS sec. 252.227-7013. 
           cisco Systems, Inc. 
           170 West Tasman Drive 
           San Jose, California 95134-1706 
 
Cisco Internetwork Operating System Software  
IOS (tm) s72033_sp Software (s72033_sp-SP-M), Version 12.2(17a)SX1, EARLY
DEPLOYMENT RELEASE SOFTWARE (fc1) 
TAC Support:
http://www.cisco.com/tac
 
Copyright (c) 1986-2003 by cisco Systems, Inc. 
Compiled Wed 29-Oct-03 08:20 by cmong 
Image text-base: 0x40020FBC, data-base: 0x40D32000 
 
00:00:03: %PFREDUN-6-ACTIVE: Initializing as ACTIVE processor 
 
00:00:03: %OIR-6-CONSOLE: Changing console ownership to route processor 
 
System Bo otstrap, Version 12.2(14r)S9, RELEASE SOFTWARE (fc1) 
TAC Sup port: ht tp:/ /w w w.cisco.com/tac 
Copyright (c) 20 03 by cisco Systems, Inc. 
Cat6k-Sup720/RP platform with 524288 Kbytes of main memory 
 
Download Start 
 
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 
 
Download Completed! Booting the image. 
 
Self decompressing the image :
#########################################################################
################################################################### [OK] 
 
 
              Restricted Rights Legend 
 
Use, duplication, or disclosure by the Government is 
subject to restrictions as set forth in subparagraph 
(c) of the Commercial Computer Software - Restricted 
Rights clause at FAR sec. 52.227-19 and subparagraph 
(c) (1) (ii) of the Rights in Technical Data and Computer 
Software clause at DFARS sec. 252.227-7013. 
 
           cisco Systems, Inc. 
           170 West Tasman Drive 
           San Jose, California 95134-1706 
 
Cisco Internetwork Operating System Software  
IOS (tm) s72033_rp Software (s72033_rp-PK9S-M), Version 12.2(17a)SX1, EARLY
DEPLOYMENT RELEASE SOFTWARE (fc1) 
TAC Support:
http://www.cisco.com/tac
 
Copyright (c) 1986-2003 by cisco Systems, Inc. 
Compiled Wed 29-Oct-03 08:16 by cmong 
Image text-base: 0x40008FBC, data-base: 0x41E50000 
 
This product contains cryptographic features and is subject to United 
States and local country laws governing import, export, transfer and 
use. Delivery of Cisco cryptographic products does not imply 
third-party authority to import, export, distribute or use encryption. 
Importers, exporters, distributors and users are responsible for 
compliance with U.S. and local country laws. By using this product you 
agree to comply with applicable laws and regulations. If you are unable 
to comply with U.S. and local laws, return this product immediately. 
 
A summary of U.S. laws governing Cisco cryptographic products may be found
at: 
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
 
 
If you require further assistance please contact us by sending email to 
[email protected]
 
cisco WS-C6509 (R7000) processor (revision 3.0) with 458752K/65536K bytes of
memory. 
Processor board ID SAL0743NKW8 
SR71000 CPU at 600Mhz, Implementation 0x504, Rev 1.2, 512KB L2 Cache 
Last reset from power-on 
X.25 software, Version 3.0.0. 
Bridging software. 
1 Virtual Ethernet/IEEE 802.3  interface(s) 
48 FastEthernet/IEEE 802.3 interface(s) 
36 Gigabit Ethernet/IEEE 802.3 interface(s) 
1917K bytes of non-volatile configuration memory. 
8192K bytes of packet buffer memory. 
 
65536K bytes of Flash internal SIMM (Sector size 512K). 
Logging of %SNMP-3-AUTHFAIL is enabled   
Press RETURN to get started! 
--- System Configuration Dialog --- 
   Would you like to enter the initial dialog? [yes]: no 
回答:NO,進入手工配置,在router>下,輸入enable 
回車,進入全域性模式 
2.2. 遠端telnet連線 
當完成交換機配置,並起給交換機配置了管理地址,就可以直接採用遠端telnet登
陸進入交換機了,但是必須先配置line vty的密碼和enable密碼才能允許遠端登陸。
配置telnet登陸命令如下: 
#conf t 
#line vty 0 4 
#login ;控制vty介面是否能夠telnet 
#password switch 
3. 基本資訊配置 
3.1. 交換機軟體版本 
Cisco的65xx交換機支援兩種版本的系統軟體,分別稱為Natvie IOS版本和Cat OS
版本的系統軟體,CatOS版本的軟體是為了相容之前的65xx系列交換機的命令而沿襲
下來的。Native IOS版本軟體是Cisco公司為了統一其交換機及路由器的軟體風格而
研發出來的新一代IOS系統軟體,Cisco所有的交換機版本都在整體向Native IOS
版本過渡,目前來說,Native IOS版本的軟體功能和CatOS版本的軟體功能相差不多,
但是今後都會向Native IOS版本軟體。 
本專案中所使用的6509交換機採用的是Native IOS版本。 
3.2. 檢視交換機基本配置 
show version ;檢視系統版本,記憶體配置,暫存器等基本資訊 
show module all ;檢視交換機配置模組 
show catalyst6000 chassis-mac-address ;檢視交換機MAC地址 
#show version輸出資訊如下: 
Cisco Internetwork Operating System Software  
IOS (tm) s72033_rp Software (s72033_rp-PK9S-M), Version 12.2(17a)SX1, EARLY
DEPLOYMENT RELEASE SOFTWARE (fc1) 
TAC Support: http://www.cisco.com/tac 
Copyright (c) 1986-2003 by cisco Systems, Inc. 
Compiled Wed 29-Oct-03 08:16 by cmong 
Image text-base: 0x40008FBC, data-base: 0x41E50000 
 
ROM: System Bootstrap, Version 12.2(14r)S9, RELEASE SOFTWARE (fc1) 
BOOTLDR: s72033_rp Software (s72033_rp-PK9S-M), Version 12.2(17a)SX1, EARLY
DEPLOYMENT RELEASE SOFTWARE (fc1) 
 
Router uptime is 29 minutes 
Time since Router switched to active is 29 minutes 
System returned to ROM by power-on (SP by power-on) 
System restarted at 12:57:08 PST Sat Jan 31 2004 
System image file is "sup-bootflash:s72033-pk9s-mz.122-17a.SX1.bin" 
 
 
This product contains cryptographic features and is subject to United 
States and local country laws governing import, export, transfer and 
use. Delivery of Cisco cryptographic products does not imply 
third-party authority to import, export, distribute or use encryption. 
Importers, exporters, distributors and users are responsible for 
compliance with U.S. and local country laws. By using this product you 
agree to comply with applicable laws and regulations. If you are unable 
to comply with U.S. and local laws, return this product immediately. 
 
A summary of U.S. laws governing Cisco cryptographic products may be found
at: 
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html 
 
If you require further assistance please contact us by sending email to 
[email protected]
 
cisco WS-C6509 (R7000) processor (revision 3.0) with 458752K/65536K bytes of
memory. 
Processor board ID SAL0743NKW8 
SR71000 CPU at 600Mhz, Implementation 0x504, Rev 1.2, 512KB L2 Cache 
Last reset from power-on 
X.25 software, Version 3.0.0. 
Bridging software. 
1 Virtual Ethernet/IEEE 802.3  interface(s) 
48 FastEthernet/IEEE 802.3 interface(s) 
36 Gigabit Ethernet/IEEE 802.3 interface(s) 
1917K bytes of non-volatile configuration memory. 
8192K bytes of packet buffer memory. 
65536K bytes of Flash internal SIMM (Sector size 512K). 
Standby is up 
Standby has 458752K/65536K bytes of memory. 
 
Configuration register is 0x2102 
 
Router#sho module all 
Mod Ports Card Type                              Model              Serial
No. 
--- ----- -------------------------------------- ------------------
----------- 
  2   16  16 port 1000mb GBIC
ethernet           WS-X6416-GBIC      SAL0750QNJP 
  3   16  16 port 1000mb GBIC
ethernet           WS-X6416-GBIC      SAL0750QNFV 
  5    2  Supervisor Engine 720
(Active)         WS-SUP720-BASE     SAD075000YF 
  6    2  Supervisor Engine 720
(Warm)           WS-SUP720-BASE     SAD075109SZ 
  7   48  48 port 10/100 mb
RJ45                 WS-X6348-RJ-45     SAL0752R3E6 
 
Mod MAC
addresses                       Hw    Fw           Sw           Status 
--- ---------------------------------- ------ ------------ ------------
------- 
  2  000e.8442.4850 to 000e.8442.485f   2.5   5.4(2)       8.2(0.56)TET Ok 
  3  000e.8442.48f0 to 000e.8442.48ff   2.5   5.4(2)       8.2(0.56)TET Ok 
  5  000d.290f.fd08 to 000d.290f.fd0b   3.0   7.7(1)       12.2(17a)SX1 Ok 
  6  000e.3838.1a8c to 000e.3838.1a8f   3.0   7.7(1)       12.2(17a)SX1 Ok 
  7  000e.84c8.54f0 to 000e.84c8.551f   6.8   5.4(2)       8.2(0.56)TET Ok 
 
Mod
Sub-Module                  Model              Serial        Hw     Statu
s  
--- --------------------------- ------------------ ------------ -------
------- 
  5 Policy Feature Card 3       WS-F6K-PFC3A       SAD0752009D   2.0    Ok 
  5 MSFC3 Daughterboard         WS-SUP720          SAD075109HX   2.0    Ok 
  6 Policy Feature Card 3       WS-F6K-PFC3A       SAD0751085J   2.0    Ok 
  6 MSFC3 Daughterboard         WS-SUP720          SAD0751077C   2.0    Ok 
  7 Inline Power Module         WS-F6K-PWR                       0.0    Ok 
 
Mod Online Diag Status  
--- ------------------- 
  2 Pass 
  3 Pass 
  5 Pass 
  6 Pass 
  7 Pass 
3.3. 配置機器名、telnet、密碼 
在全域性模式下,用conf t,進入配置模式,進行以下配置: 
#conf t 
#clock timezone GMT 8 ;配置時區 
#clock set 13:30:21 31 JAN 2004 ;配置交換機時間 
#clock calendar-valid ;使能硬體時鐘同步 
#service timestamps debug datetime localtime ;配置系統debug記錄時間格式 
#service timestamps log datetime localtime ;配置系統日誌記錄時間格式 
#service password-encryption ;配置使用加密服務,主要針對口令加密 
#hostname xxxx ;配置交換機名稱 
#enable secret  0 xxxxx ;配置enable口令 
#copy run start ;將配置資訊儲存到NVRAM中,重啟動不會丟失 
#line vty 0 4 ;配置telnet 
#e xec-timeout 30 0 
#password 0  xxxx 
#login 
3.4. 配置snmp 
#conf t 
#snmp-server community cisco ro(只讀) ;配置只讀通訊字串 
#snmp-server community secret rw(讀寫) ;配置讀寫通訊字串 
#snmp-server enable traps  ;配置閘道器SNMP TRAP 
#snmp-server host 10.254.190.1 rw ;配置閘道器工作站地址 
 
3.5. 啟動三層功能 
#ip routing ;啟動路由功能 
3.6. 檢視和配置系統環境變數 
使用show bootvar命令檢視系統啟動環境變數,包括BOOT, BOOTLDR, and
CONFIG_FILE引數: 
Router# show bootvar 
BOOT variable = slot0:c6sup22-jsv-mz.121-5c.EX.bin,1; 
CONFIG_FILE variable does not exist 
BOOTLDR variable = bootflash:c6msfc2-boot-mz.121-3a.E4 
Configuration register is 0x2 
Router# 
改變BOOT,、BOOTLDR、CONFIG_FILE 這三個環境變數使用命令: 
BOOT  #boot system 
BOOTLDR  #boot bootldr 
CONFIG_FILE #boot config 
4. 埠設定 
4.1. 埠基本設定  
Cisco 65xx系列交換機的埠預設都是路由模式,一般都會配置為交換埠使用,進
入埠配置模式: 
對於單一埠,在配置模式下輸入:interface Ethernet,Fast Ethernet,Gigabit
Ethernet x/y, x為槽位號,y為埠號。 
對於一組埠,可以使用以下的命令進入,例如: 
Router(config)# interface range fastethernet 5/1 - 5     或: 
Router(config-if)# interface range gigabitethernet 2/1 - 2, gigabitethernet
3/1 - 2 
進行埠配置模式後,可以shutdown,或no shutdown埠,並可以對埠進行配置,
快速以太埠有全雙工、半雙工和自動協商模式,如果知道對端連線的裝置是採用何
種方式,最好採用手工設定方式固定埠的模式和速率。預設是自動協商模式。 
快速以太埠的速率可以設定為100M,也可以設定為10M和自動協商。預設是自動協
商方式。如: 
Router(config-if)#speed [10 | 100 | auto](速度) 
Router(config-if)# duplex [auto | full | half](雙工) 
或添加註釋,如: 
Router(config-if)# description Channel-group to "Marketing" 
4.2. 配置二層交換介面 
(以fastethernet為例,gigabitethernet一樣) 
Router(config)# interface fastethernet x/y  
Router(config-if)# shutdown  
Router(config-if)# switchport  ;6500上預設埠為路由埠,需要寫switchport
將埠設定為交換埠 
Router(config-if)# switchport mode access  
Router(config-if)# switchport access vlan x  
Router(config-if)# no shutdown  
Router(config-if)# end 
 
清除二層介面配置 
(以fastethernet為例,gigabitethernet一樣) 
Router(config)# interface fastethernet x/y  
Router(config-if)# no switchport  
Router(config-if)# end 
注:使用default interface {ethernet | fastethernet | gigabitethernet}
slot/port,使埠回到原來的預設配置。 
4.3. 配置三層路由埠 
6500的埠預設就是具有三層交換的埠,用來跟其他裝置的連線,當將一個埠配
置成三層埠之後,就可以在此埠上分配IP地址了。 
Router(config)# interface fastethernet x/y 
Router(config)# ip add x.x.x.x x.x.x.x 
Router(config)# no shutdown 
4.4. 配置埠Trunk  
將一個二層埠配置為Trunk模式: 
Router(config)# interface fastethernet x/y (以fastethernet為例,
gigabitethernet一樣) 
Router(config-if)# shutdown  
Router(config-if)# switchport  
Router(config-if)# switchport trunk encapsulation dot1q  
Router(config-if)# switchport mode trunk 
Router(config-if)# no shutdown  
Router(config-if)# end  
Router# exit 
4.5. Ethernaet Channel 
Router(config)# interface range gigabitethernet1/1 - 2 
Router(config-if)#no ip address  
Router(config-if)#switchport 
Router(config-if)#switchport trunk encapsulation dot1q  
Router(config-if)#switchport mode trunk 
Router(config-if)#switchport trunk native vlan 1  
Router(config-if)#channel-group 1 mode on  
R>interface Port-channel1 ;自動產生,並且一定要如下所示,否則可能會有問題。 
switchport 
switchport trunk encapsulation dot1q 
switchport mode trunk 

interface GigabitEthernet1/1  
  no ip address  
  switchport  
  switchport trunk encapsulation dot1q  
  switchport trunk native vlan 1  
  channel-group 1 mode on  
!  
interface GigabitEthernet1/2  
  no ip address  
  switchport  
  switchport trunk encapsulation dot1q  
  switchport trunk native vlan 1  
  channel-group 1 mode on  
如果有問題,使用命令#no int port-channel 1  ,#int g2/1 -2  ,#no switchport 
4.6. 檢視埠配置 
Router# show running-config interface fastethernet 5/8 
Router# show interfaces fastethernet 5/8 switchport 
Router# show running-config interface port-channel 1 
Router# show spanning-tree interface fastethernet 4/4 
5. 配置VLAN 
5.1. 配置VTP 
VTP是一個2層資訊協議,包括版本1和2。一個網路裝置只能屬於一個VTP domain。
預設, Catalyst 6500交換機配置為VTP server mode,在沒有管理域的狀態。直到
在一個trunk鏈路上收到其他域的宣告或手工配置管理域。VTP並不是一定要配置,
但是配置可以簡化配置複雜度和易於管理。 
VTP pruning(VTP裁剪)增強了網路頻寬利用率。結合VTP,使得沒有必要接收某個
vlan的廣播資訊的交換機被裁剪,免於接收包括broadcast, multicast, unknown,
and flooded unicast的包。 
Router(config)# vtp domain domain_name 
Router(config)# vtp mode {client | server | transparent} 
Router(config)# vtp version {1 | 2} 
Router(config)# vtp password password_string 
Router(config)# vtp pruning 
Router# show vtp status 
5.2. 配置VLAN埠 
5.3. 建立VLAN 
預設狀態下,所有的二層埠均屬於vlan1,vlan的配置方法如下: 
命令 目的  
Step 1   Router# vlan database 進入vlan配置方式. 
Step 2   Router(vlan)# vlan vlan_ID  加入一個VLAN. 
Step 3 Router(vlan)# vtp domain  name 設定vtp域名 
Step 3   Router(vlan)# exit  更新VLAN資料庫,並在管理域內廣播,退到全域性模
式 
Step 4   Router# show vlan name vlan_name  驗證VLAN配置 
 
刪除配置好的vlan 
Router# vlan database 
Router(vlan)# no vlan x 
Deleting VLAN 3... 
Router(vlan)# exit 
5.4. 給vlan分配埠 
Router(config)# interface fastethernet x/y  
Router(config-if)# shutdown  
Router(config-if)# switchport  
Router(config-if)# switchport mode access  
Router(config-if)# switchport access vlan x 
Router(config-if)# no shutdown  
Router(config-if)# end  
Router# exit 
5.5. 配置vlan地址 
Router(config)# interface vlan x  
Router(config)# ip add x.x.x.x x.x.x.x 
6. 配置HSRP 
不同網段之間的通訊都是通過在終端工作站上設定預設閘道器來實現的,為了實現冗
餘,每臺交換機上必然要配置相同的網段,那麼就會在一個網段中出現2個不同地址
的路由介面(對於工作站就是預設閘道器),當1條上聯鏈路失效時,資料必然會從另
外1條鏈路傳輸到另外一臺交換機上進行處理,這時就存在預設閘道器變更的問題。 
為了消除當一條鏈路失效導致的工作站預設閘道器重新定義的問題,我們使用Cisco公
司專有HSRP(Hot Standby Redundant Protocol)技術來解決這個問題。 
HSRP技術就是將分佈在2臺交換機上相同網段的不同路由介面IP地址對映為一個虛
擬IP地址來消除工作站預設閘道器重新定義的問題。配置如下: 
在其中一臺65xx上按下面模版進行配置 
interface Vlan x  
  ip address x.x.x.x x.x.x.x 
  no ip redirects  
  no ip directed-broadcast  
  standby 1 ip y.y.y.y 
  standby 1 priority 100  
  standby 1 preempt 
standby 1 authentication secret 
 
在另一臺65xx上按下面模版進行配置 
interface Vlan x  
  ip address x.x.x.x x.x.x.x  
  no ip redirects  
  no ip directed-broadcast  
standby 1 ip y.y.y.y 
  standby 1 priority 110 ;這個優先順序高,成為Master 
  standby 1 preempt 
standby 1 authentication secret 
 
7. 配置NTP 
NTP (Network Time Protocol) 為路由器、交換機和工作站之間提供了一種時間同步
的機制。時間同步了,多臺網路裝置上的相關事件記錄可以放在一起看,更為清晰,
方便了分析較複雜的故障和安全事件等。  
(1)本地時鐘設定: 
clock timezone Peking +8 ;定義時區 
clock calendar-valid ;允許使用硬體calendar作為時鐘源 
clock set hh:mm:ss month year ;如clock set 14:02:30 10 December 2003 
clock update-calendar ;更新硬體時鐘 
(2)ntp server 
ntp calendar-update ;允許NTP定期更新calendar 
ntp master 3 ;允許本機作為NTP協議的主時鐘,精度級別3,供其它對等體同步用。 
ntp source int vlan 7 ;設定ntp時鐘原的埠或IP地址 
(3)常用的除錯命令有: 
show ntp status  
show ntp associations 
8. 配置映象埠 
在交換機上配置映象埠(Mirroring Port)用於建立內部網路的監控埠,以便收
集相關被監測埠的資料流量,進行資料流監控及分析。我們這裡配置映象埠用於
配置入侵檢測裝置(映象埠)的檢測口檢測一級防火牆和二級防火牆的內網介面,
以探測是否有入侵行為發生。 
#monitor session 1 source interface Fa7/14 - 19 rx 
#monitor session 1 destination interface Fa7/22 
#monitor session 2 source interface Fa7/24 
#monitor session 2 destination interface Fa7/25 
9. 升級配置 
9.1. 交換機IOS儲存和升級 
交換機的IOS儲存和升級是採用TFTP協議完成,所以首先你必須要下載一個TFTP軟
件,然後按照下面的步驟來進行: 
1.在你的機器上啟動TFTP 。 
2.登陸到交換機,然後在enable狀態下輸入如下命令來完成IOS的儲存: 
switch#copy  flash  tftp    
Source IP address or hostname [171.68.206.171]?  
Source filename []? cat6000-sup2k8.7-1-1.bin 
Destination filename [cat6000-sup2k8.7-1-1.binn]?  
Loading cat6000-sup2k8.7-1-1.bin to 171.68.206.171 (via VLAN1):    !!!! 
!!!!!!!!!!! 
[OK - 1125001 bytes] 
3.如果你要升級IOS檔案,那麼你首先要檢查flash空間是否夠,如果空間不夠的
話,則需要先刪除原來的IOS然後再升級。按照如下命令來完成IOS的升級: 
switch#copy  tftp  flash 
Source IP address or hostname []? 171.68.206.171 
Source filename []? cat6000-sup2k8.7-1-1.bin 
Destination filename [cat6000-sup2k8.7-1-1.bin]?  y 
Loading cat6000-sup2k8.7-1-1.bin from 171.68.206.171 (via VLAN1):    !!!! 
!!!!!!!!!!! 
[OK - 1125001 bytes] 
9.2. 配置從另外一個版本的IOS啟動 
如果交換機FLASH容量允許的話,我們可以在不刪除原有交換機內部IOS軟體的情況
下配置交換機從另外一個版本的IOS啟動,這樣可以避免一定程度上由於刪除原有
IOS軟體帶來的風險。 
1.拷貝新的IOS到交換機的FLASH內。假設新的IOS軟體名稱為
cat6000-sup2k8.7-1-1.bin 
# copy tftp flash 
2.配置從新的IOS軟體引導 
# boot system flash [flash-fs:][partition-number:][filename] 
#boot system flash sup-bootflash: cat6000-sup2k8.7-1-1.bin