路由器基本配置命令_第1頁
路由器基本配置命令_第2頁
路由器基本配置命令_第3頁
路由器基本配置命令_第4頁
路由器基本配置命令_第5頁
已閱讀5頁,還剩2頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、1. switch配置命令(1)模式轉換命令用戶模式-特權模式,使用命令enable特權模式-全局配置模式,使用命令configt全局配置模式-接口模式,使用命令interface+接口類型+接口號全局配置模式-線控模式,使用命令line+接口類型+接口號注:用戶模式:查看初始化的信息.特權模式:查看所有信息、調(diào)試、保存配置信息全局模式:配置所有信息、針對整個路由器或交換機的所有接口接口模式:針對某一個接口的配置線控模式:對路由器進行控制的接口配置(2)配置命令show running config 顯示所有的配置show versin 顯示版本號和寄存器值shut down 關閉接口no s

2、hutdown 打開接口ip add +ip地址配置IP地址secondary+IP地址為接口配置第二個IP地址show interface+接口類型+接口號查看接口管理性show controllers interface 查看接口是否有DCE電纜show history 查看歷史記錄show terminal 查看終端記錄大小hostname+主機名配置路由器或交換機的標識config memory 修改保存在NVRAM中的啟動配置exec timeout 0 0 設置控制臺會話超時為0service password-encryptin 手工加密所有密碼enable password +

3、密碼配置明文密碼ena sec +密碼配置密文密碼line vty 0 4/15 進入telnet接口password +密碼配置telnet密碼line aux 0 進入AUX接口password +密碼配置密碼line con 0 進入CON接口password +密碼配置密碼bandwidth+數(shù)字配置帶寬no ip address 刪除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中

4、的配置信息show ip interface brief 查看接口的謫要信息banner motd # +信息 + # 配置路由器或交換機的描素信息description+信息配置接口聽描素信息vlan database 進入VLAN數(shù)據(jù)庫模式vlan +vlan號+ 名稱創(chuàng)建VLANswitchport access vlan +vlan號為VLAN為配接口interface vlan +vlan號進入VLAN接口模式ip add +ip地址為VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的V

5、TP域名vtp +password +密碼配置SW的密碼switchport mode trunk 啟用中繼no vlan +vlan號刪除VLANshow spamming-tree vlan +vlan號查看VLA怕生成樹議 2. 路由器配置命令ip route+非直連網(wǎng)段+子網(wǎng)掩碼+下一跳地址配置靜態(tài)/默認路由show ip route 查看路由表show protocols 顯示出所有的被動路由協(xié)議和接口上哪些協(xié)議被設置show ip protocols 顯示了被配置在路由器上的路由選擇協(xié)議,同時給出了在路由選擇協(xié)議中使用的定時器等信息router rip 激活RIP協(xié)議network

6、 +直連網(wǎng)段發(fā)布直連網(wǎng)段interface lookback 0 激活邏輯接口passive-interface +接口類型+接口號配置接口為被動模式debug ip +協(xié)議動態(tài)查看路由更新信息undebug all 關閉所有DEBUG信息router eigrp +as號激活EIGRP路由協(xié)議network +網(wǎng)段+子網(wǎng)掩碼發(fā)布直連網(wǎng)段show ip eigrp neighbors 查看鄰居表show ip eigrp topology 查看拓撲表show ip eigrp traffic 查看發(fā)送包數(shù)量router ospf +process-ID 激活OSPF協(xié)議network+直連網(wǎng)段

7、+area+區(qū)域號發(fā)布直連網(wǎng)段show ip ospf 顯示OSPF的進程號和ROUTER-IDencapsulation+封裝格式更改封裝格式no ip admain-lookup 關閉路由器的域名查找ip routing 在三層交換機上啟用路由功能show user 查看SW的在線用戶clear line +線路號清除線路 3. 三層交換機配置命令配置一組二層端口configure terminal 進入配置狀態(tài)nterface range port-range 進入組配置狀態(tài)配置三層端口configureterminal 進入配置狀態(tài)interface fastethernet | gi

8、gabitethernet interface-id | vlan vlan-id |port-channel port-channel-number 進入端口配置狀態(tài)no switchport 把物理端口變成三層口ip address ip_address subnet_mask 配置IP地址和掩碼no shutdown 激活端口 例: Switch(config)# interface gigabitethernet0/2 Switch(config-if)# no switchport Switch(config-if)# ip address 1 255.255

9、.255.0 Switch(config-if)# no shutdown配置VLANconfigure terminal 進入配置狀態(tài)vlan vlan-id 輸入一個VLAN號, 然后進入vlan配態(tài),可以輸入一個新的VLAN號或舊的來進行修改。name vlan-name 可選)輸入一個VLAN名,如果沒有配置VLAN名,缺省的名字是VLAN號前面用0填滿的4位數(shù),如VLAN0004是VLAN4的缺省名字mtu mtu-size (可選) 改變MTU大小 例 Switch# configure terminal Switch(config)# vlan 20 Switch(config-

10、vlan)# name test20 Switch(config-vlan)# end 或 Switch# vlan database Switch(vlan)# vlan 20 name test20 Switch(vlan)# exit將端口分配給一個VLANconfigure terminal 進入配置狀態(tài)interface interface-id 進入要分配的端口switchport mode access 定義二層口switchport access vlan vlan-id 把端口分配給某一VLAN 例 Switch# configure terminal Enter confi

