科技生活動態:思科交換機的基本配置命令學習小結

導讀跟大家講解下有關思科交換機的基本配置命令學習小結,相信小伙伴們對這個話題應該也很關注吧,現在就為小伙伴們說說思科交換機的基本配置命

跟大家講解下有關思科交換機的基本配置命令學習小結,相信小伙伴們對這個話題應該也很關注吧,現在就為小伙伴們說說思科交換機的基本配置命令學習小結,小編也收集到了有關思科交換機的基本配置命令學習小結的相關資料,希望大家看到了會喜歡。

思科交換機的基本配置命令學習

CISCO交換機基本配置:Console端口連接用戶模式hostname# ;特權模式hostname(config)# ;全局配置模式hostname(config-if)# ;

交換機口令設置:switch>enable ;進入特權模式switch#config terminal ;進入全局配置模式switch(config)#hostname csico ;設置交換機的主機名switch(config)#enable secret csico1 ;設置特權加密口令switch(config)#enable password csico8 ;設置特權非密口令switch(config)#line console 0 ;進入控制臺口switch(config-line)#line vty 0 4 ;進入虛擬終端switch(config-line)#login ;虛擬終端允許登錄switch(config-line)#password csico6 ;設置虛擬終端登錄口令csico6switch#exit ;返回命令

交換機VLAN創建,刪除,端口屬性的設置,配置trunk端口,將某端口加入vlan中,配置VTP:switch#vlan database ;進入VLAN設置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名為vlan3switch(vlan)#no vlan 2 ;刪vlan 2switch(config)#int f0/1 ;進入端口1switch(config)#speed ? 查看speed命令的子命令switch(config)#speed 100 設置該端口速率為100mb/s (10/auto)switch(config)#duplex ? 查看duplex的子命令switch(config)#duplex full 設置該端口為全雙工(auto/half)switch(config)#description TO_PC1 這是該端口描述為TO_PC1switch(config-if)#switchport access vlan 2 ;當前端口加入vlan 2switch(config-if)#switchport mode trunk ;設置為trunk模式(access模式)switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlanswitch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼switch(config)#vtp domain vtpserver ;設置vtp域名相同switch(config)#vtp password ;設置發vtp密碼switch(config)#vtp server ;設置vtp服務器模式switch(config)#vtp client ;設置vtp客戶機模式

交換機設置IP地址,默認網關,域名,域名服務器,配置和查看MAC地址表:switch(config)#interface vlan 1 ;進入vlan 1switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;設置IP地址switch(config)#ip default-gateway 192.168.1.6 ;設置默認網關switch(config)#ip domain-name cisco.com 設置域名switch(config)#ip name-server 192.168.1.18 設置域名服務器switch(config)#mac-address-table? 查看mac-address-table的子命令switch(config)#mac-address-table aging-time 100 設置超時時間為100msswitch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3端口switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入靜態地址目標端口f0/6源端口f0/7switch(config)#endswitch#show mac-address-table 查看整個MAC地址表switch#clear mac-address-table restricted static 清除限制性靜態地址

交換機顯示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看當前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息switch#show int f0/0 status;查看指定端口狀態switch#dir flash: ;查看閃存

Cisco路由器配置命令大全網絡 2010-06-26 06:43:44 閱讀657 評論0 字號:大中小 訂閱 .

(1)模式轉換命令用戶模式----特權模式,使用命令"enable"特權模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口類型+接口號"全局配置模式----線控模式,使用命令"line+接口類型+接口號"注:用戶模式:查看初始化的信息.特權模式:查看所有信息、調試、保存配置信息全局模式:配置所有信息、針對整個路由器或交換機的所有接口接口模式:針對某一個接口的配置線控模式:對路由器進行控制的接口配置(2)配置命令show running config 顯示所有的配置show versin 顯示版本號和寄存器值shut down 關閉接口no shutdown 打開接口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 +密碼 配置明文密碼ena sec +密碼 配置密文密碼line vty 0 4/15 進入telnet接口password +密碼 配置telnet密碼line aux 0 進入AUX接口password +密碼 配置密碼line con 0 進入CON接口password +密碼 配置密碼bandwidth+數字 配置帶寬no ip address 刪除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的謫要信息banner motd # +信息 + # 配置路由器或交換機的描素信息description+信息 配置接口聽描素信息vlan database 進入VLAN數據庫模式vlan +vlan號+ 名稱 創建VLANswitchport access vlan +vlan號 為VLAN為配接口interface vlan +vlan號 進入VLAN接口模式ip add +ip地址 為VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名 配置SW的VTP域名vtp +password +密碼 配置SW的密碼switchport mode trunk 啟用中繼no vlan +vlan號 刪除VLANshow spamming-tree vlan +vlan號 查看VLA怕生成樹議

