H3C每年將銷售額的15%以上用於研發投入,在中國的北京、杭州和深圳設有研發機構,在北京和杭州設有可靠性試驗室以及產品鑑定測試中心。下面小編整理一些思科交換機的基本配置,希望大家認真閱讀!
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 ;設定虛擬終端登入口令csico6
switch#exit ;返回命令
交換機VLAN建立,刪除,埠屬性的設定,配置trunk埠,將某埠加入vlan中,配置VTP:
switch#vlan database ;進入VLAN設定
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#vlan 3 name vlan3 ;建VLAN 3並命名為vlan3
switch(vlan)#no vlan 2 ;刪vlan 2
switch(config)#int f0/1 ;進入埠1
switch(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_PC1
switch(config-if)#switchport access vlan 2 ;當前埠加入vlan 2
switch(config-if)#switchport mode trunk ;設定為trunk模式(access模式)
switch(config-if)#switchport trunk allowed vlan 1,2 ;設定允許的vlan
switch(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 1
switch(config-if)#ip address ;設定IP地址
switch(config)#ip default-gateway ;設定預設閘道器
switch(config)#ip domain-name 設定域名
switch(config)#ip name-server 設定域名伺服器
switch(config)#mac-address-table? 檢視mac-address-table的子命令
switch(config)#mac-address-table aging-time 100 設定超時時間為100ms
switch(config)#mac-address-table permanent f0/3 加入永久地址在f0/3埠
switch(config)#mac-address-table restricted static f0/6 f0/7 加入靜態地址目標埠f0/6源埠f0/7
switch(config)#end
switch#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 設定控制檯會話超時為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號+ 名稱 建立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+非直連網段+子網掩碼+下一跳地址 配置靜態/預設路由
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-ID
encapsulation+封裝格式 更改封裝格式
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/2
Switch(config-if)# no switchport
Switch(config-if)# ip address
Switch(config-if)# no shutdown
配置VLAN
configure terminal 進入配置狀態
vlan vlan-id 輸入一個VLAN號, 然後進入vlan配態,可以輸入一個新的VLAN號或舊的來進行修改
。
name vlan-name 可選)輸入一個VLAN名,如果沒有配置VLAN名,預設的名字是VLAN號前面用0填滿
的4位數,如VLAN0004是VLAN4的預設名字
mtu mtu-size (可選) 改變MTU大小
例
Switch# configure terminal
Switch(config)# vlan 20
Switch(config-vlan)# name test20
Switch(config-vlan)# end
或
Switch# vlan database
Switch(vlan)# vlan 20 name test20
Switch(vlan)# exit
將埠分配給一個VLAN
configure terminal 進入配置狀態
interface interface-id 進入要分配的埠
switchport mode access 定義二層口
switchport access vlan vlan-id 把埠分配給某一VLAN
例
Switch# configure terminal
Enter configuration 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 trunk
configure terminal 進入配置狀態
interface interface-Id 進入埠配置狀態
switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封裝ISL 或 802.1Q 或
自動協商
switchport mode {dynamic {auto | desirable} | trunk} 配置二層trunk模式。
dynamic auto—自動協商是否成為trunk
dynamic desirable—把埠設定為trunk如果對方埠是trunk, desirable, 配置Native VLAN
(802.1q)
或自動模式,trunk—設定埠為強制的trunk方式,而不理會對方埠是否為trunk
switchport access vlan vlan-id 可選) 指定一個預設VLAN, 如果此埠不再是trunk
switchport 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 encapsulation dot1q
Switch(config-if)# end
定義TRUNK允許的VLAN
configure terminal子 進入配置狀態
interface interface-id 進入埠配置
switchport mode trunk 配置二層口為trunk
switchport 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/1
Switch(config-if)# switchport trunk allowed vlan remove 2
Switch(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 驗證VLAN
configure terminal 進入配置狀態
interface fastethernet 0/1 進入F0/1埠
switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封裝
switchport mode trunk 配置成trunk
show 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/2
spanning-tree vlan 3 port-priority 10 將埠權值10賦與VLAN 3.
spanning-tree vlan 4 port-priority 10 將埠權值10賦與VLAN 4
spanning-tree vlan 5 port-priority 10 將埠權值10賦與VLAN 5
spanning-tree vlan 6 port-priority 10 將埠權值10賦與VLAN 10
end 退出
show running-config 驗證配置
copy running-config startup-config 儲存配置
配置STP路徑值的負載均衡
Trunk1走VLAN8-10,Trunk2走VLAN2-4
configure terminal 進入 Switch 1配置狀態
interface fastethernet 0/1 進入F0/1
switchport trunk encapsulation {isl | dot1q | negotiate}配置封裝
switchport mode trunk 配置Trunk,預設是ISL封裝
exit 退回
在F0/2口上重複2-4步驟
exit 退回
show running-config 驗證配置
show vlan驗證switch1 已經學到Vlan
configure terminal 進入配置狀態
interface fastethernet 0/1 進入F0/1
spanning-tree vlan 2 cost 30 設定Vlan2生成樹路徑值為30
spanning-tree vlan 3 cost 30 設定Vlan3生成樹路徑值為30
spanning-tree vlan 4 cost 30 設定Vlan4生成樹路徑值為30
end 退出
在switch1的F0/2上重複9-11步驟設定VLAN8,9,10生成樹路徑值為30
end 退出
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 <下一路由器IP地址 | 從本地出口的地址>
(注:只有一個公網地址時,在出口路由器上的配置)
*內部路由選擇協議
*使用router和network命令
Router(config)# router <路由協議rip | igrp | eigrp | ospf | is-is等> [自主系統號]
Router(config-router)# network <直接相連的要用此路由協議的網路號>
Router(config-router)# network <直接相連的要用此路由協議的網路號>
*路由資訊協議RIP
Router(config)# router rip
Router(config-router)# network <直接相連的要用rip協議的有類別網路號>
Router# show ip protocols
Router# show ip route
Router# debug ip rip
*內部閘道器路由協議IGRP
Router(config)# router igrp <自主系統號>
Router(config-router)# network <直接相連的要用igrp協議的有類別網路號>
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
驗證終端系統的路由表
C:/windows/> netstat –rn
C:/windows/> route –f add mask <需要新增入的閘道器地址>
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 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的交換機上配置靜態VLAN:
switch# vlan database
switch(vlan)# vlan vlan-num name vla
switch(vlan)# exit
switch# configure teriminal
switch(config)# interface interface module/number
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan vlan-num
switch(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/port
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk encapsulation {isl|dotlq}
switch(config-if)# switchport trunk allowed vlan remove vlan-list
switch(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 database
switch(vlan)# vtp domain domain-name
在基於CLI的交換機上配置VTP管理域:
switch(enable) set vtp [domain domain-name]
11.在基於IOS的交換機上配置VTP 模式:
switch# vlan database
switch(vlan)# vtp domain domain-name
switch(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 database
switch(vlan)# vtp v2-mode
在基於CLI的交換機上配置VTP版本:
switch(enable) set vtp v2 enable
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}
15.在基於IOS的交換機上調整根路徑成本:
switch(config-if)# spanning-tree [vlan vlan-list] cost cost
在基於CLI的交換機上調整根路徑成本:
switch(enable) set spantree portcost moudle/port cost
switch(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}priority
switch(enable) set spantree portvlanpri {module/port}priority [vlans]
17. 在基於IOS的交換機上修改STP時鐘:
switch(config)# spanning-tree [vlan vlan-list] hello-time seconds
switch(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 nt multioint
ATM(config-subif)# lane serber-bus ethernet elan-name
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. 建立完資料庫後,必須在主介面上啟動LECS.命令如下:
ATM(config)# interface atm number
ATM(config-if)# lane config database database-name
ATM(config-if)# lane config auto-config-atm-address
31. 將每個LEC配置到一個不同的ATM子介面上.命令如下:
ATM(config)# interface atm nt multipoint
ATM(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 terminal
router(config)# interface media module/port
router(config-if)# description description-string
router(config-if)# ip address ip-addr subnet-mask
router(config-if)# no shutdown
38. 用中繼鏈路來建立與VLAN的連線:
router(config)# interface module/nterface
router(config-ig)# encapsulation[isl|dotlq] vlan-number
router(config-if)# ip address ip-address subnet-mask
39. 用LANE 來建立與VLAN的連線:
router(config)# interface atm module/port
router(config-if)# no ip address
router(config-if)# atm pvc 1 0 5 qsaal
router(config-if)# atm pvc 2 0 16 ilni
router(config-if)# interface atm module/nterface multipoint
router(config-if)# ip address ip-address subnet-mask
router(config-if)# lane client ethernet elan-num
router(config-if)# interface atm module/nterface multipoint
router(config-if)# ip address ip-address subnet-name
router(config-if)# lane client ethernet elan-name
router(config-if)# …
40. 為了在路由處理器上進行動態路由配置,可以用下列IOS命令來進行:
router(config)# ip routing
router(config)# router ip-routing-protocol
router(config-router)# network ip-network-number
router(config-router)# network ip-network-number
41. 配置預設路由:
switch(enable) set ip route default gateway
42. 為一個路由處理器分配VLANID,可在介面模式下使用下列命令:
router(config)# interface interface number
router(config-if)# mls rp vlan-id vlan-id-num
43. 在路由處理器啟用MLSP:
router(config)# mls rp ip
44. 為了把一個外接的路由處理器介面和交換機安置在同一個VTP域中:
router(config)# interface interface number
router(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-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
設定一個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. 要記錄一個路由器接受和傳送的全部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
set cgmp enable
79. CGMP離開的設定:
Dallas_SW(enable) set cgmp leave
80. 在Cisco裝置上修改控制埠密碼:
R1(config)# line console 0
R1(config-line)# login
R1(config-line)# password Lisbon
R1(config)# enable password Lilbao
R1(config)# login local
R1(config)# username student password cisco
81. 在Cisco裝置上設定控制檯及vty埠的會話超時:
R1(config)# line console 0
R1(config-line)# exec-timeout 5 10
R1(config)# line vty 0 4
R1(config-line)# exec-timeout 5 2
82. 在Cisco裝置上設定特權級:
R1(config)# privilege configure level 3 username
R1(config)# privilege configure level 3 copy run start
R1(config)# privilege configure level 3 ping
R1(config)# privilege configure level 3 show run
R1(config)# enable secret level 3 cisco
83. 使用命令privilege 可定義在該特權級下使用的命令:
router(config)# privilege mode level level command
84. 設定使用者特權級:
router(config)# enable secret level 3 dallas
router(config)# enable secret san-fran
router(config)# username student password cisco
85. 標誌設定與顯示:
R1(config)# banner motd ‘unauthorized access will be prosecuted!’
86. 設定vty訪問:
R1(config)# access-list 1 permit
R1(config)# line vty 0 4
R1(config)# access-class 1 in
87. 配置HTTP訪問:
Router3(config)# access-list 1 permit
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]
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 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
定義acl
acl nubmere XXXX(3000以上)進入以後
rule permit/deny IP/TCP/UDP等 source (反向)
destination (反向) 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
對vpdn使用者設定acl的介面
inte***ce Virtual-Template1
檢視路由表
display ip routing-table
設定telnet密碼
user-inte***ce vty 0 4
user privilege level 3
set authentication password simple XXX
啟動/關閉
啟動 un shut
關閉 shut
動態nat設定
acl number 3000
rule 0 permit ip source
rule 1 permit ip source
rule 2 permit ip source
inte***ce Ethernet1/0
des cription ====To-Internet(WAN)====
ip address
nat outbound 3000
ipsec 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
建立trunk
inte***ce GigabitEthernet1/0/1
duplex full
speed 1000
* port link-type trunk
* port trunk permit vlan all
port link-aggregation group 1
帶*號的是建立trunk鏈路的語句
vlan地址指定
inte***ce Vlan-inte***ce2
des cription server
ip address
vrrp vrid 2 virtual-ip
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 10
其中vrrp語句指定vrrp 類似與hsrp
使用vrrp要注意的是華為不支援pvst
只能一臺完全是主,一臺完全是備份
在主vrrp裝置上要指定
stp instance 0 root primary
stp TC-protection enable
stp enable
在從vrrp裝置上要指定
stp instance 0 root secondary
stp TC-protection enable
stp 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
[]network
配置ospf重發布
[]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閘道器