




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、思科交換機(jī)基本配置 研發(fā)七部 思科交換機(jī)基本介紹思科交換機(jī)基本介紹 交換機(jī)型號(hào)交換機(jī)型號(hào)Catalyst 2960 系列交換機(jī)Catalyst 3560 系列交換機(jī)Catalyst 3750 系列交換機(jī)Catalyst 4500 系列交換機(jī)Catalyst 4948 系列交換機(jī)Catalyst 6500 系列交換機(jī)3560系列交換機(jī)三層交換機(jī)三層交換機(jī)支持支持PoE(Power over Ethernet)設(shè)備)設(shè)備支持支持IPv6匯聚層交換機(jī)匯聚層交換機(jī)中型企業(yè)中型企業(yè)Catalyst-3560G-24TS 技術(shù)參數(shù)轉(zhuǎn)發(fā)帶寬:32Gbps每秒分組數(shù):38.7Mpps支持的mac地址:1200
2、0支持的路由:11000千兆以太網(wǎng)SFP:410/100/1000端口:24不支持PoE思科交換機(jī)測(cè)試中常用配置交換機(jī)配置模式用戶模式 Switch特權(quán)模式 Switchenable Switch#全局模式 Switch#configure terminal Switch(config)# 每次進(jìn)入交換機(jī)時(shí),首先會(huì)進(jìn)入到用戶模式下每次進(jìn)入交換機(jī)時(shí),首先會(huì)進(jìn)入到用戶模式下 ,在此模式下不能對(duì)交換,在此模式下不能對(duì)交換機(jī)進(jìn)行修改、甚至有些信息都無(wú)法查看,為了更進(jìn)一步的對(duì)交換機(jī)進(jìn)行操作,機(jī)進(jìn)行修改、甚至有些信息都無(wú)法查看,為了更進(jìn)一步的對(duì)交換機(jī)進(jìn)行操作,我們必須進(jìn)入到特權(quán)模式或全局模式,而從用戶模式
3、下只能進(jìn)入特權(quán)模式,我們必須進(jìn)入到特權(quán)模式或全局模式,而從用戶模式下只能進(jìn)入特權(quán)模式,再?gòu)奶貦?quán)模式進(jìn)入全局模式,也就是說(shuō)之中不能跨級(jí)。再?gòu)奶貦?quán)模式進(jìn)入全局模式,也就是說(shuō)之中不能跨級(jí)。 更改主機(jī)名更改主機(jī)名SwitchenSwitch#conf tSwitch(config)#hostname 12341234(config)#更改特權(quán)密碼更改特權(quán)密碼1234(config)#enable password 1231234(config)#1234(config)#enable secret 2341234(config)#查看全局配置Switch#show running-config保存當(dāng)前
4、配置Switch#copy running-config startup-config恢復(fù)出廠默認(rèn)Switch#erase startup-configSwitch#reload明文密碼和密文密碼Password1234#show running-config hostname 1234 enable password 123Secret 1234#show running-confighostname 1234enable secret 5 $1$CCFV$0DTd3rSPZNycrVDjn1rKv/ (MD5 加密的字符串) enable password 123當(dāng)明文和密文同時(shí)存在時(shí),密
5、文優(yōu)先級(jí)高。當(dāng)明文和密文同時(shí)存在時(shí),密文優(yōu)先級(jí)高。端口配置全局模式下進(jìn)入端口后,可以對(duì)端口進(jìn)行配置。Switch#conf tSwitch(config)#interface gigabitEthernet 0/1Switch(config-if)#批量修改端口 range命令端口速率:Switch(config-if)#speed ? 10 Force 10 Mbps operation 100 Force 100 Mbps operation 1000 Force 1000 Mbps operation auto Enable AUTO speed configurationSwitch(
6、config-if)#speed autoSwitch(config-if)#雙工模式:Switch(config-if)#duplex ? auto Enable AUTO duplex configuration full Force full duplex operation half Force half-duplex operationSwitch(config-if)#duplex auto Switch(config-if)#端口描述Switch(config-if)#description vlan 10 trunkSwitch(config-if)#Vlan設(shè)置Vlan設(shè)置范
7、圍:1-4094在全局模式下配置vlanSwitch#conf tSwitch(config)#vlan 10Switch(config-vlan)#name vlan10Switch(config-vlan)#vlan 20Switch(config-vlan)#name vlan20Vlan名稱(chēng)可以自行定義Switch#show vlan 查看vlan配置信息vlan10配置192.168.10.1/24的ip地址Switch#conf tSwitch(config)#vlan 10Switch(config-vlan)#name vlan10Switch(config-vlan)#exi
8、tSwitch(config)#interface vlan 10Switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#endSwitch#copy running-config startup-config配置ip地址的命令格式: ip address ip-address netmask測(cè)試常用端口類(lèi)型 Access / trunk將此端口設(shè)置為vlan10 的access口Switch(config-if)#switchport mode access Switch(config-if)#swit
9、chport access vlan 10Switch(config-if)#將此端口設(shè)置為vlan10 的trunk口Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10當(dāng)一個(gè)端口允許多個(gè)vlan通過(guò)時(shí),trunk allowed vlan中要添加各條vlan信息Switch(config-if)#switchport trunk encapsulation
10、dot1qSwitch(config-if)#switchport mode trunk Switch(config-if)# switchport trunk allowed vlan all Switch(config-if)#switchport trunk allowed vlan 10,50,60Switch(config-if)#switchport trunk allowed vlan add 20 (remove 刪除)Switch(config-if)#switchport trunk allowed vlan add 30Switch(config-if)#switchpo
11、rt trunk allowed vlan add 40Switch(config-if)#switchport trunk native vlan 1Switch(config-if)#no shutdownSwitch(config-if)#endSwitch#copy running-config startup-config 此端口為vlan10 vlan20 vlan30 vlan40的trunk口,default vlan 1經(jīng)過(guò)此端口時(shí)不會(huì)帶上標(biāo)簽。光端口配置Switch(config)#interface gigabitEthernet 0/25Switch(config-if
12、)# switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#no shutdown Switch(config-if)#endSwitch#copy running-config startup-config注意: 由于思科的交換機(jī)只自動(dòng)識(shí)別自己品牌的光模塊,所以如果用其他品牌的光模塊,需在配置模式下輸入一下兩條命令,開(kāi)啟兼容性。service unsupported-transceiverno errdisable detect cause gbic-invalid命令輸入完成后保
13、存設(shè)置重啟設(shè)備 端口鏡像配置Cisco 3560G配置全局配置下:Switch(config)#monitor session 1 destination interface gigabitEthernet 0/1Switch(config)#monitor session 1 source interface gigabitEthernet 0/2 both Switch(config)#monitor session 1 source interface gigabitEthernet 0/3 both monitor session 1 建立一個(gè)端口鏡像組Destination 監(jiān)控端口
14、Source 鏡像端口DHCP配置配置一個(gè)dhcp給vlan10內(nèi)的主機(jī)分配地址Switch(config)#service dhcpSwitch(config)#ip dhcp pool vlan10 Switch(dhcp-config)#network 192.168.10.0 255.255.255.0Switch(dhcp-config)#default-router 192.168.10.1Switch(dhcp-config)#dns-server 192.168.10.2Switch(dhcp-config)#lease 3 20 20 (天/小時(shí)/分鐘) (缺省為1天)Swi
15、tch(dhcp-config)#exitSwitch(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.19Switch(config)#ip dhcp excluded-address 排除某些地址,禁止被動(dòng)態(tài)分配DHCP設(shè)置是針對(duì)全局的,不是定義在某個(gè)接口上的。DHCP調(diào)試命令Switch(config)#no service dhcp 關(guān)閉dhcp服務(wù)Switch#show ip dhcp binding 查看dhcp分配情況思科作思科作DHCP server給給AP分地址分地址在server中設(shè)置Option43、Opt
16、ion60字段信息。Switch(config)#ip dhcp pool vlan20Switch(dhcp-config)#network 192.168.1.0 255.255.255.0Switch(dhcp-config)#default-router 192.168.1.1Switch(dhcp-config)#option 43 hex 0106 0104 c0a8 01e4Switch(dhcp-config)#option 60 hex xxxx xxxx xxxx (AC回的offer包中的信息)Switch(dhcp-config)# lease 1Switch(dhcp
17、-config)#endSwitch#copy running-config startup-configDHCP relay配置DHCP relay功能可以匯聚處于不同廣播域的客戶端的DHCP請(qǐng)求,轉(zhuǎn)發(fā)給DHCP服務(wù)器,并發(fā)送DHCP服務(wù)器的響應(yīng)給各個(gè)客戶端,也就是起到了DHCP報(bào)文在各個(gè)網(wǎng)段的轉(zhuǎn)發(fā)功能。Cisco的設(shè)備需要啟用ip helper-address命令,來(lái)實(shí)現(xiàn)此功能。配置了ip helper-address命令之后的交換機(jī)在中繼DHCP請(qǐng)求時(shí)的工作過(guò)程如下:(1)DHCP客戶端發(fā)送請(qǐng)求,由于沒(méi)有IP地址,所以自己的源IP地址為0.0.0.0,而且也不知道目的DHCP服務(wù)器的地址
18、,所以廣播255.255.255.255。該數(shù)據(jù)報(bào)文中還包括源mac地址和目的mac地址(全F)。(2)當(dāng)交換機(jī)接收到該數(shù)據(jù)包的時(shí)候,它就用自己的接口地址來(lái)取代源地址0.0.0.0,并且用ip helper-address命令置頂?shù)牡刂穪?lái)取代目的地址255.255.255.255。(3)當(dāng)DHCP服務(wù)器接收到交換機(jī)轉(zhuǎn)發(fā)過(guò)來(lái)的DHCP請(qǐng)求包時(shí),它會(huì)做出響應(yīng),并且由交換機(jī)把數(shù)據(jù)包轉(zhuǎn)發(fā)回客戶端。 DHCP relay 配置Switch(config)#vlan 100Switch(config-vlan)#name vlan100Switch(config-vlan)#int vlan 100Swi
19、tch(config-if)#ip helper-address 192.168.1.228Switch(config-if)#exitSwitch(config)#service dhcp Switch(config)#ip dhcp relay information trust-all Switch(config)#endSwitch#copy running-config startup-configDHCP relay功能測(cè)試實(shí)例:AC lan端口開(kāi)啟dhcp serverdhcp server1:192.168.20.10-192.168.20.100/24的地址,網(wǎng)關(guān)為192.1
20、68.20.1。dhcp server2:192.168.30.10-192.168.30.100/24的地址,網(wǎng)關(guān)為192.168.30.1。AC lan端口地址為192.168.1.228正確配置交換機(jī)和AC使AP獲得相應(yīng)地址并上線。AC lan3560GAP1AP2Vlan30Vlan20Vlan10Cisco 3560G配置interface GigabitEthernet0/1 interface Vlan10switchport access vlan 10 ip address 192.168.1.1 255.255.255.0switchport mode access!int
21、erface GigabitEthernet0/2 interface Vlan20 switchport access vlan 20 ip address 192.168.20.1 255.255.255.0 switchport mode access ip helper-address 192.168.1.228!interface GigabitEthernet0/3 interface Vlan30 switchport access vlan 30 ip address 192.168.30.1 255.255.255.0 switchport mode access ip he
22、lper-address 192.168.1.228ip routing service dhcp ip dhcp relay information trust-all AC配置瘦AP端口地址:192.168.1.228 255.255.255.0瘦AP端口DHCP: dhcp server1:192.168.20.10-192.168.20.100/24的地址,網(wǎng)關(guān)為192.168.20.1。dhcp server2:192.168.30.10-192.168.30.100/24的地址,網(wǎng)關(guān)為192.168.30.1。靜態(tài)路由:目的地址 0.0.0.0 子網(wǎng)掩碼 0.0.0.0 下一跳 1
23、92.168.1.1靜態(tài)路由設(shè)置Switch(config)#ip routing (全局路由)思科默認(rèn)不開(kāi)啟Switch(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.1 (靜態(tài)路由格式: 目的地址 子網(wǎng)掩碼 下一跳)靜態(tài)路由測(cè)試實(shí)例 3560GPC ACStaAPVlan2Vlan1Vlan3Vlan2AP通過(guò)dhcp方式上線,集中轉(zhuǎn)發(fā)正常廣播SSIDAC開(kāi)啟2個(gè)虛接口,STA連接vif1,Vif1屬于vlan1 地址192.168.10.1/24 ,vif2屬于vlan2 地址192.168.20.1/243560G 1端口與A
24、C的vif2相連,地址為192.168.20.2/243560G 2端口與PC相連,地址為192.168.30.1/24PC的地址為192.168.30.1/24 網(wǎng)關(guān)為192.168.30.1測(cè)試要求:STA正常獲得地址并且與PC通信。Cisco 3560G配置interface Vlan20ip address 192.168.20.2 255.255.255.0 interface Vlan30ip address 192.168.30.1 255.255.255.0ip route 192.168.10.0 255.255.255.0 192.168.20.1ip routingint
25、erface GigabitEthernet0/1 switchport access vlan 20 switchport mode accessinterface GigabitEthernet0/2 switchport access vlan 30 switchport mode accessAC開(kāi)啟2個(gè)虛接口vif1、vif2,vif1開(kāi)啟dhcp server功能,給STA分配地址,同時(shí)將vif1的地址設(shè)置為網(wǎng)關(guān)。同時(shí)配置靜態(tài)路由目的地址 192.168.30.0子網(wǎng)掩碼 255.255.255.0下一跳: 192.168.20.2測(cè)試實(shí)例三層漫游 在三層交換機(jī)上劃分三個(gè)VLAN,VLAN10 VLAN20 VLAN30,其管理地址分別為192.168.1
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 企業(yè)培訓(xùn)課件下載
- 企業(yè)培訓(xùn)誠(chéng)信課件
- 營(yíng)養(yǎng)與健康(試題及答案)
- Photoshop平面設(shè)計(jì)基礎(chǔ) 課件 任務(wù)2.5 修復(fù)老照片
- 企業(yè)培訓(xùn)商務(wù)禮儀課件
- 企業(yè)垃圾處理培訓(xùn)課件
- 成都商鋪?zhàn)赓U合同范本(含租賃保證金及違約責(zé)任)
- 裝修進(jìn)場(chǎng)儀式布置方案
- 市場(chǎng)競(jìng)爭(zhēng)情報(bào)調(diào)研合同
- 餐飲企業(yè)食品安全監(jiān)管責(zé)任合同
- 電影音樂(lè)欣賞智慧樹(shù)知到期末考試答案章節(jié)答案2024年華南農(nóng)業(yè)大學(xué)
- 混凝土構(gòu)件之梁配筋計(jì)算表格(自動(dòng)版)
- 閥門(mén)設(shè)計(jì)計(jì)算書(shū)(帶公式)
- 新蘇科版七年級(jí)下冊(cè)初中數(shù)學(xué)全冊(cè)教案
- 數(shù)學(xué)建模試卷分析
- 《干部履歷表》(電子版)
- 高一物理學(xué)案(必修1)
- 保密工作臺(tái)賬實(shí)用表格
- 2020女性生育力保存國(guó)際指南解讀(完整版)
- 廣東省初級(jí)中學(xué)學(xué)生學(xué)籍表
- 工商管理-樊登讀書(shū)020營(yíng)銷(xiāo)模式研究
評(píng)論
0/150
提交評(píng)論