2. 路由器配置命令ip route+非直連網段+子網掩碼+下一跳地址 配置靜態/默認路由show ip route 查看路由表show protocols 顯示出所有的被動路由協議和接口上哪些協議被設置show ip protocols 顯示了被配置在路由器上的路由選擇協議,同時給出了在路由選擇協議中使用

的定時器等信息router rip 激活RIP協議network +直連網段 發布直連網段interface lookback 0 激活邏輯接口passive-interface +接口類型+接口號 配置接口為被動模式debug ip +協議 動態查看路由更新信息undebug all 關閉所有DEBUG信息router eigrp +as號 激活EIGRP路由協議network +網段+子網掩碼 發布直連網段show ip eigrp neighbors 查看鄰居表show ip eigrp topology 查看拓撲表show ip eigrp traffic 查看發送包數量router ospf +process-ID 激活OSPF協議network+直連網段+area+區域號 發布直連網段show ip ospf 顯示OSPF的進程號和ROUTER-IDencapsulation+封裝格式 更改封裝格式no ip admain-lookup 關閉路由器的域名查找ip routing 在三層交換機上啟用路由功能show user 查看SW的在線用戶clear line +線路號 清除線路

3. 三層交換機配置命令配置一組二層端口configure terminal 進入配置狀態nterface range {port-range} 進入組配置狀態配置三層端口configure terminal 進入配置狀態interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-

channel port-channel-number} 進入端口配置狀態no switchport 把物理端口變成三層口ip address ip_address subnet_mask 配置IP地址和掩碼no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 進入配置狀態vlan vlan-id 輸入一個VLAN號, 然后進入vlan配態,可以輸入一個新的VLAN號或舊的來進行修改

。name vlan-name 可選)輸入一個VLAN名,如果沒有配置VLAN名,缺省的名字是VLAN號前面用0填滿

的4位數,如VLAN0004是VLAN4的缺省名字mtu mtu-size (可選) 改變MTU大小例Switch# configure terminalSwitch(config)# vlan 20Switch(config-vlan)# name test20Switch(config-vlan)# end或Switch# vlan databaseSwitch(vlan)# vlan 20 name test20Switch(vlan)# exit將端口分配給一個VLANconfigure terminal 進入配置狀態interface interface-id 進入要分配的端口switchport mode access 定義二層口switchport access vlan vlan-id 把端口分配給某一VLAN例Switch# configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)# interface fastethernet0/1Switch(config-if)# switchport mode accessSwitch(config-if)# switchport access vlan 2Switch(config-if)# endSwitch#配置VLAN trunkconfigure terminal 進入配置狀態interface interface-Id 進入端口配置狀態switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封裝ISL 或 802.1Q 或

自動協商switchport mode {dynamic {auto | desirable} | trunk} 配置二層trunk模式。dynamic auto—自動協商是否成為trunkdynamic desirable—把端口設置為trunk如果對方端口是trunk, desirable, 配置Native VLAN

