第一篇:CISCO基礎命令總結
?
給出一個幫助屏幕
0.0.0.0 255.255.255.25
5通配符命令;作用與any命令相同
access-class
將標準的IP訪問列表應用到VTY線路
access-list
創建-個過濾網絡的測試列表
any
指定任何主機或任何網絡;作用與0.0.0.0 255.255.255.255命令相同
Backspace
刪除一個字符
Bandwidth
設置--個串行接口止的帶寬
Banner
為登錄到本路由器上的用戶創建--個標志區
cdp enable
打開-個特定接口的CDP
cdp holdtime
修改CDP分組的保持時間
cdp run
打開路由器上的CDP
cdp timer
修改CDP更新定時器
clear counters
清除某一接口上的統計信息、clear line
清除通過Telnet連接到路由器的連接
clear mac-address-table 清除該交換機動態創建的過濾表
clock rate 提供在串行DCE接口上的時鐘
config memory 復制startup-config到running-config
config network 復制保存在TFTP主機上的配置到running-config
config terminal 進人全局配置模式并修改running-config
config-register 告訴路由器如何啟動以及如何修改配置寄存器的設置
copy flash tftp 將文件從閃存復制到TFTP主機
copy run start copy running-config startup-config的快捷方式,將配置復制到NVRAM中
copy run tftp 將running-config文件復制到TFTP主機
Copy tftp flash 將文件從TFTP主機復制到閃存
Copy tftp run 將配置從TFTP主機復制為running-config文件
CTRL+Z 結束配置模式并返回EXEC(執行狀態)
debug dialer 顯示呼叫建立和結束的過程
debug frame-relay lmi 顯示在路由器和幀中繼交換機之間的lmi交換信息
debug ip igrp events 提供在網絡中運行的IGRP路由選擇信息的概要
debug ip igrp transactions 顯示來自相鄰路由器要求更新的請求消息和由路由器發到相鄰路由器的廣播消息
debug ip rip 發送控制臺消息顯示有關在路由器接口上收發RIP數據包的信息
debug ipx 顯示通過路由器的RIP和SAP信息
debug isdn q921 顯示第層進程
debug isdn q931 顯示第三層進程
delete nvram 刪除1900交換機-NVRAM的內容
delete vip 刪除交換機的VTP配置
description 在接口上設置---個描述
dialer idle-timeout number 告訴BRI線路如果沒有發現觸發DDR的流量什么時候斷
開
dialer list number protocol 為DDR鏈路指定觸發DDR的流量
protocol permit/deny
dialer load-threshold number 設置描述什么時候在ISDN鏈路上啟閉第二個BRI的參數
inbound/outbound/either
Dialer map protocol address 代替撥號串用于作ISDN網絡中提供更好的安全性
name hostname number
dialer string 設置用于撥叫BRl接口的電話號碼
disable 從特權模式返回用戶模式
disconnect 從原路由器斷開同遠楞路由豁的連接
dupler 設置一個接口的雙工
enable 進入特權模式
enable password 設置不加密的啟朋口令
enable password level 1 設置用戶模式口令
enable password level 15 設置啟用模式口令
enable secret 設置加密的啟用秘密口令。如果設置則取代啟用口令
encapsulation 在接口上設置幀類型
encapsulation frame-relay 修改幀中繼串行鏈路上的封裝類型
encapsulation frame-relay 將封裝類型設置為因特網工程任務組(IETF,Internet
Enginering Task Force)類型。連接Cisco路由器和非
Cisco路由器
encapuslation hdlc 恢復串行路由器的默認封裝HDLC
encapuslation isl 2 為VLAN 2設置ISL路由
encapuslation ppp 將串行鏈路上的封裝修改為PPP
erase starup 刪除startup-config
erase starup-config 刪除路由器上的NVRAM的內容
Esc?B 向后移動一個宇
Esc?F 向前移動一個宇
exec-timeout 為控制臺連接設置以秒或分鐘汁的超時
exit 斷開遠程路由器的Teln討連接
frame-relay interface-dlci 在串行鏈路或子接口上配置PVC地址
frame-relay lmi-type 在串行鏈路上配置LMI類型
frame-relay map protocl 創建用于幀中繼網絡的靜態映射address
Host 指定一個主機地址
Hostname 設置一臺路由器或交換機的名字
int e0.10 創建一個子接口
int f0/0.1 創建一個子接口
interface 進人接口配置模式,也可以使用show命令
interface e0/5 配置Ethernet接口5
interface ethernet 0/1 配置接口e0/1
interface f0/26 配置Fast Ethernet接口26
interface fastehernet 進人Fast Ethernet端口的接口配置模式,也可以使用0/0 show命令
interface fastethernet 創建一個子接口0/0.1
interface fastethernet0/26 配置接口f0/26
interface s0.16 multipoint 在串行鏈路上創建用于幀中繼網絡的多點子接口
interface s0.16 point-to-point 在串行鏈路上創建用于幀中繼網絡的點對點子接口 interface serial 5 進人接口serial 5的配置模式,也可以使用show命令
ip access-group 將IP訪問列表應用到一個接口
ip address 設置一個接口或交換機IP地址
ip classless 一個全局配置命令,用于告訴路由器當目的網絡沒
有出現在路由表中時通過默認路由轉發數據包
ip default-gateway 設置該交換機的默認網關
ip domain-lookup 打開DNS查找功能(默認時打開)
ip domain-name 將域名添加到DNS查找名單中
ip host 在路由器上創建主機表
ip name-server 最多設置6個DNS服務器的IP地址
Ip route 在路由器上創建靜態和默認路由
ipx access-group 將IPX訪問列表應用到一個接口
ipx input-sap-filter 將輸入型IPX SAP過濾器應用到一個接口
ipx network 為接口分配吧X網絡號
ipx output-sap-filter 將輸出型IPX SAP過濾器應用到一個接口
ipx ping 用于測試互聯網絡上IPX包的因特網探測器
ipx routing 打開IPX路由
isdn spidl 為ISDN交換機設置標識第一個DSO的號碼
isdn spid2 為ISDN交換機設置標識第二個DSO的號碼
isdn switch-type 設置路由器與之通信的ISDN交換類型。可以往接口模式和全局配置模式下設置K 用在1900交換機啟動時并將該交換機置于CLI模式
Line 進入配置模式以修改和設置用戶模式口令
line aux 進人輔助接口配置模式
line console 0 進人控制臺配置模式
line vty 進人VTY(Telnet)接口配置模式
logging synchronous 阻止控制臺信息覆蓋命令行上的輸入
logout 退出控制臺會話
mac-address-table permanent 在過濾數據庫中生成一個永久MAC地址
mac-addres-table resticted 在MAC過濾數據庫中設置一個有限制的地址,只允許所
static 配置的接口與有限制的地址通信
media-type 在接口上設置硬件介質體類型
network 告訴路由選擇協議要發通告的網絡
no cdp run 關閉單個接口上的CDP
no inverse-arp 完全關閉路由器上的CDP
no inverse 關閉幀中繼中的動態IARP。必須已配置了靜態映射
no ip domain-lookup 關閉DNS查找功能
no ip host 從主機表刪除一個主機名
No IP route 刪除靜態或默認路由
no shutdown 打開一個接口
o/r Ox2142 修改2501以便啟動時不使用NVRAM的內容
ping 測試一個遠程設備的IP連通性
port secure max-mac-count 只允許配置的設備量連接并在一個接D上工作
ppp authentucation chap 告訴PPP使用CHAP認證方式
ppp authentucation pap 告訴PPP使用PAP認證方式
router igrp as 在路由器上打開IP IGRP路由選擇
router rip 使用戶進人路由器rip配置模式
secondary 在同一個物理接口上添加輔助IPX網絡
Service password-encryption 加密用戶模式和啟用口令
show access-list 顯示路由器上配置的所有訪問列表
show access-list 110 只顯示訪問列表110
show cdp 顯示CDP定時器和保持時間周期
show cdp entry * 同show cdpneighbordetail命令一樣,但不能用于1900交換機
show cdp interface 顯示啟用了CDP的特定接口
show cdp neighbor 顯示直連的相鄰設備及其詳細信息
show cdp neighbor detail 顯示IP地址和IOS版本和類型,并且包括show cdp
neighbor命令顯示的所有信息
show cdp traffic 顯示設備發送和接收的CDP分組數以及任何出錯信息
Show controllers s 0 顯示接口的DTE或DCE狀態
show dialer 顯示撥號串到達的次數、B信道的空閑超時時間值、呼叫長度以及接口所連接的路由器的名稱
show flash 顯示閃存中的文件
show frame-relay Imi 在串行接口上設置LMI類型
show frame-relay map 顯示靜態的和動態的網絡層到PVC的映射
show frame-relay pvc 顯示路由器上己配置的PVC和DLCI號
show history 默認時顯示最近輸人的10個命令
show hosts 顯示主機表中的內容
show int fO/26 顯示抑/26的統汁
show inter e0/l 顯示接口e0/l的統計
show interface So 顯示接口serial上的統計信息
show ip 顯示該交換機的IP配置
show ip access-list 只顯示IP訪問列表
show ip interface 顯示哪些接口應用了IP訪問列表
show ip interface 顯示在路由器上配置的路由選擇協議及與每個路由選擇協議相關的定時器
show ip route 顯示IP路由表
show ipx access-list 顯示路由器上配置的IPX訪問列表
trunk on 將一個端口設為永久中繼模式
usemame name password 為了Cisco路由器的身份驗證創建用戶名和口令password
variance 控制最佳度量和最壞可接受度量之間的負載均衡
vlan 2 name Sales 創建一個名為Sales的VLAN2
lan-membership static 2 給端口分配一個靜態VLAN
vtp client 將該交換機設為一個VTP客戶
vtp domain 設置為該VTP配置的域名
vtp password 在該VTP域上設置一個口令
vtp pruning enable 使該交換機成為一臺修剪交換機
vtp server 將該交換機設為一個VTP服務器
show ipx interface 顯示一個特定接口上發送和接收的RIP和SAP信息。
show ipx servers 顯示接口的IPX地址
show ipx route 顯示IPX路由表
show ipx traffic 顯示Cisco路由器的SAP表
show ipx traffic 顯示Cisco路由器上發送和接收的RIP和SAP信息
show isdn active 顯示呼叫的號碼和呼叫是否在進行中
show isdn status 顯示SPID是否有效、是否己連接以及和提供商交換機的通信情況
show mac-address-table 顯示該交換機動態創建的過濾表
show protocols 顯示在每個接口上配置的被動路由協議和網絡地址
show run showrunning-config 命令的縮寫;顯示當前在該路由器上運行的配置
show sessions 顯示通過Telent到遠程設備的連接
show start 命令show startup-config的快捷方式。顯示保存在NVRAM中的備份配置
show terminal 顯示配置的歷史記錄大、show trunk A 顯示端口26的中繼狀態
show trunk B 顯示端口27的中繼狀態
show version 給出該交換機的IOS信息以及正常運行時間和基本
Ethernet地址
show vlan 顯示所有己配置的VLAN
show vlan-membership 顯示所有端口的VLAN分配
show vtp 顯示一臺交換機的VTP配置
shoutdown 設置接口為管理性關閉模式
Tab 為操作者完成命令的完整輸入
telnet 連接、查看并在遠程設備上運行程序
terminal history size 改變歷史記錄的大小由默認的10改為256
trace 測試遠程設備的連通性并顯示通過互聯網絡找到該遠
程設備的路徑
traffic-share balanced 告訴IGRP路由選擇協議要反比于度量值分享鏈路
traffic-share min 告訴IGRP路由選擇協議要使用只有最小開銷的路由
trunk auto 將該端口設為自動中繼模式
第二篇:華為基礎命令總結
華為基礎命令總結
目 錄
1.鏡像口配置................................................................................................................2 2.設備改名字................................................................................................................2 3.配置保存....................................................................................................................2 4查看路由表................................................................................................................2 5.telnet密碼、特權密碼..............................................................................................2 6.用戶遠程登錄 從用戶模式變成特權模式..............................................................2 7.交換接口配置(vlan、access、trunk)...................................................................3 8.接口物理配置............................................................................................................3 9.DHCP分配..................................................................................................................3 10.VRRP配置.................................................................................................................4 11.靜態路由..................................................................................................................4 12.RIP協議....................................................................................................................4 13.OSPF協議.................................................................................................................5
1.單區域................................................................................................................5 2.多區域................................................................................................................5 3.STUB....................................................................................................................5 4.完全STB..............................................................................................................5 5.點到點................................................................................................................5 6.改COST值..........................................................................................................6 7.查看配置信息....................................................................................................6 14.端口聚合..................................................................................................................6
1.二層端口聚合(華為又名 E-trunk)..................................................................6 2.三層端口聚合....................................................................................................7 15.MSTP.........................................................................................................................8
1.配置....................................................................................................................8 2.查看配置信息..................................................................................................10 16.ACL..........................................................................................................................10 1.標準列表........................................................................................................11 2.擴展列表..........................................................................................................11 3.時間的配置(例子)..........................................................................................11 4.查看配置信息..................................................................................................12
1.鏡像口配置
[Quidway]monitor-port
指定鏡像端口 [Quidway]port mirror
指定被鏡像端口 [Quidway]port mirror int_list observing-port int_type int_num 指定鏡像和被鏡像
2.設備改名字
[SW2]sysname SW2
3.配置保存
4查看路由表
5.telnet密碼、特權密碼
[Quidway]super password
修改特權用戶密碼 [Huawei]user-interface vty 0 3 [Huawei-ui-vty0-3]authentication-mode password
//設置口令模式 [Huawei-ui-vty0-3]set authentication password cipher 123 [Huawei-ui-vty0-3]user privilege level 3
用戶級別
6.用戶遠程登錄 從用戶模式變成特權模式
此命令在被telnet的路由器上配置,這里和思科的命令不同,要想在 LSW1 配置密碼 只能配置 CON 密碼!
[Huawei]super password level 7 cipher 123
例子LSW2 遠程登錄到 LSW1
7.交換接口配置(vlan、access、trunk)
[SW1vlan 3
[SW1-vlan3]port ethernet 0/1 to ethernet 0/4
//在VLAN中增加端口 [SW1]int g0/0/1 [SW1-GigabitEthernet0/0/1]port link-type access [SW1-GigabitEthernet0/0/1]port default vlan 10 [SW1]int e0/0/1 [SW1-Ethernet0/0/1]port link-type trunk [SW1-Ethernet0/0/1]port trunk allow-pass vlan {ID|All}
[SW1-Ethernet0/0/1]port trunk pvid vlan 3
//設置trunk端口的PVID
8.接口物理配置
[Quidway-Ethernet0/1]duplex {half|full|auto}
//配置端口工作狀態 [Quidway-Ethernet0/1]speed {10|100|auto}
//配置端口工作速率 [Quidway-Ethernet0/1]flow-control
//配置端口流控 [Quidway-Ethernet0/1]mdi {across|auto|normal}
//配置端口平接扭接 [Quidway-Ethernet0/1]port link-type {trunk|access|hybrid}
//設置端口工作模式 [Quidway-Ethernet0/1]undo shutdown
//激活端口
9.DHCP分配
[SW2]dhcp enable [SW2]ip pool 1 [SW2-ip-pool-1]network 192.168.1.0 255.255.255.0 [SW2-ip-pool-1]dns-list 192.168.1.1 [SW2-ip-pool-1]gateway-list 192.168.1.1 [SW2-ip-pool-1]excluded-ip-address 192.168.1.1 255.255.255.0
查看配置命令
[Quidway] display ip pool
查看IP地址池配置情況
10.VRRP配置
[SW2]int vl 10 [SW2-Vlanif10]ip add 192.168.1.253 255.255.255.0 [SW2-Vlanif10]vrrp vrid 10 192.168.1.254 [SW2-Vlanif10]vrrp vrid 10 priority 120 [SW2-Vlanif10]vrrp vrid 10 track interface g0/0/3 reduced 30
查看配置命令
命令可以看到SwitchA的狀態是Master 11.靜態路由
[SW1]ip route-static 20.1.1.0 255.255.255.0 10.1.1.2
12.RIP協議
[SW1]rip [SW1-rip-1]version 2 [SW1-rip-1]undo summary [SW1-rip-1]net 10.0.0.0 刪掉 rip 協議 [SW1]undo rip 1 Warning: The RIP process will be deleted.Continue?[Y/N]y 注意:1.綠色數字是幾 就刪掉幾
比如[SW1-rip-2] 就 [SW1]undo rip 2
2.比如10.1.1.1/24 要是通告網絡的話 cisco可以10.1.1.0 華為必須的 10.0.0.0 查看配置信息
[SwitchA] display rip 1 route
查看SwitchA的RIP路由表。13.OSPF協議
1.單區域
[SW1]ospf [SW1-ospf-1]area 0 [SW1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255 [SW3]router id 1.1.1.1
2.多區域
[SW1-1]ospf [SW1-1-ospf-1]area 1 [SW1-1-ospf-1-area-0.0.0.1]network 30.1.1.0 0.0.0.255
3.STUB [SW1-1-ospf-1-area-0.0.0.1]stub
4.完全STB [SW1-1-ospf-1-area-0.0.0.1]stub no-summary
NSSA區域和STUB區域配置一樣
5.點到點
[SW2]int vl 30 [SW2-Vlanif30]ospf network-type p2p
查看接口什么模式(紫色部分看出已經變成點到點模式)[SW3]display ospf interface Vlanif 40
OSPF Process 1 with Router ID 20.1.1.1
Interfaces
Interface: 20.1.1.1(Vlanif40)--> 20.1.1.2 Cost: 1
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
6.改COST值
[SW3]int vl 40 [SW3-Vlanif40]ospf cost 10
查看cost值(紫色部分已經看出cost值改成10了 默認是1)[SW3]display ospf interface Vlanif 40
OSPF Process 1 with Router ID 20.1.1.1
Interfaces
Interface: 20.1.1.1(Vlanif40)--> 20.1.1.2 Cost: 10
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1 7.查看配置信息
[SwitchA] display ospf peer
查看SwitchA的OSPF鄰居 [SwitchA] display ospf routing
顯示SwitchA的OSPF路由信息。[SwitchA] display ospf lsdb
查看SwitchA的LSDB。
14.端口聚合
1.二層端口聚合(華為又名 E-trunk)
[SW1]interface Eth-Trunk 1 [SW1]int g0/0/1 [SW1-GigabitEthernet0/0/1]eth-trunk 1 [SW1-GigabitEthernet0/0/1]int g0/0/2 [SW1-GigabitEthernet0/0/2]eth-trunk 1 [SW1]int Eth-Trunk 1 [SW1-Eth-Trunk1]port link-type trunk [SW1-Eth-Trunk1]port trunk allow-pass vlan all
檢查Eth-Trunk 1是否創建成功,及成員接口是否正確加入
[SW1]display trunkmembership eth-trunk 1 Trunk ID: 1
Used status: VALID TYPE: ethernet
Working Mode : Normal Number Of Ports in Trunk = 2 Number Of Up Ports in Trunk = 2 Operate status: up
Interface GigabitEthernet0/0/1, valid, operate up, weight=1 Interface GigabitEthernet0/0/2, valid, operate up, weight=1
顯示Eth-Trunk 1的配置信息(查看時 打dis eth-trunk1 不能打 dis e-trunk 1 因為e-trunk 和 eth-trunk不一樣)
Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up
Number Of Up Port In Trunk: 2
------------------PortName
Status
Weight GigabitEthernet0/0/1
Up
GigabitEthernet0/0/2
Up
2.三層端口聚合
[Huawei]vlan 100 [Huawei]int vl 100 [Huawei-Vlanif100]ip add 10.1.1.1 255.255.255.0 [Huawei]interface Eth-Trunk 1 [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]eth-trunk 1 [Huawei]int g0/0/2 [Huawei-GigabitEthernet0/0/2]eth-trunk 1 [Huawei]interface Eth-Trunk 1 [Huawei-Eth-Trunk1]port link-type access [Huawei-Eth-Trunk1]port default vlan 100 15.MSTP 拓撲圖
注:stp enable 最后配置
1.配置
LSW1
激活配置域 [LSW1]stp pathcost-standard legacy
端口開銷的計算方法華為私有計算方法 [LSW1]stp bpdu-protection
啟動BPDU保護 [LSW1-GigabitEthernet0/0/3]stp edged-port enable
邊緣端口配置 [LSW1-GigabitEthernet0/0/3]port hybrid pvid vlan 10
邊緣端口配置 [LSW1-GigabitEthernet0/0/3]port hybrid untagged vlan 10
邊緣端口配置 [LSW1]int g0/0/4 [LSW1-GigabitEthernet0/0/4]stp edged-port enable [LSW1-GigabitEthernet0/0/4]port hybrid pvid vlan 20 [LSW1-GigabitEthernet0/0/4]port hybrid untagged vlan 20 [LSW1]stp enable LSW2
啟動根保護 [LSW2]int g0/0/2 [LSW2-GigabitEthernet0/0/2]port link-type trunk [LSW2-GigabitEthernet0/0/2]port trunk allow-pass vlan all [LSW2-GigabitEthernet0/0/2]stp root-protection [LSW2]stp region-configuration [LSW2-mst-region]region-name RG1 [LSW2-mst-region]instance 1 vlan 10 [LSW2-mst-region]instance 2 vlan 20 [LSW2-mst-region]active region-configuration [LSW2]stp instance 0 priority 4096 [LSW2]stp instance 1 priority 4096 [LSW2]stp instance 2 priority 8192 [LSW2]stp enable LSW3
查看端口狀態和端口的保護類型
16.ACL 注:標準訪問列表是 2000-2999
擴展訪問列表是
3000-3999
LSW1 不能訪問 LSW2 1.標準列表
[SW1]acl 2000
定義ACL規則 [SW1-acl-basic-2000]rule deny source 10.1.1.0 0.0.0.255 [SW1]traffic classifier 1
配置流分類,定義基于ACL的匹配規則 [SW1-classifier-1]if-match acl 2000 [SW1]traffic behavior 2
定義流行為 [SW1-behavior-2]deny [SW1]traffic policy 3
定義流策略,將流分類與流行為關聯 [SW1-trafficpolicy-3]classifier 1 behavior 2
[SW1]int g0/0/1 [SW1-GigabitEthernet0/0/1]traffic-policy 3 outbound 應用流策略到GE0/0/1接口
2.擴展列表
[SW1]acl 3000 [SW1-acl-adv-3000]rule deny ip source 10.1.1.0 0.0.0.255 destination 20.1.1.0 0.0.0.255 [SW1]traffic classifier 1 [SW1-classifier-1]if-match acl 3000 [SW1]traffic behavior 2 [SW1-behavior-2]deny [SW1]traffic policy 3 [SW1-trafficpolicy-3]classifier 1 behavior 2 [SW1]int g0/0/1 [SW1-GigabitEthernet0/0/1]traffic-policy 3 outbound
3.時間的配置(例子)
調用在列表里 [Quidway-acl-adv-3003] quit 4.查看配置信息
查看ACL規則的配置信息
查看流分類的配置信息
查看流策略的配置信息。
第三篇:Cisco路由器基礎命令你總結了嗎
Cisco路由器基礎命令你總結了嗎?
2011-07-29 10:26 佚名 論壇 我要評論(1)字號:T | T
路由器是組網設備中必不可少的一員,那么它的配置問題就成了必不可缺的步驟之一,下面就讓我們來看一下基本的命令的結合,有獲得思科認證初步想法的人一定要會以下內容。
路由器命令基礎——模式轉換命令
用戶模式----特權模式,使用命令“enable” 特權模式----全局配置模式,使用命令“config t” 全局配置模式----接口模式,使用命令“interface+接口類型+接口號” 全局配置模式----線控模式,使用命令“line+接口類型+接口號” 注:
用戶模式:查看初始化的信息.特權模式:查看所有信息、調試、保存配置信息
全局模式:配置所有信息、針對整個路由器或交換機的所有接口
接口模式:針對某一個接口的配置
線控模式:對路由器進行控制的接口配置
路由器命令基礎——配置命令
Router(config)# no ip domain-lookup 關閉動態域名解析 Router(config)# ip domain-lookup 打開動態域名解析
Router(config-line)#logging synchronous日志自動跳行/logg sync 防止命令打斷 Router(config-line)#exec-timeout xx執行命令超時5
switch(config-if-range)#switchport access vlan 10
26、switch(config)#interface f0/1 進入接口
switch(config-if)#switchport mode trunk 設置為trunk(永久)
switch(config-if)#switchport mode dynamic desirable/auto(其它trunk)
switch(config-if)#switchport trunk allowed vlan remove 10 移除vlan10)
switch(config-if)#switchport trunk allowed vlan add 20 添加vlan20
27、switch#show interface f0/1 switchport查看接口模式
show ip interface brief
第四篇:CISCO技術大總結
技術一
一、命令狀態
1.router>
路由器處于用戶命令狀態,這時用戶可以看路由器的連接狀態,訪問其它網絡和主機,但不能看到和更改路由器的設置內容。
2.router#
在router>提示符下鍵入enable,路由器進入特權命令狀態router#,這時不但可以執行所有的用戶命令,還可以看到和更改路由器的設置內容。
3.router(config)#
在router#提示符下鍵入configure terminal,出現提示符router(config)#,此時路由器處于全局設置狀態,這時可以設置路由器的全局參數。
4.router(config-if)#;router(config-line)#;router(config-router)#;?
路由器處于局部設置狀態,這時可以設置路由器某個局部的參數。
5.>
路由器處于RXBOOT狀態,在開機后60秒內按ctrl-break可進入此狀態,這時路由器不能完成正常的功能,只能進行軟件升級和手工引導。
6.設置對話狀態
這是一臺新路由器開機時自動進入的狀態,在特權命令狀態使用SETUP命令也可進入此狀態,這時可通過對話方式對路由器進行設置。
二、設置對話過程
1.顯示提示信息
2.全局參數的設置
3.接口參數的設置
4.顯示結果
利用設置對話過程可以避免手工輸入命令的煩瑣,但它還不能完全代替手工設置,一些特殊的設置還必須通過手工輸入的方式完成。
進入設置對話過程后,路由器首先會顯示一些提示信息:
---System Configuration Dialog---
At any point you may enter a question mark '?' for help.Use ctrl-c to abort configuration dialog at any prompt.Default settings are in square brackets '[]'.這是告訴你在設置對話過程中的任何地方都可以鍵入“?”得到系統的幫助,按ctrl-c可以退出設置過程,缺省設置將顯示在‘[]’中。然后路由器會問是否進入設置對話:
Would you like to enter the inITial configuration dialog? [yes]:
如果按y或回車,路由器就會進入設置對話過程。首先你可以看到各端口當前的狀況:
First, would you like to see the current interface summary? [yes]:
Any interface listed wITh OK? value “NO” does not have a valid configuration Interface IP-Address OK? Method Status Protocol Ethernet0 unassigned NO unset up up Serial0 unassigned NO unset up up ??? ??? ? ?? ? ?
然后,路由器就開始全局參數的設置:
Configuring global parameters:
1.設置路由器名:
Enter host name [Router]:
2.設置進入特權狀態的密文(secret),此密文在設置以后不會以明文方式顯示:
The enable secret is a one-way cryptographic secret used instead of the enable password when IT exists.Enter enable secret: cisco
3.設置進入特權狀態的密碼(password),此密碼只在沒有密文時起作用,并且在設置以后會以明文方式顯示:
The enable password is used when there is no enable secret
and when using older software and some boot images.Enter enable password: pass
4.設置虛擬終端訪問時的密碼:
Enter virtual terminal password: cisco
5.詢問是否要設置路由器支持的各種網絡協議:
Configure SNMP Network Management? [yes]:
Configure DECnet? [no]:
Configure AppleTalk? [no]:
Configure IPX? [no]:
Configure IP? [yes]:
Configure IGRP routing? [yes]:
Configure RIP routing? [no]:
???
6.如果配置的是撥號訪問服務器,系統還會設置異步口的參數:
Configure Async lines? [yes]:
1)設置線路的最高速度:
Async line speed [9600]:
2)是否使用硬件流控:
Configure for HW flow control? [yes]:
3)是否設置modem:
Configure for modems? [yes/no]: yes
4)是否使用默認的modem命令:
Configure for default chat script? [yes]:
5)是否設置異步口的PPP參數:
Configure for Dial-in IP SLIP/PPP Access? [no]: yes
6)是否使用動態IP地址:
Configure for Dynamic IP addresses? [yes]: 7)是否使用缺省IP地址:
Configure Default IP addresses? [no]: yes
8)是否使用TCP頭壓縮:
Configure for TCP Header Compression? [yes]: 9)是否在異步口上使用路由表更新:
Configure for routing updates on async links? [no]: y 10)是否設置異步口上的其它協議。
接下來,系統會對每個接口進行參數的設置。
1.Configuring interface Ethernet0: 1)是否使用此接口:
Is this interface in use? [yes]:
2)是否設置此接口的IP參數:
Configure IP on this interface? [yes]: 3)設置接口的IP地址:
IP address for this interface: 192.168.162.2
4)設置接口的IP子網掩碼:
Number of bITs in subnet field [0]:
Class C network is 192.168.162.0, 0 subnet bITs;mask is /24
在設置完所有接口的參數后,系統會把整個設置對話過程的結果顯示出來:
The following configuration command script was created: hostname Router
enable secret 5 $1$W5Oh$p6J7tIgRMBOIKVXVG53Uh1 enable password pass
????
請注意在enable secret后面顯示的是亂碼,而enable password后面顯示的是設置的內容。
顯示結束后,系統會問是否使用這個設置:
Use this configuration? [yes/no]: yes
如果回答yes,系統就會把設置的結果存入路由器的NVRAM中,然后結束設置對話過程,使路由器開始正常的工作。
三、常用命令
1.幫助
在IOS操作中,無論任何狀態和位置,都可以鍵入“?”得到系統的幫助。
2.改變命令狀態
任務 命令
進入特權命令狀態 enable 退出特權命令狀態 disable
進入設置對話狀態 setup
進入全局設置狀態 config terminal 退出全局設置狀態 end
進入端口設置狀態 interface type slot/number
進入子端口設置狀態 interface type number.subinterface [point-to-point | multipoint] 進入線路設置狀態 line type slot/number 進入路由設置狀態 router protocol 退出局部設置狀態 exIT 3.顯示命令
任務 命令
查看版本及引導信息 show version 查看運行設置 show running-config 查看開機設置 show startup-config
顯示端口信息 show interface type slot/number 顯示路由信息 show ip router 4.拷貝命令
用于IOS及CONFIG的備份和升級
5.網絡命令
任務 命令
登錄遠程主機 telnet hostname|IP address 網絡偵測 ping hostname|IP address 路由跟蹤 trace hostname|IP address
6.基本設置命令
任務命令
全局設置 config terminal
設置訪問用戶及密碼 username username password password 設置特權密碼 enable secret password 設置路由器名 hostname name
設置靜態路由 ip route destination subnet-mask next-hop 啟動IP路由 ip routing 啟動IPX路由 ipx routing
端口設置 interface type slot/number
設置IP地址 ip address address subnet-mask 設置IPX網絡 ipx network network 激活端口 no shutdown
物理線路設置 line type number
啟動登錄進程 login [local|tacacs server] 設置登錄密碼 password password
四、配置IP尋址
1.IP地址分類
IP地址分為網絡地址和主機地址二個部分,A類地址前8位為網絡地址,后24位為主機地址,B類地址16位為網絡地址,后16位為主機地址,C類地址前24位為網絡地址,后8位為主機地址,網絡地址范圍如下表所示:
種類 網絡地址范圍
A
1.0.0.0 到126.0.0.0有效 0.0.0.0 和127.0.0.0保留
B 128.1.0.0到191.254.0.0有效 128.0.0.0和191.255.0.0保留
C 192.0.1.0 到223.255.254.0有效 192.0.0.0和223.255.255.0保留
D 224.0.0.0到239.255.255.255用于多點廣播
E 240.0.0.0到255.255.255.254保留 255.255.255.255用于廣播
2.分配接口IP地址
任務 命令
接口設置 interface type slot/number
為接口設置IP地址 ip address ip-address mask
掩瑪(mask)用于識別IP地址中的網絡地址位數,IP地址(ip-address)和掩碼(mask)相與即得到網絡地址。
3.使用可變長的子網掩碼
通過使用可變長的子網掩碼可以讓位于不同接口的同一網絡編號的網絡使用不同的掩碼,這樣可以節省IP地址,充分利用有效的IP地址空間。
如下圖所示:
Router1和Router2的E0端口均使用了C類地址192.1.0.0作為網絡地址,Router1的E0的網絡地址為192.1.0.128,掩碼為255.255.255.192, Router2的E0的網絡地址為192.1.0.64,掩碼為255.255.255.192,這樣就將一個C類網絡地址分配給了二個網,既劃分了二個子網,起到了節約地址的作用。
4.使用網絡地址翻譯(NAT)
NAT(Network Address Translation)起到將內部私有地址翻譯成外部合法的全局地址的功能,它使得不具有合法IP地址的用戶可以通過NAT訪問到外部Internet.當建立內部網的時候,建議使用以下地址組用于主機,這些地址是由Network Working Group(RFC 1918)保留用于私有網絡地址分配的.l Class A:10.1.1.1 to 10.254.254.254
l Class B:172.16.1.1 to 172.31.254.254
l Class C:192.168.1.1 to 192.168.254.254
命令描述如下:
任務 命令
定義一個標準訪問列表 access-list Access-list-number permIT source [source-wildcard]
定義一個全局地址池 ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length} [type rotary]
建立動態地址翻譯 ip nat inside source {list {Access-list-number | name} pool name [overload] | static local-ip global-ip}
指定內部和外部端口 ip nat {inside | outside}
如下圖所示,路由器的Ethernet 0端口為inside端口,即此端口連接內部網絡,并且此端口所連接的網絡應該被翻譯,Serial 0端口為outside端口,其擁有合法IP地址(由NIC或服務提供商所分配的合法的IP地址),來自網絡10.1.1.0/24的主機將從IP地址池c2501中選擇一個地址作為自己的合法地址,經由Serial 0口訪問Internet。命令ip nat inside source list 2 pool c2501 overload中的參數overload,將允許多個內部地址使用相同的全局地址(一個合法IP地址,它是由NIC或服務提供商所分配的地址)。命令ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192定義了全局地址的范圍。
設置如下:
ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192
interface Ethernet 0
ip address 10.1.1.1 255.255.255.0
ip nat inside!
interface Serial 0
ip address 202.200.10.5 255.255.255.252
ip nat outside!
ip route 0.0.0.0 0.0.0.0 Serial 0
Access-list 2 permIT 10.0.0.0 0.0.0.255
!Dynamic NAT!
ip nat inside source list 2 pool c2501 overload
line console 0
exec-timeout 0 0!
line vty 0 4
end
技術二
五、配置靜態路由
通過配置靜態路由,用戶可以人為地指定對某一網絡訪問時所要經過的路徑,在網絡結構比較簡單,且一般到達某一網絡所經過的路徑唯一的情況下采用靜態路由。
任務 命令
建立靜態路由 ip route prefix mask {address | interface} [distance] [tag tag] [permanent] Prefix :所要到達的目的網絡
mask :子網掩碼
address :下一個跳的IP地址,即相鄰路由器的端口地址。
interface :本地網絡接口
distance :管理距離(可選)
tag tag :tag值(可選)
permanent :指定此路由即使該端口關掉也不被移掉。
以下在Router1上設置了訪問192.1.0.64/26這個網下一跳地址為192.200.10.6,即當有目的地址屬于192.1.0.64/26的網絡范圍的數據報,應將其路由到地址為192.200.10.6的相鄰路由器。在Router3上設置了訪問192.1.0.128/26及192.200.10.4/30這二個網下一跳地址為192.1.0.65。由于在Router1上端口Serial 0地址為192.200.10.5,192.200.10.4/30這個網屬于直連的網,已經存在訪問192.200.10.4/30的路徑,所以不需要在Router1上添加靜態路由。
Router1:
ip route 192.1.0.64 255.255.255.192 192.200.10.6
Router3:
ip route 192.1.0.128 255.255.255.192 192.1.0.65
ip route 192.200.10.4 255.255.255.252 192.1.0.65
同時由于路由器Router3除了與路由器Router2相連外,不再與其他路由器相連,所以也可以為它賦予一條默認路由以代替以上的二條靜態路由,ip route 0.0.0.0 0.0.0.0 192.1.0.65
即只要沒有在路由表里找到去特定目的地址的路徑,則數據均被路由到地址為192.1.0.65的相鄰路由器。
一、HDLC
HDLC是CISCO路由器使用的缺省協議,一臺新路由器在未指定封裝協議時默認使用HDLC封裝。
1.有關命令
端口設置
任務 命令
設置HDLC封裝 encapsulation hdlc
設置DCE端線路速度 clockrate speed
復位一個硬件接口 clear interface serial unIT
顯示接口狀態 show interfaces serial [unIT] 1
注:1.以下給出一個顯示Cisco同步串口狀態的例子.Router#show interface serial 0
Serial 0 is up, line protocol is up
Hardware is MCI Serial
Internet address is 150.136.190.203, subnet mask is 255.255.255.0
MTU 1500 bytes, BW 1544 KbIT, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, looPBack not set, keepalive set(10 sec)
Last input 0:00:07, output 0:00:00, output hang never
Output queue 0/40, 0 drops;input queue 0/75, 0 drops
Five minute input rate 0 bITs/sec, 0 packets/sec
Five minute output rate 0 bITs/sec, 0 packets/sec
16263 packets input, 1347238 bytes, 0 no buffer
Received 13983 broadcasts, 0 runts, 0 giants
input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 2 abort 22146 packets output, 2383680 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets, 0 restarts 1 carrier transITions
2.舉例
設置如下:
Router1:
interface Serial0
ip address 192.200.10.1 255.255.255.0 clockrate 1000000
Router2:
interface Serial0
ip address 192.200.10.2 255.255.255.0!
3.舉例使用E1線路實現多個64K專線連接.相關命令: 任務 命令
進入controller配置模式 controller {t1 | e1} number 選擇幀類型 framing {crc4 | no-crc4}
選擇line-code類型 linecode {ami | b8zs | hdb3}
建立邏輯通道組與時隙的映射 channel-group number timeslots range1 顯示controllers接口狀態 show controllers e1 [slot/port]2
注: 1.當鏈路為T1時,channel-group編號為0-23, Timeslot范圍1-24;當鏈路為E1時, channel-group編號為0-30, Timeslot范圍1-31.2.使用show controllers e1觀察controller狀態,以下為幀類型為crc4時controllers正常的狀態.Router# show controllers e1
e1 0/0 is up.Applique type is Channelized E1unbalanced
Framing is CRC4, Line Code is HDB3 No alarms detected.Data in current interval(725 seconds elapsed):
0 Line Code Violations, 0 Path Code Violations
0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
Total Data(last 24 hours)0 Line Code Violations, 0 Path Code Violations,0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins,0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
以下例子為E1連接3條64K專線, 幀類型為NO-CRC4,非平衡鏈路,路由器具體設置如下:
shanxi#wri t
Building configuration...Current configuration:!
version 11.2
no service udp-small-servers no service tcp-small-servers!
hostname shanxi!
enable secret 5 $1$XN08$Ttr8nfLoP9.2RgZhcBzkk/ enable password shanxi!
ip subnet-zero!
controller E1 0 framing NO-CRC4
channel-group 0 timeslots 1 channel-group 1 timeslots 2 channel-group 2 timeslots 3!
interface Ethernet0
ip address 133.118.40.1 255.255.0.0 media-type 10BASET!
interface Ethernet1 no ip address shutdown!
interface Serial0:0
ip address 202.119.96.1 255.255.255.252 no ip mroute-cache!
interface Serial0:1
ip address 202.119.96.5 255.255.255.252 no ip mroute-cache!
interface Serial0:2
ip address 202.119.96.9 255.255.255.252 no ip mroute-cache!
no ip classless
ip route 133.210.40.0 255.255.255.0 Serial0:0 ip route 133.210.41.0 255.255.255.0 Serial0:1 ip route 133.210.42.0 255.255.255.0 Serial0:2!
line con 0 line aux 0
line vty 0 4
password shanxi login!end
二、PPP
PPP(Point-to-Point Protocol)是SLIP(Serial Line IP protocol)的繼承者,它提供了跨過同步和異步電路實現路由器到路由器(router-to-router)和主機到網絡(host-to-network)的連接。
CHAP(Challenge Handshake Authentication Protocol)和PAP(Password Authentication Protocol)(PAP)通常被用于在PPP封裝的串行線路上提供安全性認證。使用CHAP和PAP認證,每個路由器通過名字來識別,可以防止未經授權的訪問。
CHAP和PAP在RFC 1334上有詳細的說明。
1.有關命令
端口設置
任務 命令
設置PPP封裝 encapsulation ppp1
設置認證方法 ppp authentication {chap | chap pap | pap chap | pap} [if-needed] [list-name | default] [callin]
指定口令 username name password secret
設置DCE端線路速度 clockrate speed
注:
1、要使用CHAP/PAP必須使用PPP封裝。在與非Cisco路由器連接時,一般采用PPP封裝,其它廠家路由器一般不支持Cisco的HDLC封裝協議。
2.舉例
路由器Router1和Router2的S0口均封裝PPP協議,采用CHAP做認證,在Router1中應建立一個用戶,以對端路由器主機名作為用戶名,即用戶名應為router2。同時在Router2中應建立一個用戶,以對端路由器主機名作為用戶名,即用戶名應為router1。所建的這兩用戶的password必須相同。
設置如下:
Router1:
hostname router1
username router2 password xxx
interface Serial0
ip address 192.200.10.1 255.255.255.0
clockrate 1000000
ppp authentication chap!
Router2:
hostname router2
username router1 password xxx
interface Serial0
ip address 192.200.10.2 255.255.255.0 ppp authentication chap!
二、x.25
1.X25技術
X.25規范對應OSI三層,X.25的第三層描述了分組的格式及分組交換的過程。X.25的第二層由LAPB(Link Access Procedure, Balanced)實現,它定義了用于DTE/DCE連接的幀格式。X.25的第一層定義了電氣和物理端口特性。
X.25網絡設備分為數據終端設備(DTE)、數據電路終端設備(DCE)及分組交換設備(PSE)。DTE是X.25的末端系統,如終端、計算機或網絡主機,一般位于用戶端,Cisco路由器就是DTE設備。DCE設備是專用通信設備,如調制解調器和分組交換機。PSE是公共網絡的主干交換機。
X.25定義了數據通訊的電話網絡,每個分配給用戶的x.25 端口都具有一個x.121地址,當用戶申請到的是SVC(交換虛電路)時,x.25一端的用戶在訪問另一端的用戶時,首先將呼叫對方x.121地址,然后接收到呼叫的一端可以接受或拒絕,如果接受請求,于是連接建立實現數據傳輸,當沒有數據傳輸時掛斷連接,整個呼叫過程就類似我們撥打普通電話一樣,其不同的是x.25可以實現一點對多點的連接。其中x.121地址、htc均必須與x.25服務提供商分配的參數相同。X.25 PVC(永久虛電路),沒有呼叫的過程,類似DDN專線。
2.有關命令:
任務 命令
設置X.25封裝 encapsulation x25 [dce]
設置X.121地址 x25 address x.121-address
設置遠方站點的地址映射 x25 map protocol address [protocol2 address2[...[protocol9 address9]]] x121-address [option]
設置最大的雙向虛電路數 x25 htc citcuIT-number1
設置一次連接可同時建立的虛電路數 x25 nVC count2
設置x25在清除空閑虛電路前的等待周期 x25 idle minutes
重新啟動x25,或清一個svc,啟動一個pvc相關參數 clear x25 {serial number | cmns-interface mac-address} [VC-number] 3
清x25虛電路 clear x25-VC
顯示接口及x25相關信息 show interfaces serial show x25 interface show x25 map show x25 VC
注:
1、虛電路號從1到4095,Cisco路由器默認為1024,國內一般分配為16。
2、虛電路計數從1到8,缺省為1。
3、在改變了x.25各層的相關參數后,應重新啟動x25(使用clear x25 {serial number | cmns-interface mac-address} [vc-number]或clear x25-VC命令),否則新設置的參數可能不能生效。同時應對照服務提供商對于x.25交換機端口的設置來配置路由器的相關參數,若出現參數不匹配則可能會導致連接失敗或其它意外情況。
3.實例:
3.1.在以下實例中每二個路由器間均通過sVC實現連接。
路由器設置如下:
Router1:
interface Serial0
encapsulation x25
ip address 192.200.10.1 255.255.255.0
x25 address 110101
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.2 110102 broadcast
x25 map ip 192.200.10.3 110103 broadcast!
Router2:
interface Serial0
encapsulation x25
ip address 192.200.10.2 255.255.255.0
x25 address 110102
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.1 110101 broadcast
x25 map ip 192.200.10.3 110103 broadcast!
Router:
interface Serial0
encapsulation x25
ip address 192.200.10.3 255.255.255.0
x25 address 110103
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.1 110101 broadcast
x25 map ip 192.200.10.2 110102 broadcast!
相關調試命令:
clear x25-VC
show interfaces serial
show x25 map
show x25 route
show x25 VC
3.2.在以下實例中路由器router1和router2均通過svc與router連接,但router1和router2不通過sVC直接連接,此三個路由器的串口運行RIP路由協議,使用了子接口的概念。由于使用子接口,router1和router2均學習到了訪問對方局域
網的路徑,若不使用子接口,router1和router2將學不到到對方局域網的路由。
子接口(Subinterface)是一個物理接口上的多個虛接口,可以用于在同一個物理接口上連接多個網。我們知道為了避免路由循環,路由器支持splIT horizon法則,它只允許路由更新被分配到路由器的其它接口,而不會再分配路由更新回到此路由被接收的接口。
無論如何,在廣域網環境使用基于連接的接口(象 X.25和Frame Relay),同一接口通過虛電路(VC)連接多臺遠端路由器時,從同一接口來的路由更新信息不可以再被發回到相同的接口,除非強制使用分開的物理接口連接不同的路由器。Cisco提供子接口(subinterface)作為分開的接口對待。你可以將路由器邏輯地連接到相同物理接口的不同子接口, 這樣來自不同子接口的路由更新就可以被分配到其他子接口,同時又滿足splIT horizon法則。
Router1:
interface Serial0
encapsulation x25
ip address 192.200.10.1 255.255.255.0
x25 address 110101
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.3 110103 broadcast!
router rip
network 192.200.10.0!
Router2:
interface Serial0
encapsulation x25
ip address 192.200.11.2 255.255.255.0
x25 address 110102
x25 htc 16
x25 nVC 2
x25 map ip 192.200.11.3 110103 broadcast!
router rip
network 192.200.11.0!
Router:
interface Serial0
encapsulation x25
x25 address 110103
x25 htc 16
x25 nVC 2!
interface Serial0.1 point-to-point
ip address 192.200.10.3 255.255.255.0 x25 map ip 192.200.10.1 110101 broadcast!
interface Serial0.2 point-to-point
ip address 192.200.11.3 255.255.255.0 x25 map ip 192.200.11.2 110102 broadcast!
router rip
network 192.200.10.0 network 192.200.11.0!
幀中繼是一種高性能的WAN協議,它運行在OSI參考模型的物理層和數據鏈路層。它是一種數據包交換技術,是X.25的簡化版本。它省略了X.25的一些強健功能,如提供窗口技術和數據重發技術,而是依靠高層協議提供糾錯功能,這是因為幀中繼工作在更好的WAN設備上,這些設備較之X.25的WAN設備具有更可靠的連接服務和更高的可靠性,它嚴格地對應于OSI參考模型的最低二層,而X.25還提供第三層的服務,所以,幀中繼比X.25具有更高的性能和更有效的傳輸效率。
幀中繼廣域網的設備分為數據終端設備(DTE)和數據電路終端設備(DCE),Cisco路由器作為 DTE設備。
幀中繼技術提供面向連接的數據鏈路層的通信,在每對設備之間都存在一條定義好的通信鏈路,且該鏈路有一個鏈路識別碼。這種服務通過幀中繼虛電路實現,每個幀中繼虛電路都以數據鏈路識別碼(DLCI)標識自己。DLCI的值一般由幀中繼服務提供商指定。幀中繼即支持PVC也支持SVC。
幀中繼本地管理接口(LMI)是對基本的幀中繼標準的擴展。它是路由器和幀中繼交換機之間信令標準,提供幀中繼管理機制。它提供了許多管理復雜互聯網絡的特性,其中包括全局尋址、虛電路狀態消息和多目發送等功能。
2.有關命令:
端口設置
任務 命令
設置Frame Relay封裝 encapsulation frame-relay[ietf] 1
設置Frame Relay LMI類型 frame-relay lmi-type {ansi | cisco | q933a}2
設置子接口 interface interface-type interface-number.subinterface-number [multipoint|point-to-point]
映射協議地址與DLCI frame-relay map protocol protocol-address dlci [broadcast]3
設置FR DLCI編號 frame-relay interface-dlci dlci [broadcast]
注:1.若使Cisco路由器與其它廠家路由設備相連,則使用Internet工程任務組(IETF)規定的幀中繼封裝格式。
2.從Cisco IOS版本11.2開始,軟件支持本地管理接口(LMI)“自動感覺”,“自動感覺”使接口能確定交換機支持的LMI類型,用戶可以不明確配置LMI接口類型。
3.broadcast選項允許在幀中繼網絡上傳輸路由廣播信息。
3.幀中繼point to point配置實例:
Router1:
interface serial 0
encapsulation frame-relay!
interface serial 0.1 point-to-point ip address 172.16.1.1 255.255.255.0 frame-reply interface-dlci 105!
interface serial 0.2 point-to-point ip address 172.16.2.1 255.255.255.0 frame-reply interface-dlci 102!
interface serial 0.3 point-to-point ip address 172.16.4.1 255.255.255.0 frame-reply interface-dlci 104!
Router2:
interface serial 0
encapsulation frame-relay!
interface serial 0.1 point-to-point ip address 172.16.2.2 255.255.255.0 frame-reply interface-dlci 201!
interface serial 0.2 point-to-point ip address 172.16.3.1 255.255.255.0 frame-reply interface-dlci 203!
相關調試命令:
show frame-relay lmi show frame-relay map show frame-relay pVC show frame-relay route show interfaces serial go top
4.幀中繼 Multipoint 配置實例: Router1:
interface serial 0
encapsulation frame-reply!
interface serial 0.1 multipoint
ip address 172.16.1.2 255.255.255.0
frame-reply map ip 172.16.1.1 201 broadcast frame-reply map ip 172.16.1.3 301 broadcast frame-reply map ip 172.16.1.4 401 broadcast!
Router2:
interface serial 0
encapsulation frame-reply!
interface serial 0.1 multipoint
ip address 172.16.1.1 255.255.255.0
frame-reply map ip 172.16.1.2 102 broadcast frame-reply map ip 172.16.1.3 102 broadcast frame-reply map ip 172.16.1.4 102 broadcast
技術4 路由協議:
一、RIP協議
RIP(Routing information Protocol)是應用較早、使用較普遍的內部網關協議(Interior Gateway Protocol,簡稱IGP),適用于小型同類網絡,是典型的距離向量(distance-vector)協議。文檔見RFC1058、RFC1723。
RIP通過廣播UDP報文來交換路由信息,每30秒發送一次路由信息更新。RIP提供跳躍計數(hop count)作為尺度來衡量路由距離,跳躍計數是一個包到達目標所必須經過的路由器的數目。如果到相同目標有二個不等速或不同帶寬的路由器,但跳躍計數相同,則RIP認為兩個路由是等距離的。RIP最多支持的跳數為15,即在源和目的網間所要經過的最多路由器的數目為15,跳數16表示不可達。
1.有關命令
任務 命令
指定使用RIP協議 router rip
指定RIP版本 version {1|2}1
指定與該路由器相連的網絡 network network
注:1.Cisco的RIP版本2支持驗證、密鑰管理、路由匯總、無類域間路由(CIDR)和變長子網掩碼(VLSMs)
2.舉例
Router1:
router rip
version 2
network 192.200.10.0 network 192.20.10.0!
相關調試命令:
show ip protocol show ip route
二、IGRP協議
IGRP(Interior Gateway Routing Protocol)是一種動態距離向量路由協議,它由Cisco公司八十年代中期設計。使用組合用戶配置尺度,包括延遲、帶寬、可靠性和負載。
缺省情況下,IGRP每90秒發送一次路由更新廣播,在3個更?芷諛?即270秒),沒有從路由中的第一個路由器接收到更新,則宣布路由不可訪問。在7個更?芷詡?30秒后,Cisco IOS 軟件從路由表中清除路由。
1.有關命令
任務 命令
指定使用RIP協議 router igrp autonomous-system1
指定與該路由器相連的網絡 network network
指定與該路由器相鄰的節點地址 neighbor ip-address
注:
1、autonomous-system可以隨意建立,并非實際意義上的autonomous-system,但運行IGRP的路由器要想交換路由更新信息其autonomous-system需相同。
2.舉例
Router1:
router igrp 200
network 192.200.10.0
network 192.20.10.0!
三、OSPF協議
OSPF(Open Shortest Path First)是一個內部網關協議(Interior Gateway Protocol,簡稱IGP),用于在單一自治系統(autonomous system,AS)內決策路由。與RIP相對,OSPF是鏈路狀態路有協議,而RIP是距離向量路由協議。
鏈路是路由器接口的另一種說法,因此OSPF也稱為接口狀態路由協議。OSPF通過路由器之間通告網絡接口的狀態來建立鏈路狀態數據庫,生成最短路徑樹,每個OSPF路由器使用這些最短路徑構造路由表。
文檔見RFC2178。
1.有關命令
全局設置
任務 命令
指定使用OSPF協議 router ospf process-id1
指定與該路由器相連的網絡 network address wildcard-mask area area-id2
指定與該路由器相鄰的節點地址 neighbor ip-address
注:
1、OSPF路由進程process-id必須指定范圍在1-65535,多個OSPF進程可以在同一個路由器上配置,但最好不這樣做。多個OSPF進程需要多個OSPF數據庫的副本,必須運行多個最短路徑算法的副本。process-id只在路由器內部起作用,不同路由器的process-id可以不同。
2、wildcard-mask 是子網掩碼的反碼, 網絡區域ID area-id在0-4294967295內的十進制數,也可以是帶有IP地址格式的x.x.x.x。當網絡區域ID為0或0.0.0.0時為主干域。不同網絡區域的路由器通過主干域學習路由信息。
2.基本配置舉例:
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192!
interface serial 0
ip address 192.200.10.5 255.255.255.252!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.128 0.0.0.63 area 1!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192!
interface serial 0
ip address 192.200.10.6 255.255.255.252!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.64 0.0.0.63 area 2!
Router3:
interface ethernet 0
ip address 192.1.0.130 255.255.255.192!
router ospf 300
network 192.1.0.128 0.0.0.63 area 1!
Router4:
interface ethernet 0
ip address 192.1.0.66 255.255.255.192!
router ospf 400
network 192.1.0.64 0.0.0.63 area 1!
相關調試命令:
debug ip ospf events debug ip ospf packet show ip ospf
show ip ospf databASE show ip ospf interface show ip ospf neighbor show ip route
3.使用身份驗證
為了安全的原因,我們可以在相同OSPF區域的路由器上啟用身份驗證的功能,只有經過身份驗證的同一區域的路由器才能互相通告路由信息。
在默認情況下OSPF不使用區域驗證。通過兩種方法可啟用身份驗證功能,純文本身份驗證和消息摘要(md5)身份驗證。純文本身份驗證傳送的身份驗證口令為純文本,它會被網絡探測器確定,所以不安全,不建議使用。而消息摘要(md5)身份驗證在傳輸身份驗證口令前,要對口令進行加密,所以一般建議使用此種方法進行身份驗證。
使用身份驗證時,區域內所有的路由器接口必須使用相同的身份驗證方法。為起用身份驗證,必須在路由器接口配置模式下,為區域的每個路由器接口配置口令。
任務 命令
指定身份驗證 area area-id authentication [message-digest]
使用純文本身份驗證 ip ospf authentication-key password
使用消息摘要(md5)身份驗證 ip ospf message-digest-key keyid md5 key
以下列舉兩種驗證設置的示例,示例的網絡分布及地址分配環境與以上基本配置舉例相同,只是在Router1和Router2的區域0上使用了身份驗證的功能。:
例1.使用純文本身份驗證
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192!
interface serial 0
ip address 192.200.10.5 255.255.255.252
ip ospf authentication-key cisco!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.128 0.0.0.63 area 1
area 0 authentication!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192!
interface serial 0
ip address 192.200.10.6 255.255.255.252
ip ospf authentication-key cisco!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.64 0.0.0.63 area 2 area 0 authentication!
例2.消息摘要(md5)身份驗證:
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192!
interface serial 0
ip address 192.200.10.5 255.255.255.252 ip ospf message-digest-key 1 md5 cisco!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.128 0.0.0.63 area 1 area 0 authentication message-digest!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192!
interface serial 0
ip address 192.200.10.6 255.255.255.252 ip ospf message-digest-key 1 md5 cisco!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.64 0.0.0.63 area 2 area 0 authentication message-digest!
相關調試命令:
debug ip ospf adj debug ip ospf events
四、重新分配路由
在實際工作中,我們會遇到使用多個IP路由協議的網絡。為了使整個網絡正常地工作,必須在多個路由協議之間進行成功的路由再分配。
以下列舉了OSPF與RIP之間重新分配路由的設置范例:
Router1的Serial 0端口和Router2的Serial 0端口運行OSPF,在Router1的Ethernet 0端口運行RIP 2,Router3運行RIP2,Router2有指向Router4的192.168.2.0/24網的靜態路由,Router4使用默認靜態路由。需要在Router1和Router3之間重新分配OSPF和RIP路由,在Router2上重新分配靜態路由和直連的路由。
范例所涉及的命令
任務 命令
重新分配直連的路由 redistribute connected
重新分配靜態路由 redistribute static
重新分配ospf路由 redistribute ospf process-id metric metric-value
重新分配rip路由 redistribute rip metric metric-value
Router1:
interface ethernet 0
ip address 192.168.1.1 255.255.255.0!
interface serial 0
ip address 192.200.10.5 255.255.255.252!
router ospf 100
redistribute rip metric 10
network 192.200.10.4 0.0.0.3 area 0!
router rip
version 2
redistribute ospf 100 metric 1
network 192.168.1.0!
Router2:
interface looPBack 1
ip address 192.168.3.2 255.255.255.0!
interface ethernet 0
ip address 192.168.0.2 255.255.255.0!
interface serial 0
ip address 192.200.10.6 255.255.255.252!
router ospf 200
redistribute connected subnet
redistribute static subnet
network 192.200.10.4 0.0.0.3 area 0!
ip route 192.168.2.0 255.255.255.0 192.168.0.1!
Router3:
interface ethernet 0
ip address 192.168.1.2 255.255.255.0!
router rip version 2
network 192.168.1.0!
Router4:
interface ethernet 0
ip address 192.168.0.1 255.255.255.0!
interface ethernet 1
ip address 192.168.2.1 255.255.255.0!
ip route 0.0.0.0 0.0.0.0 192.168.0.2!
五、IPX協議設置
IPX協議與IP協議是兩種不同的網絡層協議,它們的路由協議也不一樣,IPX的路由協議不象IP的路由協議那樣豐富,所以設置起來比較簡單。但IPX協議在以太網上運行時必須指定封裝形式。
1. 有關命令
啟動IPX路由 ipx routing
設置IPX網絡及以太網封裝形式 ipx network network [encapsulation encapsulation-type]1
指定路由協議,默認為RIP ipx router {eigrp autonomous-system-number | nlsp [tag] | rip}
注:1.NETwork 范圍是1 到FFFFFFFD.IPX封裝類型列表
接口類型 封裝類型 IPX幀類型
Ethernet novell-ether(默認)arpa sap snap Ethernet_802.3 Ethernet_II Ethernet_802.2 Ethernet_Snap
Token Ring sap(默認)snap Token-Ring Token-Ring_Snap
FDDI snap(默認)sap novell-fddi Fddi_Snap Fddi_802.2 Fddi_Raw
舉例:
在此例中,WAN的IPX網絡為3a00,Router1所連接的局域網IPX網絡號為2a00,在此局域網有一臺Novell服務器,IPX網絡號也是2a00, 路由器接口的IPX網絡號必須與在同一網絡的Novell服務器上設置的IPX網絡號相同。路由器通過監聽SAP來建立已知的服務及自己的網絡地址表,并每60秒發送一次自己的SAP表。
Router1:
ipx routing
interface ethernet 0
ipx network 2a00 encapsulation sap!
interface serial 0 ipx network 3a00!
ipx router eigrp 10 network 3a00 network 2a00!
Router2: ipx routing
interface ethernet 0
ipx network 2b00 encapsulation sap!
interface serial 0 ipx network 3a00!
ipx router eigrp 10 network 2b00 network 3a00!
相關調試命令:
debug ipx packet debug ipx routing debug ipx sap debug ipx spoof debug ipx spx
show ipx eigrp interfaces show ipx eigrp neighbors show ipx eigrp topology show ipx interface show ipx route show ipx servers show ipx spx-spoof
服務質量及訪問控制
一、協議優先級設置
1.有關命令
任務 命令
設置優先級表項目 priorITy-list list-number protocol protocol
{high | medium | normal | low} queue-keyword keyword-value
使用指定的優先級表 priorITy-group list-number
2.舉例
Router1:
priorITy-list 1 protocol ip high tcp telnet
priorITy-list 1 protocol ip low tcp ftp
priorITy-list 1 default normal
interface serial 0
priorITy-group 1
custom-queue-list 1
三、訪問控制
1.有關命令
任務 命令
設置訪問表項目 Access-list list {permIT | deny} address mask
設置隊列表中隊列的大小 queue-list list-number queue queue-number byte-count byte-count-number
使用指定的訪問表 ip Access-group list {in | out}
2.舉例
Router1:
Access-list 1 deny 192.1.3.0 0.0.0.255
Access-list 1 permIT any
interface serial 0
ip Access-group 1 in
{high | medium | normal | low} queue-keyword keyword-value
使用指定的優先級表 priorITy-group list-number
2.舉例
Router1:
priorITy-list 1 protocol ip high tcp telnet priorITy-list 1 protocol ip low tcp ftp priorITy-list 1 default normal interface serial 0
priorITy-group 1
二、隊列定制
1.有關命令
任務 命令
設置隊列表中包含協議 queue-list list-number protocol protocol-name queue-number queue-keyword keyword-value
設置隊列表中隊列的大小 queue-list list-number queue queue-number byte-count byte-count-number
使用指定的隊列表 custom-queue-list list
2.舉例
Router1:
queue-list 1 protocol ip 0 tcp telnet
queue-list 1 protocol ip 1 tcp www.tmdps.cnmand alias!
#vtp
set vtp domain hne
set vtp mode server
set vtp v2 disable
set vtp pruning disable
set vtp pruneeligible 2-1000
clear vtp pruneeligible 1001-1005
set vlan 1 name default type ethernet mtu 1500 said 100001 state active
set vlan 777 name rgw type ethernet mtu 1500 said 100777 state active
set vlan 888 name qbw type ethernet mtu 1500 said 100888 state active
set vlan 1002 name fddi-default type fddi mtu 1500 said 101002 state active
set vlan 1004 name fddinet-default type fddinet mtu 1500 said 101004 state active bridge 0x0 stp ieee
set vlan 1005 name trnet-default type trbrf mtu 1500 said 101005 state active bridge 0x0 stp ibm
set vlan 1003 name token-ring-default type trcrf mtu 1500 said 101003 state active parent 0 ring 0x0 mode srb aremaxhop 7 stemaxhop 7!
#set boot command
set boot config-register 0x102
set boot system flash bootflash:cat5000-sup3.4-3-1a.bin!
#module 1 : 2-port 1000BASELX Supervisor set module name 1 set vlan 1 1/1-2
set port enable 1/1-2!
#module 2 : empty!
#module 3 : 24-port 10/100BASETX Ethernet set module name 3 set module enable 3 set vlan 1 3/1-22 set vlan 777 3/23 set vlan 888 3/24
set trunk 3/1 on isl 1-1005 #module 4 empty!
#module 5 empty!
#module 6 : 1-port Route SwITch set module name 6
set port level 6/1 normal set port trap 6/1 disable set port name 6/1 set cdp enable 6/1 set cdp interval 6/1 60 set trunk 6/1 on isl 1-1005!
#module 7 : 24-port 10/100BASETX Ethernet set module name 7 set module enable 7 set vlan 1 7/1-22 set vlan 888 7/23-24
set trunk 7/1 on isl 1-1005 set trunk 7/2 on isl 1-1005!
#module 8 empty!
#module 9 empty!
#module 10 : 12-port 100BASEFX MM Ethernet set module name 10 set module enable 10 set vlan 1 10/1-12
set port channel 10/1-4 off set port channel 10/5-8 off set port channel 10/9-12 off set port channel 10/1-2 on set port channel 10/3-4 on set port channel 10/5-6 on set port channel 10/7-8 on set port channel 10/9-10 on set port channel 10/11-12 on #module 11 empty!
#module 12 empty!
#module 13 empty!
#swITch port analyzer
!set span 1 1/1 both inpkts disable set span disable!#cam
set cam agingtime 1-2,777,888,1003,1005 300 end
5500C>(enable)
WS-X5302路由模塊設置:
Router#wri t
Building configuration...Current configuration:!
version 11.2
no service password-encryption no service udp-small-servers no service tcp-small-servers!
hostname Router!
enable secret 5 $1$w1kK$AJK69fGOD7BqKhKcSNBf6.!
ip subnet-zero!
interface Vlan1
ip address 10.230.2.56 255.255.255.0!
interface Vlan777
ip address 10.230.3.56 255.255.255.0!
interface Vlan888
ip address 10.230.4.56 255.255.255.0!
no ip classless!
line con 0
line aux 0
line vty 0 4
password router
login!
end
Router#
3.1.例二:
交換設備仍選用Catalyst5500交換機1臺,安裝WS-X5530-E3管理引擎,多塊WS-X5225R在交換機內劃有3個虛擬網,分別名為default、qbw、rgw,通過Cisco3640路由器實現虛擬網間路由。交換機設置與例一類似。
路由器Cisco3640,配有一塊NM-1FE-TX模塊,此模塊帶有一個快速以太網接口可以支持ISL。Cisco3640快速以太網接口與交換機上的某一支持ISL的端口實現連接,如交換機第3槽第1個接口(3/1口)。
Router#wri t
Building configuration...Current configuration:!
version 11.2
no service password-encryption
no service udp-small-servers
no service tcp-small-servers!
hostname Router!
enable secret 5 $1$w1kK$AJK69fGOD7BqKhKcSNBf6.!
ip subnet-zero!
interface FastEthernet1/0!
interface FastEthernet1/0.1
encapsulation isl 1
ip address 10.230.2.56 255.255.255.0!
interface FastEthernet1/0.2
encapsulation isl 777
ip address 10.230.3.56 255.255.255.0!
interface FastEthernet1/0.3 encapsulation isl 888
ip address 10.230.4.56 255.255.255.0!
no ip classless!
line con 0 line aux 0 line vty 0 4
password router login!end Router#
參考:
1、Cisco路由器口令恢復
當Cisco路由器的口令被錯誤修改或忘記時,可以按如下步驟進行操作:
1.開機時按使進入ROM監控狀態
2.按o 命令讀取配置寄存器的原始值
> o 一般值為0x2102
3.作如下設置,使忽略NVRAM引導
>o/r0x**4* Cisco2500系列命令
rommon 1 >confreg 0x**4* Cisco2600、1600系列命令
一般正常值為0x2102 4.重新啟動路由器
>I
rommon 2 >reset
5.在“Setup”模式,對所有問題回答No 6.進入特權模式
Router>enable 7.下載NVRAM
Router>configure memory
8.恢復原始配置寄存器值并激活所有端口
“hostname”#configure terminal
“hostname”(config)#config-register 0x“value”
“hostname”(config)#interface xx “hostname”(config)#no shutdown 9.查詢并記錄丟失的口令
“hostname”#show configuration(show startup-config)10.修改口令
“hostname”#configure terminal “hostname”(config)line console 0 “hostname”(config-line)#login
“hostname”(config-line)#password xxxxxxxxx “hostname”(config-line)#
“hostname”(config-line)#wrITe memory(copy running-config startup-config)
2、IP地址分配
地址類 網絡主機 網絡地址范圍 標準二進制掩碼
A N.H.H.H 1-126 1111 1111 0000 0000 0000 0000 0000 0000 B N.N.H.H 128-191 1111 1111 1111 1111 0000 0000 0000 0000 C N.N.N.H 192-223 1111 1111 1111 1111 1111 1111 0000 0000
子網位個數 子網掩碼 子網數 主機數
B類地址 255.255.192.0 2 16382 3 255.255.224.0 6 8198 4 255.255.240.0 14 4894 5 255.255.248.0 30 2846 6 255.255.252.0 62 1822 7 255.255.254.0 126 518 8 255.255.255.0 254 254 9 255.255.255.128 518 126 10 255.255.255.192 1822 62 11 255.255.255.224 2846 30 12 255.255.255.240 4894 14 13 255.255.255.248 8198 6 14 255.255.255.252 16382 2 C類地址 255.255.255.192 2 62 3 255.255.255.224 6 30 4 255.255.255.240 14 14 5 255.255.255.248 30 6 6 255.255.255.252 62 2
第五篇:華為交換機基礎命令總結V1.3
華為交換機基礎命令總結V1.3
目錄
【01基礎常識篇】--1
一、華為3COM IOS與CISCO IOS的區別--------------------------1
二、命令行提供的視圖---------------------2 【02常用基礎命令】------------------------------3 【03華為路由器DISPLAY命令大全】--------5 【04設置交換機的密碼】------------------------5 【05設置遠程登錄交換機】--------------------5 【06 VLAN基本配置命令(以Quidway S3026為例)】-------------------8
【01基礎常識篇】
#
一、華為3COM IOS與CISCO IOS的區別
以前華為公司的產品配置指令和CISCO公司的一樣,但由于版權與官司的問題,華為3COM公司于2002年到2003年期間進行了IOS的升級工作,升級后的IOS與CISCO公司有很大區別。主要表現在以下三個方面。
1、全新IOS支持中文界面:
在新版IOS中用戶可以選擇英文或中文界面,這樣對于那些英文水平不高或不習慣看英文的用戶來說可以切換到中文界面,各項命令的注解一目了然。對中文的支持顯示了華為3COM公司本土化作戰的目標。
2、安全級別的提高:
我們先來回顧一下CISCO公司的安全級別,CISCO路由器通過模式分配權限,cisco IOS軟件將EXEC會話分為用戶(USER)模式和特權(privileged)模式,另外很多配置命令還需要進入到配置模式下進行。通過ENABLE進入特權模式,通過configure terminal進入配置模式。
華為3COM公司的IOS安全級別是基于用戶的而不是基于模式的。也就是說我們可以為一臺路由器配置很多個用戶,不同的用戶分配不同的權限,要想進入路由器必須輸入正確的用戶名和密碼才可以。這一點有點類似于WINDOWS操作系統,當登錄系統后要想進入桌面必須輸入正確的用戶名和密碼。對用戶進行權限劃分比劃分模式更安全,更方便管理。
3、配置命令的全面變化: 由于涉及到版權的問題,華為公司在此次升級IOS后對所有的配置命令也進行了很大程度的變動。可以說現在的指令和以前的指令有天壤之別,與CISCO公司的配置命令而是相去甚遠,經常配置CISCO路由器的用戶初次接觸華為3COM路由器會很不適應。新舊命令變化如圖所示:
思科----華為常用的命令
4.華為3COM的VRP版本與CISCO的IOS
CISCO設備中是通過升級IOS版本來解決某些問題,而在華為3COM設備中取消了IOS版本這個定義,取而代之的是VRP版本。其實和IOS版本是一樣的,只是叫法不同而已。
二、命令行提供的視圖
1.用戶視圖 2.系統視圖 3.用戶界面視圖 4.VLAN視圖
5.以太網端口視圖
【用戶視圖】 查看交換機的簡單運行狀態和統計信息
【系統視圖】
查看交換機的全部運行狀態和統計信息,進行文件管理和系統管理 配置系統參數 [Quidway] 在用戶視圖下鍵入system-view quit返回用戶視圖 return返回用戶視圖
【以太網端口視圖】 配置以太網端口參數 [Quidway-Ethernet0/1] 固定以太網端口視圖:在系統視圖下鍵入interface ethernet0/1
[Quidway-Ethernet1/1] 擴展百兆以太網端口視圖:在系統視圖下鍵入interface ethernet 1/1
【VLAN視圖】 配置VLAN參數 [Quidway-vlan1] 在系統視圖下鍵入vlan 1
【用戶界面視圖】 配置用戶界面參數 [Sysname-ui-vty0] 在系統視圖下鍵入user-interface vty 0
【02常用基礎命令】
# [Quidway]sysname huawei
//命名交換機(或路由器)
[Quidway]super password yucedu //修改特權模式口令 【舉例:】
[Quidway]interface ethernet 0/1
//進入接口視圖 [Quidway-Ethernet0/1]shutdown
//關閉端口 [Quidway-Ethernet0/1]undo shutdown //重啟端口
[Quidway]quit
//退出系統視圖(一層一層退出)[Quidway]return
//直接退到用戶視圖
[Quidway]undo ……
//刪除命令
//切換語言模式
chinese Chinese environment
english English environment
配置本地telnet用戶,用戶名為”lyt”,密碼為”123456”,權限為最高級別3(缺省為級別1)[huawei]local-user lyt [huawei-luser-lyt]password simple 123456 [huawei-luser-lyt]service-type telnet level 3
查看IOS的命令如下:
下次啟動使用的app文件: flash:/S2403H-0019-140.bin
刪除saved-config文件的命令如下:
acl
清除ACL信息
arp
ARP模塊
counters
接口統計信息
dot1x
指定802.1x配置信息
garp
通用屬性注冊協議
igmp-snooping
清除IGMP偵聽統計信息
ip
IP模塊
local-server
本地服務器信息
logbuffer
清除日志緩沖區
ndp
鄰居發現協議
radius
指定RADIUS配置信息
recycle-bin
清除回收站文件
saved-configuration
保存的配置
stop-accounting-buffer
查詢備份在本地的無響應的停止計費報文
stp
生成樹協議
trapbuffer
清除告警緩沖區
交換機的 flash memory 中的配置將被擦除.你確信嗎?[Y/N]n 【03華為路由器DISPLAY命令大全】
# display current-configuration
//顯示當前配置信息
display saved-configuration
//顯示啟動時的配置文件
display interfaces
//顯示接口狀態及配置信息
display local-user
//顯示路由器當前所有的用戶信息
display version
//顯示系統的軟件硬件狀態信息,及當前的IOS版本信息
display clock
//顯示系統時鐘當前時間設置
display sysname
//顯示系統名稱,主機名
display history-command
//顯示鍵入過的命令歷史列表。
display arp
//顯示路由器的ARP地址映射對應表
display boot-loader
//顯示系統IOS文件
【04設置交換機的密碼】
[huawei]super password ?
cipher Display password with cipher text
level
Specify the entering password of the specified priority
simple Display password with plain text
[huawei]super password le [huawei]super password level ?
INTEGER<1-3> Priority level
[huawei]super password level 3 ?
cipher Display password with cipher text
simple Display password with plain text
[huawei]super password level 3 si [huawei]super password level 3 simple ?
STRING<1-16> Plain text password string
[huawei]super password level 3 simple yucedu 【05設置遠程登錄】
【方式1:使用設置password模式登入交換機】 [huawei]user-interface vty 0 4 [huawei-ui-vty0-4]authentication-mode ?
none
無需認證直接登錄
password 利用用戶終端接口的口令認證
scheme
利用RADIUS方案進行認證
[huawei-ui-vty0-4]authentication-mode password
//設置驗證方式為密碼驗證
[huawei-ui-vty0-4]set authentication password simple yucedu
//設置登入驗證的password密碼為yucedu [huawei-ui-vty0-4]user privilege level 1
//配置登入用戶級別(缺省為級別1)
【設置交換機管理IP地址】 [huawei]interface vlan 1
[huawei-Vlan-interface1]ip add 192.168.1.240 255.255.255.0 [huawei-Vlan-interface1]undo shutdown
【查看vlan 1接口的狀態】 [huawei]display interface vlan 1 Vlan-interface1 current state : UP
Line protocol current state : UP IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc23-79ae Internet Address is 192.168.1.240/24 Primary Description : HUAWEI, Quidway Series, Vlan-interface1 Interface The Maximum Transmit Unit is 1500
【交換機上提示,用戶的登入和退出】 [huawei] %Jan 4 15:20:12 2002 huawei SHELL/5/LOGIN:Slot=1;VTY login from 192.168.1.239 %Jan 4 15:20:43 2002 huawei SHELL/5/LOGOUT:Slot=1;VTY logout from 192.168.1.239
【客戶端登入操作如下】
【方式2:使用本地用戶名密碼方式登入交換機】 [huawei]user-interface vty 0 4 [huawei-ui-vty0-4]authentication-mode ?
none
無需認證直接登錄
password 利用用戶終端接口的口令認證
scheme
利用RADIUS方案進行認證
[huawei-ui-vty0-4]authentication-mode scheme
注意: 必須添加Exec(Telnet)用戶,否則操作員無法登錄系統!
【配置本地TELNET用戶】 [huawei]local-user lyt [huawei-luser-lyt]password simple 123456 [huawei-luser-lyt]service-type telnet level 3
【交換機上提示,用戶的登入和退出】 [huawei] %2002/1/1 19:54:43 huawei SHELL/5/LOGIN:Slot=1;lyt 從 192.168.1.239 登錄
【06 VLAN基本配置命令(以Quidway S3026為例)】
#
[Quidway]vlan 3 創建并進入VLAN配置模式,缺省時系統將所有端口加入VLAN 1,這個端口既不能被創建也不能被刪除
[Quidway]undo vlan 3 刪除一個VLAN
[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 給VLAN增加/刪除以太網接口
[Quidway-Ethernet0/2]port access vlan 3 將本接口加入到指定VLAN id
[Quidway-Ethernet0/2]port link-type {access|trunk|hybrid} 設置端口工作方式,access(缺省)不支持802.1q幀的傳送,而trunk支持(用于Switch間互連),hybrid和trunk的區別在于trunk只允許缺省VLAN的報文發送時不打標簽,而hybrid允許多個VLAN報文發送時不打標簽。
[Quidway-Ethernet0/2]port trunk permit vlan {id|all} 設置trunk端口通過指定VLAN的數據幀,trunk端口默認僅允許通過VLAN 1的數據幀。
[Quidway-Ethernet0/2]port trunk pvid vlan 3 設置trunk端口的PVID,如果trunk端口上收到了非802.1q幀時,Switch會給該幀加上802.1q標志,該標志字段中的VLAN ID即PVID。