11、guration commands, one per line. End with CNTL/Z. Switch(config)# interface fastethernet0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 2 Switch(config-if)# end Switch#配置VLAN trunkconfigure terminal 進入配置狀態(tài)interface interface-Id 進入端口配置狀態(tài)switchport trunk encapsu

12、lation isl | dot1q | negotiate配置trunk封裝ISL 或 802.1Q 或自動協(xié)商switchport mode dynamic auto | desirable | trunk 配置二層trunk模式。dynamic auto自動協(xié)商是否成為trunkdynamic desirable把端口設置為trunk如果對方端口是trunk, desirable, 配置Native VLAN(802.1q)或自動模式,trunk設置端口為強制的trunk方式,而不理會對方端口是否為trunkswitchport access vlan vlan-id 可選) 指定一個缺

13、省VLAN, 如果此端口不再是trunkswitchport trunk native vlan vlan-id 指定802.1Q native VLAN號 例: Switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# interface fastethernet0/4 Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk encapsulati

14、on dot1q Switch(config-if)# end定義TRUNK允許的VLANconfigure terminal子進入配置狀態(tài)interface interface-id 進入端口配置switchport mode trunk 配置二層口為trunkswitchport trunk allowed vlan add | all | except | remove vlan-list可選) 配置trunk允許的VLAN.使用add, all, except, remove關健字no switchport trunk allowed vlan 允許所有VLAN通過 例 Switch(

15、config)# interface fastethernet0/1 Switch(config-if)# switchport trunk allowed vlan remove 2 Switch(config-if)# end配置NativeVLAN(802.1q)configure terminal 進入配置狀態(tài)interface interface-id 進入配置成802.1qtrunk的端口switchport trunk native vlan vlan-Id 配置native VLAN號no switchport trunk native vlan 端口配置命令回到缺省的狀態(tài)配置

16、基于端口權值的負載均衡configure terminal 進入Switch 1配置狀態(tài)vtp domain domain-name 配置VTP域vtp mode server 將Switch 1配置成VTP server.show vtp status 驗證VTP的配置show vlan 驗證VLANconfigure terminal 進入配置狀態(tài)interface fastethernet 0/1 進入F0/1端口switchport trunk encapsulation isl | dot1q | negotiate配置trunk封裝switchport mode trunk 配置成

17、trunkshow interfaces fastethernet0/1 switchport 驗證VLAN配置按以上步驟對想要負載均衡的接口進行配置 在另一個交換機上進行此配置show vlan 當trunk已經(jīng)起來,在switch2上驗證已經(jīng)學到相的vlan配置configure terminal 在Switch 1上進入配置狀態(tài)interface fastethernet0/1 進入要配置的端口spanning-tree vlan 8 port-priority 10 將端口權值10賦與VLAN 8.spanning-tree vlan 9 port-priority 10 將端口權值1

18、0賦與VLAN 9.spanning-tree vlan 10 port-priority 10 將端口權值10賦與VLAN 10.interface fastethernet0/2 進入F0/2spanning-tree vlan 3 port-priority 10 將端口權值10賦與VLAN 3.spanning-tree vlan 4 port-priority 10 將端口權值10賦與VLAN 4spanning-tree vlan 5 port-priority 10 將端口權值10賦與VLAN 5spanning-tree vlan 6 port-priority 10 將端口權

19、值10賦與VLAN 10end 退出show running-config 驗證配置copy running-config startup-config 保存配置 配置STP路徑值的負載均衡Trunk1走VLAN810,Trunk2走VLAN24configureterminal 進入 Switch 1配置狀態(tài)interface fastethernet 0/1 進入F0/1switchport trunk encapsulation isl | dot1q | negotiate配置封裝switchport mode trunk 配置Trunk,缺省是ISL封裝exit 退回在F0/2口上重

20、復24步驟exit 退回show running-config 驗證配置show vlan驗證switch1 已經(jīng)學到Vlanconfigure terminal 進入配置狀態(tài)interface fastethernet 0/1 進入F0/1spanning-tree vlan 2 cost 30 設置Vlan2生成樹路徑值為30spanning-tree vlan 3 cost 30 設置Vlan3生成樹路徑值為30spanning-tree vlan 4 cost 30 設置Vlan4生成樹路徑值為30end 退出在switch1的F0/2上重復911步驟設置VLAN8,9,10生成樹路徑

21、值為30end 退出show running-config 驗證配置copy running-config startup-config 保存配置補充:CISCO命令集路由選擇協(xié)議及排障 *ip route命令 Router(config)#ip route 子網(wǎng)掩碼 管理距離0255,默認為1 (注:靜態(tài)地址配置) *ip default-network命令Router(config)#ip default-network (注:配合路由協(xié)使用,用其中的一個動態(tài)路由號作默認路由配置)Router(config)# ip route (注:只有一個公網(wǎng)地址時,在

22、出口路由器上的配置) *內(nèi)部路由選擇協(xié)議 *使用router和network命令Router(config)#router 自主系統(tǒng)號Router(config-router)# network Router(config-router)# network *路由信息協(xié)議RIPRouter(config)#router ripRouter(config-router)# network Router# show ip protocolsRouter# show ip routeRouter# debug ip rip *內(nèi)部網(wǎng)關路由協(xié)議IGRPRouter(config)#router igrp Router

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論