(802.1q)或自動模式,trunk—設置端口為強制的trunk方式,而不理會對方端口是否為trunkswitchport access vlan vlan-id 可選) 指定一個缺省VLAN, 如果此端口不再是trunkswitchport trunk native vlan vlan-id 指定802.1Q native VLAN號例:Switch# configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)# interface fastethernet0/4Switch(config-if)# switchport mode trunkSwitch(config-if)# switchport trunk encapsulation dot1qSwitch(config-if)# end定義TRUNK允許的VLANconfigure terminal子 進入配置狀態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(config)# interface fastethernet0/1Switch(config-if)# switchport trunk allowed vlan remove 2Switch(config-if)# end配置Native VLAN(802.1q)configure terminal 進入配置狀態interface interface-id 進入配置成802.1qtrunk的端口switchport trunk native vlan vlan-Id 配置native VLAN號no switchport trunk native vlan 端口配置命令回到缺省的狀態配置基于端口權值的負載均衡configure terminal 進入Switch 1配置狀態vtp domain domain-name 配置VTP域vtp mode server 將Switch 1配置成VTP server.show vtp status 驗證VTP的配置show vlan 驗證VLANconfigure terminal 進入配置狀態interface fastethernet 0/1 進入F0/1端口switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封裝switchport mode trunk 配置成trunkshow interfaces fastethernet0/1 switchport 驗證VLAN配置按以上步驟對想要負載均衡的接口進行配置在另一個交換機上進行此配置show vlan 當trunk已經起來,在switch2上驗證已經學到相的vlan配置configure terminal 在Switch 1上進入配置狀態interface fastethernet0/1 進入要配置的端口spanning-tree vlan 8 port-priority 10 將端口權值10賦與VLAN 8.spanning-tree vlan 9 port-priority 10 將端口權值10賦與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 將端口權值10賦與VLAN 10end 退出show running-config 驗證配置copy running-config startup-config 保存配置

配置STP路徑值的負載均衡Trunk1走VLAN8-10,Trunk2走VLAN2-4

configure terminal 進入 Switch 1配置狀態interface fastethernet 0/1 進入F0/1switchport trunk encapsulation {isl | dot1q | negotiate}配置封裝switchport mode trunk 配置Trunk,缺省是ISL封裝exit 退回在F0/2口上重復2-4步驟exit 退回show running-config 驗證配置show vlan驗證switch1 已經學到Vlanconfigure terminal 進入配置狀態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上重復9-11步驟設置VLAN8,9,10生成樹路徑值為30end 退出show running-config 驗證配置copy running-config startup-config 保存配置

補充:CISCO命令集——路由選擇協議及排障*ip route命令

Router(config)# ip route <目錄網絡或子網號> [子網掩碼] <下一路由器IP地址 | 從本地出口

的地址> [管理距離0~255,默認為1](注:靜態地址配置)

*ip default-network命令

Router(config)# ip default-network <目標網絡號>(注:配合路由協使用,用其中的一個動態路由號作默認路由配置)Router(config)# ip route 0.0.0.0 0.0.0.0 <下一路由器IP地址 | 從本地出口的地址>(注:只有一個公網地址時,在出口路由器上的配置)

*內部路由選擇協議

*使用router和network命令

Router(config)# router <路由協議rip | igrp | eigrp | ospf | is-is等> [自主系統號]Router(config-router)# network <直接相連的要用此路由協議的網絡號>Router(config-router)# network <直接相連的要用此路由協議的網絡號>

*路由信息協議RIP

Router(config)# router ripRouter(config-router)# network <直接相連的要用rip協議的有類別網絡號>Router# show ip protocolsRouter# show ip routeRouter# debug ip rip

*內部網關路由協議IGRP

Router(config)# router igrp <自主系統號>Router(config-router)# network <直接相連的要用igrp協議的有類別網絡號>Router# show ip interfaceRouter# show ip protocolsRouter# show ip routeRouter# debug ip rip

*排除網絡故障

排除網絡故障的一個總體模型

Router# ping <有故障的主機 | 有故障的IP地址>Router# show ip routeRouter# show interface <有故障的接口>Router# show run

*IP的故故障排除

檢查可用的路由

Router# show ip route <有故障的IP地址>27.4.4 跟蹤路由(Tracing the Route)SUN-A> traceroute <有故障的主機 | 有故障的IP地址>C:/windows/> winipcfgC:/windows/> ipconfigC:/windows/> ipconfig / allC:/windows/> tracert <有故障的主機 | 有故障的IP地址>

使用擴展的ping來跟蹤連接性

Router# ping

*其它可能的故障

一個地址解析(ARP)的故障

Router# show arpRouter# show interface <有故障的接口>C:/windows/> arp -aSUN-A> arp –a

