|
1 基礎配置 1.1 建立到控制臺的連接
在進行配置和將交換機接入網(wǎng)絡前必須通過控制臺來進入交換機的CLI,對交換機進行配置。在進入CLI后,通過命令enable 進入到 privileged 模式。
通過以下步驟將終端連接到交換機的控制口
<... output truncated ...>
Cisco Systems Console
Enter password:
Console> enable
Enter password:
Console> (enable) 1.2 配置交換機的地址
在遠程登錄交換機前你必須為交換機配置地址,掩碼和網(wǎng)關等信息
在你第一次配置交換機時,將sc0口配置到default VLAN,即VLAN 1中,在你配置了其他VLAN以后,你可以將sc0口配置到其他VLAN中,但是sc0口的地址和網(wǎng)關必須與所在的VLAN的網(wǎng)段對應.
配置IP地址和網(wǎng)關的步驟如下
例如:
Console> (enable) set interface sc0 10.1.1.50/255.0.0.0
Interface sc0 IP address and netmask set.
Console> (enable) set interface sc0 100
Interface sc0 vlan set.
Console> (enable) set ip route default 10.1.1.1
Route added.
Console> (enable) show interface
sl0: flags=51<UP,POINTOPOINT,RUNNING>
slip 0.0.0.0 dest 0.0.0.0
sc0: flags=63<UP,BROADCAST,RUNNING>
vlan 100 inet 10.1.1.50 netmask 255.0.0.0 broadcast 10.255.255.255
Console> (enable) show ip route
Fragmentation Redirect Unreachable
------------- -------- -----------
enabled enabled enabled
Destination Gateway Flags Use Interface
----------------------- ----------------------- ------ ---------- ---------
default 10.1.1.1 UG 0 sc0
10.0.0.0 10.1.1.50 U 0 sc0
default default UH 0 sl0
Console> (enable) ping 10.1.1.100
10.1.1.100 is alive
Console> (enable) 1.3 配置 Ethernet 口
在一條連路兩端的Ethernet, Fast Ethernet和 Gigabit Ethernet 口的端口速率了工作方式必須相同。Ethernet 和Fast Ethernet 會自動配置工作方式,10/100-Mbps Fast Ethernet 口可以自動檢測連路速率。. Gigabit Ethernet總是在 full duplex方式下工作。
配置步驟如下
例如:
Console> (enable) set port speed 2/12 auto
Port 2/12 speed set to auto detect.
Console> (enable) set port name 2/12 NT Server 12
Port 2/12 name set.
Console> (enable) show port 2/12
Port Name Status Vlan Level Duplex Speed Type
----- ------------------ ---------- ---------- ------ ------ ----- ------------
2/12 NT Server 12 connect 1 normal a-half a-100 10/100BaseTX
<... output truncated ...>
Console> (enable) 1.4 配置交換機的全局參數(shù)
配置步驟和命令如下:
例如:
Console> (enable) set system name Catalyst 6000
System name set.
Catalyst 6000> (enable) set time 08/18/98 10:08:00
Sat Apr 18 1998, 10:08:00
Catalyst 6000> (enable) set password
Enter old password:
Enter new password:
Retype new password:
Password changed.
Catalyst 6000> (enable) set enablepass
Enter old password:
Enter new password:
Retype new password:
Password changed.
Catalyst 6000> (enable) 1.5 測試網(wǎng)絡的連通性
在你配置了交換機的地址和網(wǎng)關以后,你就可以與網(wǎng)絡上的其它節(jié)點連通了。
測試方法如下:
Ping和traceroute 的例子如下
Console> (enable) ping -s 172.20.52.20 1200 4
PING 172.20.52.20: 1200 data bytes
1208 bytes from 172.20.52.20: icmp_seq=0. time=6 ms
1208 bytes from 172.20.52.20: icmp_seq=1. time=6 ms
1208 bytes from 172.20.52.20: icmp_seq=2. time=6 ms
1208 bytes from 172.20.52.20: icmp_seq=3. time=5 ms
----172.20.52.20 PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max = 5/5/6
Console> (enable) traceroute 172.20.52.20 1400
traceroute to 172.20.52.20 (172.20.52.20), 30 hops max, 1440 byte packets
1 172.20.52.33 (172.20.52.33) 2 ms 3 ms 1 ms
2 172.20.52.20 (172.20.52.20) 4 ms * 4 ms
Console> (enable) 2 其它參數(shù)的配置 2.1 配置 Login Banner
login banner或 message of the day是在你登陸到交換機時出現(xiàn)在屏幕上的提示信息,最多可以配置255 個字符。
配置步驟:
例如: (通過控制口):
Console> (enable) set banner motd *Catalyst 6000
Software Release 5.4(1)
IP address 10.1.1.20
*
MOTD banner set
Console> (enable) exit
Cisco Systems Console
Catalyst 6000
Software Release 5.4(1)
IP address 10.1.1.20
Enter password: 2.2 配置 DNS
步驟:
例如:
Console> (enable) set ip dns server 10.1.1.100 primary
10.1.1.100 added to DNS server table as primary server.
Console> (enable) set ip dns server 10.1.1.122
10.1.1.122 added to DNS server table as backup server.
Console> (enable) set ip dns domain bigcorp.com
Default DNS domain name set to bigcorp.com
Console> (enable) set ip dns enable
DNS is enabled
Console> (enable) show ip dns
DNS is currently enabled.
The default DNS domain name is: bigcorp.com
DNS name server status
---------------------------------------- -------
10.1.1.100 primary
10.1.1.122
Console> (enable) 2.3 配置 CDP協(xié)議
Cisco Discovery Protocol (CDP) 是一種協(xié)議和介質無關的協(xié)議。它可以運行與所有CISCO設備上,它可以發(fā)現(xiàn)網(wǎng)絡上相鄰的其他CISCO設備的信息。
為了配置CDP,在特權模式下執(zhí)行下面的步驟:
例如:
Console> (enable) set cdp enable
CDP enabled for all ports.
Console> (enable) set cdp interval 100
CDP message interval set to 100 seconds for all ports.
Console> (enable) show cdp port
Port CDP Status Message-Interval
-------- ---------- ----------------
1/1 enabled 100
1/2 enabled 100
2/1 enabled 100
Console> (enable) show cdp neighbors
* - indicates vlan mismatch.
# - indicates duplex mismatch.
Port Device-ID Port-ID Platform
-------- ------------------------------- ------------------------- ------------
3/5 002267619(cat1.cisco.com) 3/6 * WS-C5000
3/6 002267619(cat1.cisco.com) 3/5 WS-C5000
4/1 002267619(cat1.cisco.com) 4/2 WS-C5000
4/2 002267619(cat1.cisco.com) 4/1 # WS-C5000
4/20 069000057(cat2.cisco.com) 8/5 WS-C5500
5/1 005763872(cat3.cisco.com) 2/1 WS-C5000
5/1 066506245(cat4.cisco.com) 2/1 WS-C5505
5/1 066508595(cat5.cisco.com) 5/12 *# WS-C5505
5/1 066508596(cat6.cisco.com) 5/1 WS-C5505
Console> (enable) 3 VLAN的配置
在 Catalyst 6500 系列交換機上配置VLAN要經(jīng)過如下步驟:
Step 2 配置 VLANs—在VTP域中創(chuàng)建VLAN將交換機的端口配置到VLAN中.
Step 3 配置 VLAN Trunks---配置在多個VLAN間進行流量交換的的端口。 3.1 配置VTP協(xié)議(VLAN Trunk Protocol)
在你配置一臺交換機為VTP server時,你必須先定義一個 VTP域,才能建立VLAN.
步驟:
例如:
Console> (enable) set vtp domain BigCorp
VTP domain BigCorp modified
Console> (enable) set vtp mode server
VTP domain BigCorp modified
Console> (enable) show vtp domain
Domain Name Domain Index VTP Version Local Mode Password
-------------------------------- ------------ ----------- ----------- ----------
BigCorp 1 2 server -
Vlan-count Max-vlan-storage Config Revision Notifications
---------- ---------------- --------------- -------------
9 1023 0 enabled
Last Updater V2 Mode Pruning PruneEligible on Vlans
--------------- -------- -------- -------------------------
172.20.52.40 disabled disabled 2-1000
Console> (enable)
3.2 配置 VLAN
3.2.1 創(chuàng)建 VLAN
例如:
Console> (enable) set vlan 100 name Pubs
Vlan 100 configuration successful
Console> (enable) show vlan 100
VLAN Name Status Mod/Ports, Vlans
---- -------------------------------- --------- ----------------------------
100 Pubs active
VLAN Type SAID MTU Parent RingNo BrdgNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ ------ ---- -------- ------ ------
100 enet 100100 1500 - - - - - 0 0
VLAN AREHops STEHops Backup CRF
---- ------- ------- ----------
Console> (enable) 3.3 將交換端口配置到VLAN中
配置方法:
例如:
Console> (enable) set vlan 100 2/1-4
VLAN 100 modified.
VLAN 1 modified.
VLAN Mod/Ports
---- -----------------------
100 2/1-4
Console> (enable) show vlan 100
VLAN Name Status Mod/Ports, Vlans
---- -------------------------------- --------- ----------------------------
100 Pubs active 2/1-4
VLAN Type SAID MTU Parent RingNo BrdgNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ ------ ---- -------- ------ ------
100 enet 100100 1500 - - - - - 0 0
VLAN AREHops STEHops Backup CRF
---- ------- ------- ----------
Console> (enable) show port 2
Port Name Status Vlan Level Duplex Speed Type
----- ------------------ ---------- ---------- ------ ------ ----- ------------
2/1 notconnect 100 normal half 100 100BaseTX
2/2 notconnect 100 normal half 100 100BaseTX
2/3 notconnect 100 normal half 100 100BaseTX
2/4 notconnect 100 normal half 100 100BaseTX
2/5 notconnect 1 normal half 100 100BaseTX
<... output truncated ...>
Console> (enable) 3.4 配置 VLAN Trunks
VLAN trunks 是一個點到點的連接,它可以使不同VLAN之間進行通信。所有的Ethernet 口可以使用Inter-Switch Link (ISL) 或 IEEE 802.1Q 的TRUNK封裝。缺省的,如果一個端口設置成negotiate就會試圖采用ISL封裝。.
如果兩個相連的端口,一端設置為desirable 或 on,另一端配置為 auto ,那么它就會自動成為TRUNK.
配置步驟:
例如: (假設連路的另外一端配置為auto):
Console> (enable) set trunk 1/2 desirable
Port(s) 1/2 trunk mode set to desirable.
Console> (enable) 07/22/1998,10:16:58:DTP-5:Port 1/2 has become isl trunk
07/22/1998,10:16:58:PAGP-5:Port 1/2 left bridge port 1/2.
07/22/1998,10:17:09:PAGP-5:Port 1/2 joined bridge port 1/2.
Console> (enable) show trunk 1/2
Port Mode Encapsulation Status Native vlan
-------- ----------- ------------- ------------ -----------
1/2 desirable isl trunking 523
Port Vlans allowed on trunk
-------- ---------------------------------------------------------------------
1/2 1-1005
Port Vlans allowed and active in management domain
-------- ---------------------------------------------------------------------
1/2 1,10,105,152,521-524
Port Vlans in spanning tree forwarding state and not pruned
-------- ---------------------------------------------------------------------
1/2 1,10,105,152,521-524
Console> (enable) 3.5 在MSFC上配置IP InterVLAN路由 3.5.1 從Console口進入MSFC
我們可以通過switch console直接從supervisor engine的控制口進入MSFC 模塊的CLI,離開MSFC時鍵入^C^C^C 。
命令格式:
注: 要進入備用的MSFC,將CONSOLE線連到備用的交換處理模塊上.
例如:
Console> (enable) switch console 15
Trying Router-15...
Connected to Router-15.
Type ^C^C^C to switch back...
Router>^C^C^C
Console> (enable) 3.5.2 通過Telnet Session 進入MSFC 模塊
我們可以通過 session mod_num 命令進入到MSFC 的CLI界面。離開CLI使用 exit 命令。
例如:
Console> (enable) session 15
Router> exit
Console> (enable) 3.5.3 在MSFC上配置IP InterVLAN路由
為了使VLAN之間能夠相互通訊,我們必須為每個我們需要與外界通訊的VLAN配置 IP InterVLAN 路由。配置步驟如下(假設已經(jīng)在交換幾上進行了前面的配置):
例如:
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# ip routing
Router(config)# interface vlan 100
Router(config-if)# ip address 10.1.1.1 255.0.0.0
Router(config-if)# ^Z
Router# 3.6 配置HSRP協(xié)議
我們可以通過在MSFC VLAN端口上上配置一個或多個HSRP 組來提供自動路由備份。同一組中的所有VLAN 端口在公用一個虛擬的MAC和IP地址。我們將節(jié)點的網(wǎng)關配置為HSRP地址,這樣當這個組中的任何一端口DOWN掉時,都不會影響這些節(jié)點的正常使用。同一組中,端口的HSRP的優(yōu)先級高的端口是活動端口。
配置步驟:
例如:單個交換機上配有雙Supervisor Engines 和 MSFC。
Console> (enable) switch console 15
Trying Router-15...
Connected to Router-15.
Type ^C^C^C to switch back...
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# interface vlan10
Router(config-if)# standby 10 ip 172.20.100.10
Router(config-if)# standby 10 priority 110
Router(config-if)# standby 10 preempt
Router(config-if)# standby 10 timers 5 15
Router(config-if)# standby 10 authentication Secret
Router(config-if)# interface vlan21
Router(config-if)# standby 21 ip 192.20.100.21
Router(config-if)# standby 21 priority 109
Router(config-if)# standby 21 preempt
Router(config-if)# standby 21 timers 5 15
Router(config-if)# standby 21 authentication Secret
Router(config-if)# ^Z
Router# ^C^C^C
Console> (enable) switch console 16
Trying Router-16...
Connected to Router-16.
Type ^C^C^C to switch back...
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# interface vlan10
Router(config-if)# standby 10 ip 172.20.100.10
Router(config-if)# standby 10 priority 109
Router(config-if)# standby 10 preempt
Router(config-if)# standby 10 timers 5 15
Router(config-if)# standby 10 authentication Secret
Router(config-if)# interface vlan21
Router(config-if)# standby 21 ip 172.20.100.21
Router(config-if)# standby 21 priority 110
Router(config-if)# standby 21 preempt
Router(config-if)# standby 21 timers 5 15
Router(config-if)# standby 21 authentication Secret
Router(config-if)# ^Z
Router# ^C^C^C 3.7 配置以太通道
以太通道將多個單獨的以太鏈路綁定成一個邏輯的鏈路,以此在6000系列交換機和另外一臺交換機或主機之間提供1600Mbps(全雙工快速以太通道)或16Gbps(千兆以太通道)的速率。
一臺6000系列的交換機最多支持128個通道。你可以在一臺6000系列的交換機的任何一個模塊上最多將8個兼容的以太口綁定成一個以太通道。每個通道中的所有端口速率必須是一樣的。
如果配置不當,一些以太通道端口為了避免網(wǎng)絡循環(huán)或其它一些問題將自動disable。為了避免錯誤,請按下面的提示進行配置:
l 將一個以太通道中的所有端口分配到同一個VLAN中,或將它們配置成干道端口。
l 如果你將以太端口配置成干道,則在以太通道的所有端口上配置相同的干道模式。
l 在干道以太通道中,以太通道在所有的端口上支持相同的VLAN范圍。如果每個端口所允許的VLAN范圍不一樣,即使用命令set port channel的參數(shù)是auto或 desirable,這些端口也不會形成以太通道。
l 不要將以太通道中的端口配置成動態(tài)VLAN端口。
l 將一個以太通道中的所有端口配置成相同的速率和雙工模式。
l 如果端口的安全特性打開,以太通道則不會形成。
l 如果一個端口是SPAN的destination端口,則以太通道不會形成。
l 如果端口上設置了不同的協(xié)議過濾,則以太通道不會形成。
l 激活以太通道中的所有端口。如果你“disable”了以太通道中的一個端口,將被認為是這條鏈路失敗了,流量將通過通道中的其它端口進行傳輸。
配置以太通道
在特權模式下,執(zhí)行:
set port channel mod/ports... [admin_group]
set port channel mod_num/port_num mode {on | off | desirable | auto} [silent | non-silent] 下面的例子演示了如何將將一個7端口的以太通道配置在一個新的管理組里:
Console> (enable) set port channel 2/2-8 desirable
Ports 2/2-8 left admin_group 1.
Ports 2/2-8 joined admin_group 2.
Console> (enable)
要設置一個端口的以太通道模式,在特權命令下執(zhí)行下面的步驟:
set port channel mod/ports... [admin_group]
set port channel mod_num/port_num mode {on | off | desirable | auto} [silent | non-silent] 下面的例子演示了如何將端口2/1設置成auto模式:
Console> (enable) set port channel 2/1 mode auto
Ports 2/1 channel mode set to auto.
Console> (enable)
設置以太通道端口路徑開銷
為了設置以太通道端口路徑開銷,請在特權模式下執(zhí)行下面的步驟:
下面的例子演示了如何為通道ID 768設置以太通道端口開銷: Console> (enable) show channel group 20 Admin Port Status Channel Channel group Mode id ----- ----- ---------- --------- -------- 20 1/1 notconnect on 768 20 1/2 connected on 768 Admin Port Device-ID Port-ID Platform group ----- ----- ------------------------------- ------------------------- ---------- 20 1/1 20 1/2 066510644(cat26-lnf(NET25)) 2/1 WS-C6009 Console> (enable) Console> (enable) set channel cost 768 12 Port(s) 1/1,1/2 port path cost are updated to 31. Channel 768 cost is set to 12. Warning:channel cost may not be applicable if channel is broken. Console> (enable)
設置以太通道VLAN開銷
在特權模式下執(zhí)行:
下面的例子演示了如何為通道ID768設置以太通道VLAN開銷 Console> (enable) show channel group 20 Admin Port Status Channel Channel group Mode id ----- ----- ---------- --------- -------- 20 1/1 notconnect on 768 20 1/2 connected on 768 Admin Port Device-ID Port-ID Platform group ----- ----- ------------------------------- ------------------------- ---------- 20 1/1 20 1/2 066510644(cat26-lnf(NET25)) 2/1 WS-C6009 Console> (enable) Console> (enable) set channel vlancost 768 12 Channel 768 vlancost set to 12. Console> (enable)
要配置以太通道幀分布,在特權模式下執(zhí)行:
set port channel all distribution {ip | mac} [source | destination | both]
下面的例子演示了如何利用MAC源地址配置以太通道: Console> (enable) set port channel all distribution mac source Channel distribution is set to mac source. Console> (enable)
要禁止以太通道,在特權模式下執(zhí)行:
set port channel mod_num/port_num mode off
下面的例子演示了如何禁止以太通道: Console> (enable) set port channel 2/2-8 mode off Ports 2/2-8 channel mode set to off. Console> (enable) |
|
|