(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 設置控制臺會話超時為0 service 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 保存信息到NVRAM write 保存信息到NVRAM erase startup-config 清除NVRAM中的配置信息 show ip interface brief 查看接口的謫要信息 banner motd # +信息 + # 配置路由器或交換機的描素信息 description+信息 配置接口聽描素信息 vlan database 進入VLAN數據庫模式 vlan +vlan號+ 名稱 創(chuàng)建VLAN switchport 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號 刪除VLAN show spamming-tree vlan +vlan號 查看VLA怕生成樹議
2. 路由器配置命令 ip route+非直連網段+子網掩碼+下一跳地址 配置靜態(tài)/默認路由 show ip route 查看路由表 show protocols 顯示出所有的被動路由協(xié)議和接口上哪些協(xié)議被設置 show ip protocols 顯示了被配置在路由器上的路由選擇協(xié)議,同時給出了在路由選擇協(xié)議中使用
的定時器 等信息 router rip 激活RIP協(xié)議 network +直連網段 發(fā)布直連網段 interface lookback 0 激活邏輯接口 passive-interface +接口類型+接口號 配置接口為被動模式 debug ip +協(xié)議 動態(tài)查看路由更新信息 undebug all 關閉所有DEBUG信息 router eigrp +as號 激活EIGRP路由協(xié)議 network +網段+子網掩碼 發(fā)布直連網段 show ip eigrp neighbors 查看鄰居表 show ip eigrp topology 查看拓撲表 show ip eigrp traffic 查看發(fā)送包數量 router ospf +process-ID 激活OSPF協(xié)議 network+直連網段+area+區(qū)域號 發(fā)布直連網段 show ip ospf 顯示OSPF的進程號和ROUTER-ID encapsulation+封裝格式 更改封裝格式 no ip admain-lookup 關閉路由器的域名查找 ip routing 在三層交換機上啟用路由功能 show user 查看SW的在線用戶 clear line +線路號 清除線路
Router(config)# router rip Router(config-router)# network <直接相連的要用rip協(xié)議的有類別網絡號> Router# show ip protocols Router# show ip route Router# debug ip rip
*內部網關路由協(xié)議IGRP
Router(config)# router igrp <自主系統(tǒng)號> Router(config-router)# network <直接相連的要用igrp協(xié)議的有類別網絡號> Router# show ip interface Router# show ip protocols Router# show ip route Router# debug ip rip
*排除網絡故障
排除網絡故障的一個總體模型
Router# ping <有故障的主機 | 有故障的IP地址> Router# show ip route Router# show interface <有故障的接口> Router# show run
*IP的故故障排除
檢查可用的路由
Router# show ip route <有故障的IP地址> 27.4.4 跟蹤路由(Tracing the Route) SUN-A> traceroute <有故障的主機 | 有故障的IP地址> C:/windows/> winipcfg C:/windows/> ipconfig C:/windows/> ipconfig / all C:/windows/> tracert <有故障的主機 | 有故障的IP地址>
使用擴展的ping來跟蹤連接性
Router# ping
*其它可能的故障
一個地址解析(ARP)的故障
Router# show arp Router# show interface <有故障的接口> C:/windows/> arp -a SUN-A> arp –a
CISCO交換機配置命令大全2009-08-13 21:131.在基于IOS的交換機上設置主機名/系統(tǒng)名: switch(config)# hostname hostname 在基于CLI的交換機上設置主機名/系統(tǒng)名: switch(enable) set system name name-string
2.在基于IOS的交換機上設置登錄口令: switch(config)# enable password level 1 password 在基于CLI的交換機上設置登錄口令: switch(enable) set password switch(enable) set enalbepass
3.在基于IOS的交換機上設置遠程訪問: switch(config)# interface vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address 在基于CLI的交換機上設置遠程訪問: switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlan switch(enable) set ip route default gateway
4.在基于IOS的交換機上啟用和瀏覽CDP信息: switch(config-if)# cdp enable switch(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的交換機上配置靜態(tài)VLAN: switch# vlan database switch(vlan)# vlan vlan-num name vla
13. 在基于IOS的交換機上啟動VTP剪裁: switch# vlan database switch(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}
18. 在基于IOS的交換機端口上啟用或禁用Port Fast 特征: switch(config-if)#spanning-tree portfast 在基于CLI的交換機端口上啟用或禁用Port Fast 特征: switch(enable) set spantree portfast {module/port}{enable|disable}
29. 配置LECS: ATM(config)# lane database database-name ATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-address ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address ATM(lane-config-databade)# name …
30. 創(chuàng)建完數據庫后,必須在主接口上啟動LECS.命令如下: ATM(config)# interface atm number ATM(config-if)# lane config database database-name ATM(config-if)# lane config auto-config-atm-address
61. 要顯示HSRP路由器的狀態(tài): 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-routing router# interface type number router# 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-list1 dallasr1># 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 mapping dallasr1># 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. 要記錄一個路由器接受和發(fā)送的全部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 config set prompt catalystla1> set interface sc0 192.168.1.1 255.255.255.0 set cgmp enable
85. 標志設置與顯示: R1(config)# banner motd ‘unauthorized access will be prosecuted!’
86. 設置vty訪問: R1(config)# access-list 1 permit 192.168.2.5 R1(config)# line vty 0 4 R1(config)# access-class 1 in
87. 配置HTTP訪問: Router3(config)# access-list 1 permit 192.168.10.7 Router3(config)# ip http sever Router3(config)# ip http access-class 1 Router3(config)# ip http authentication local Router3(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 address switch(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]
創(chuàng)建trunk inte***ce GigabitEthernet1/0/1 duplex full speed 1000 * port link-type trunk * port trunk permit vlan all port link-aggregation group 1 帶*號的是創(chuàng)建trunk鏈路的語句