驗證終端系統的路由表C:/windows/> netstat –rnC:/windows/> route –f add 0.0.0.0 mask 0.0.0.0 <需要添加入的網關地址>C:/windows/> route [–f ] [[print | add | delete | change] [destination] [mask

netmask] [gateway]]C:/windows/> route add mask <網絡掩碼> <網關ip地址>C:/windows/> route delete mask <網絡掩碼> <網關ip地址>C:/windows/> nbtstat <相應的參數>SUN-A> netstat -rn路由器

CISCO交換機配置命令大全2009-08-13 21:131.在基于IOS的交換機上設置主機名/系統名:switch(config)# hostname hostname在基于CLI的交換機上設置主機名/系統名:switch(enable) set system name name-string

2.在基于IOS的交換機上設置登錄口令:switch(config)# enable password level 1 password在基于CLI的交換機上設置登錄口令:switch(enable) set passwordswitch(enable) set enalbepass

3.在基于IOS的交換機上設置遠程訪問:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address在基于CLI的交換機上設置遠程訪問:switch(enable) set interface sc0 ip-address netmask broadcast-addressswitch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway

4.在基于IOS的交換機上啟用和瀏覽CDP信息:switch(config-if)# cdp enableswitch(config-if)# no cdp enable為了查看Cisco鄰接設備的CDP通告信息:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]在基于CLI的交換機上啟用和瀏覽CDP信息:switch(enable) set cdp {enable|disable} module/port為了查看Cisco鄰接設備的CDP通告信息:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]

5.基于IOS的交換機的端口描述:switch(config-if)# description description-string基于CLI的交換機的端口描述:switch(enable)set port name module/number description-string

6.在基于IOS的交換機上設置端口速度:switch(config-if)# speed{10|100|auto}在基于CLI的交換機上設置端口速度:switch(enable) set port speed moudle/number {10|100|auto}switch(enable) set port speed moudle/number {4|16|auto}

7.在基于IOS的交換機上設置以太網的鏈路模式:switch(config-if)# duplex {auto|full|half}在基于CLI的交換機上設置以太網的鏈路模式:switch(enable) set port duplex module/number {full|half}

8.在基于IOS的交換機上配置靜態VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vla

switch(vlan)# exitswitch# configure teriminalswitch(config)# interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# end在基于CLI的交換機上配置靜態VLAN:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list

9. 在基于IOS的交換機上配置VLAN中繼線:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation {isl|dotlq}switch(config-if)# switchport trunk allowed vlan remove vlan-listswitch(config-if)# switchport trunk allowed vlan add vlan-list在基于CLI的交換機上配置VLAN中繼線:switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]Vlan-range [isl|dotlq|dotl0|lane|negotiate]

10.在基于IOS的交換機上配置VTP管理域:switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI的交換機上配置VTP管理域:switch(enable) set vtp [domain domain-name]

11.在基于IOS的交換機上配置VTP 模式:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password password在基于CLI的交換機上配置VTP 模式:switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]

12. 在基于IOS的交換機上配置VTP版本:switch# vlan databaseswitch(vlan)# vtp v2-mode在基于CLI的交換機上配置VTP版本:switch(enable) set vtp v2 enable

13. 在基于IOS的交換機上啟動VTP剪裁:switch# vlan databaseswitch(vlan)# vtp pruning在基于CL I 的交換機上啟動VTP剪裁:switch(enable) set vtp pruning enable

14.在基于IOS的交換機上配置以太信道:switch(config-if)# port group group-number [distribution {source|destination}]在基于CLI的交換機上配置以太信道:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto}

15.在基于IOS的交換機上調整根路徑成本:switch(config-if)# spanning-tree [vlan vlan-list] cost cost在基于CLI的交換機上調整根路徑成本:

switch(enable) set spantree portcost moudle/port costswitch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list]

16.在基于IOS的交換機上調整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority在基于CLI的交換機上調整端口ID:switch(enable) set spantree portpri {mldule/port}priorityswitch(enable) set spantree portvlanpri {module/port}priority [vlans]

17. 在基于IOS的交換機上修改STP時鐘:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)# spanning-tree [vlan vlan-list] forward-time seconds` switch(config)# spanning-tree [vlan vlan-list] max-age seconds在基于CLI的交換機上修改STP時鐘:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]

18. 在基于IOS的交換機端口上啟用或禁用Port Fast 特征:switch(config-if)#spanning-tree portfast在基于CLI的交換機端口上啟用或禁用Port Fast 特征:switch(enable) set spantree portfast {module/port}{enable|disable}

19. 在基于IOS的交換機端口上啟用或禁用UplinkFast 特征:switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]在基于CLI的交換機端口上啟用或禁用UplinkFast 特征:switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]

20. 為了將交換機配置成一個集群的命令交換機,首先要給管理接口分配一個IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name

21. 為了從一條中繼鏈路上刪除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range

22. 用show vtp domain 顯示管理域的VTP參數.

23. 用show vtp statistics顯示管理域的VTP參數.

24. 在Catalyst交換機上定義TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}]

25. 在Catalyst交換機上定義TrCRF的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf{ring hex-ring-num|decring decimal-ring-num} parent vlan-num

26. 在創建好TrBRF VLAN之后,就可以給它分配交換機端口.對于以太網交換,可以采用如下命令給VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num

27. 命令show spantree顯示一個交換機端口的STP狀態.

28. 配置一個ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multiointATM(config-subif)# lane serber-bus ethernet elan-name

29. 配置LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-addressATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressATM(lane-config-databade)# name …

30. 創建完數據庫后,必須在主接口上啟動LECS.命令如下:ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address

31. 將每個LEC配置到一個不同的ATM子接口上.命令如下:ATM(config)# interface atm number.subint multipointATM(config)# lane client ethernet vlan-num elan-num

32. 用show lane server 顯示LES的狀態.

33. 用show lane bus顯示bus的狀態.

34. 用show lane database顯示LECS數據庫可內容.

35. 用show lane client顯示LEC的狀態.

36. 用show module顯示已安裝的模塊列表.

37. 用物理接口建立與VLAN的連接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown

38. 用中繼鏈路來建立與VLAN的連接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask

39. 用LANE 來建立與VLAN的連接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# …

40. 為了在路由處理器上進行動態路由配置,可以用下列IOS命令來進行:router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number

41. 配置默認路由:switch(enable) set ip route default gateway

42. 為一個路由處理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num

43. 在路由處理器啟用MLSP:router(config)# mls rp ip

44. 為了把一個外置的路由處理器接口和交換機安置在同一個VTP域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name

45. 查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name

46. 要確定RSM或路由器上的管理接口,可以在接口模式下輸入下列命令:router(config-if)#mls rp management-interface

47. 要檢驗MLS-RP的配置情況:router# show mls rp

48. 檢驗特定接口上的MLS配置:router# show mls rp interface interface number

49. 為了在MLS-SE上設置流掩碼而又不想在任一個路由處理器接口上設置訪問列表:set mls flow [destination|destination-source|full]

50. 為使MLS和輸入訪問列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl

51. 當某個交換機的第3層交換失效時,可在交換機的特權模式下輸入下列命令:switch(enable) set mls enable

52. 若想改變老化時間的值,可在特權模式下輸入以下命令:switch(enable) set mls agingtime agingtime

53. 設置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold

54. 確定那些MLS-RP和MLS-SE參與了MLS,可先顯示交換機引用列表中的內容再確定:switch(enable) show mls include

55. 顯示MLS高速緩存記錄:switch(enable) show mls entry

56. 用命令show in arp顯示ARP高速緩存區的內容。

57. 要把路由器配置為HSRP備份組的成員,可以在接口配置模式下使用下面的命令:router(config-if)# standby group-number ip ip-address

58. 為了使一個路由器重新恢復轉發路由器的角色,在接口配置模式下:router(config-if)# standy group-number preempt

59. 訪問時間和保持時間參數是可配置的:router(config-if)# standy group-number timers hellotime holdtime

60. 配置HSRP跟蹤:router(config-if)# standy group-number track type-number interface-priority

61. 要顯示HSRP路由器的狀態:router# show standby type-number group brief

62. 用命令show ip igmp確定當選的查詢器。

63. 啟動IP組播路由選擇:router(config)# ip muticast-routing

64. 啟動接口上的PIM:dalllasr1>(config-if)# ip pim {dense-mode|sparse-mode|sparse-dense-mode}

65. 啟動稀疏-稠密模式下的PIM:router# ip multicast-routingrouter# interface type numberrouter# ip pim sparse-dense-mode

66. 核實PIM的配置:dallasr1># show ip pim interface[type number] [count]

67. 顯示PIM鄰居:dallasr1># show ip neighbor type number

68. 為了配置RP的地址,命令如下:dallasr1># ip pim rp-address ip-address [group-access-list-number][override]

69. 選擇一個默認的RP:dallasr1># ip pim rp-address通告RP和它所服務的組范圍:dallasr1># ip pim send-rp-announce type number scope ttl group-list access-list-number為管理范圍組通告RP的地址:dallasr1># ip pim send-rp-announce ethernet0 scope 16 group-list1dallasr1># access-list 1 permit 266.0.0.0 0.255.255.255設定一個RP映像代理:dallasr1># ip pim send-rp-discovery scope ttl核實組到RP的映像:dallasr1># show ip pim rp mappingdallasr1># show ip pim rp [group-name|group-address] [mapping]

70. 在路由器接口上用命令ip multicast ttl-threshold ttl-value設定TTL閥值:dallasr1>(config-if)# ip multicast ttl-threshold ttl-value

71. 用show ip pim neighbor顯示PIM鄰居表。

72. 顯示組播通信路由表中的各條記錄:dallasr1>show ip mroute [group-name|group-address][scoure][summary][count][active kbps]

73. 要記錄一個路由器接受和發送的全部IP組播包:dallasr1> #debug ip mpacket [detail] [access-list][group]

74. 要在CISCO路由器上配置CGMP:dallasr1>(config-if)# ip cgmp

75.配置一個組播路由器,使之加入某一個特定的組播組:dallasr1>(config-if)# ip igmp join-group group-address

76. 關閉 CGMP:dallasr1>(config-if)# no ip cgmp

77. 啟動交換機上的CGMP:dallasr1>(enable) set cgmp enable

78. 核實Catalyst交換機上CGMP的配置情況:catalystla1>(enable) show configset prompt catalystla1>set interface sc0 192.168.1.1 255.255.255.0set cgmp enable

79. CGMP離開的設置:Dallas_SW(enable) set cgmp leave

80. 在Cisco設備上修改控制端口密碼:R1(config)# line console 0R1(config-line)# loginR1(config-line)# password LisbonR1(config)# enable password LilbaoR1(config)# login localR1(config)# username student password cisco

81. 在Cisco設備上設置控制臺及vty端口的會話超時:R1(config)# line console 0R1(config-line)# exec-timeout 5 10R1(config)# line vty 0 4R1(config-line)# exec-timeout 5 2

82. 在Cisco設備上設定特權級:R1(config)# privilege configure level 3 usernameR1(config)# privilege configure level 3 copy run startR1(config)# privilege configure level 3 pingR1(config)# privilege configure level 3 show runR1(config)# enable secret level 3 cisco

83. 使用命令privilege 可定義在該特權級下使用的命令:router(config)# privilege mode level level command

84. 設定用戶特權級:router(config)# enable secret level 3 dallasrouter(config)# enable secret san-franrouter(config)# username student password cisco

85. 標志設置與顯示:R1(config)# banner motd ‘unauthorized access will be prosecuted!’

86. 設置vty訪問:R1(config)# access-list 1 permit 192.168.2.5R1(config)# line vty 0 4R1(config)# access-class 1 in

87. 配置HTTP訪問:Router3(config)# access-list 1 permit 192.168.10.7Router3(config)# ip http severRouter3(config)# ip http access-class 1Router3(config)# ip http authentication localRouter3(config)# username student password cisco

88. 要啟用HTTP訪問,請鍵入以下命令:switch(config)# ip http sever

89. 在基于set命令的交換機上用setCL1啟動和核實端口安全:switch(enable) set port security mod_num/port_num…enable mac addressswitch(enable) show port mod_num/port_num在基于CiscoIOS命令的交換機上啟動和核實端口安全:switch(config-if)# port secure [mac-mac-count maximum-MAC-count]switch# show mac-address-table security [type module/port]

90. 用命令access-list在標準通信量過濾表中創建一條記錄:Router(config)# access-list access-list-number {permit|deny} source-address [source-address]

91. 用命令access-list在擴展通信量過濾表中創建一條記錄:Router(config)# access-list access-list-number {permit|deny{protocol|protocol-keyword}}{source source-wildcard|any}{destination destination-wildcard|any}[protocol-specific options][log]

92. 對于帶內路由更新,配置路由更新的最基本的命令格式是:R1(config-router)#distribute-list access-list-number|name in [type number]

93. 對于帶外路由更新,配置路由更新的最基本的命令格式是:R1(config-router)#distribute-list access-list-number|name out [interface-name] routing-process| autonomous-system-number

94. set snmp命令選項:set snmp community {read-only|ready-write|read-write-all}[community_string]

95. set snmp trap 命令格式如下:set snmp trap {enable|disable}[all|moudle|classis|bridge|repeater| auth|vtp|ippermit|vmps|config|entity|stpx]set snmp trap rvcr_addr rcvr_community

96. 啟用SNMP chassis 陷阱:Console>(enable) set snmp trap enable chassis

97. 啟用所有SNMP chassis 陷阱:Console>(enable) set snmp trap enable

98. 禁用SNMP chassis 陷阱:Console>(enable) set snmp trap disable chassis

99. 給SNMP陷阱接收表加一條記錄:Console>(enable) set snmp trap 192.122.173.42 public

100. show snmp 輸出結果。

101. 命令set snmp rmon enable 的輸出結果。

102. 顯示SPAN信息:Consile> show span

一些華為路由器命令:

刪除設備配置reset saved-configuration

重啟reboot

看當前配置文件display current-configuration

改設備名sysname

保存配置save

進入特權模式sysview華為只有2層模式 不像cisco enale之后還要conf t

定義aclacl nubmere XXXX(3000以上)進入以后rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq注意 華為默認沒有deny any any

防火墻上端口加載ACL[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火墻上新增加用戶local-user XXX(用戶名) password simple XXX(密碼)local-user XXX service-type ppp

刪除某條命令undo(類似與cisco的no)

靜態路由ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn用戶設置acl的接口inte***ce Virtual-Template1

查看路由表display ip routing-table

設定telnet密碼user-inte***ce vty 0 4user privilege level 3set authentication password simple XXX

啟動/關閉啟動 un shut關閉 shut

動態nat設置acl number 3000rule 0 permit ip source XXX.XXX.XXX.XXXrule 1 permit ip source XXX.XXX.XXX.XXXrule 2 permit ip source XXX.XXX.XXX.XXXinte***ce Ethernet1/0des cription ====To-Internet(WAN)====ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXXnat outbound 3000ipsec policy policy1利用acl來做 符合acl的IP地址可以出去(注意 此處的ACL隱含了deny any any)不符合的IP地址不可以出去

創建vlan[shzb-crsw-s6506-1]vlan 100華為vlan不支持name將port放入vlan創建了vlan后 進入vlan模式[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8表示從G1/0/1 到1/0/8放入VLAN 100

創建trunkinte***ce GigabitEthernet1/0/1duplex fullspeed 1000* port link-type trunk* port trunk permit vlan allport link-aggregation group 1帶*號的是創建trunk鏈路的語句

vlan地址指定inte***ce Vlan-inte***ce2des cription serverip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXXvrrp vrid 2 virtual-ip XXX.XXX.XXX.XXXvrrp vrid 2 priority 120vrrp vrid 2 preempt-mode timer delay 10其中vrrp語句指定vrrp 類似與hsrp使用vrrp要注意的是華為不支持pvst只能一臺完全是主,一臺完全是備份在主vrrp設備上要指定stp instance 0 root primarystp TC-protection enablestp enable在從vrrp設備上要指定stp instance 0 root secondarystp TC-protection enablestp enable

交換機下面綁acl首先進入接口模式,輸入qos命令[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos在輸入如下命令[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000華為交換機只能指定inbound方向

啟用ospf[shzb-crsw-s6506-1]ospf 100[shzb-crsw-s6506-1-ospf-100]area 0[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX配置ospf重發布[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual然后進入接口port link-aggregation group 1

啟用VRRP之前必須輸入vrrp ping-enable使得客戶能ping網關

來源:卡飯網

免責聲明:本文由用戶上傳,如有侵權請聯系刪除!