1. cisco基本配置命令
Cisco 的交換機產品以「Catalyst 」為商標,包含1900 、2800 、2900 、3500 、4000 、5000 、5500 、6000 、8500 等十多個系列。
基本配置命令如下:
1、Switch>enable 進入特權模式
2、Switch #config terminal 進入全局配置模式
3、Switch(config)#hostname 設置交換機的主機名
4、Switch(config)#enable password 進入特權模式的密碼(明文形式保存)
5、Switch(config)#enablesecret 加密密碼(加密形式保存) (優先)
6、Switch(config)#ipdefault-gateway 配置交換機網關
7、Switch(config)#showmac-address-table 查看MAC地址
8、Switch(config)loggingsynchronous 阻止控制台信息覆蓋命令行上的輸入
9、Switch(config)no ipdomain-lookup 關閉DNS查找功能
10、Switch(config)exec-timeout 00 阻止會話退出
(1)思科交換機基礎命令擴展閱讀:
cisco常用配置命令:
一、使用Telnet遠程式管理
1、Switch(config)#line vty 0 4 進入虛擬終端
2、Switch (config-line)# password 設置登錄口令
3、Switch(config-line)# login 要求口令驗證
二、控制台口令
1、switch(config)#lineconsole 0 進入控制台口
2、switch(config-line)# password xx
3、switch(config-line)#設置登錄口令login 允許登錄
三、恢復出廠配置
Switch(config)#erasestartup-config
Switch(config)delete vlan.dat
2. 思科交換機詳細配置方法和命令
思科交換機的基本配置命令學習
一、交換機口令設置:
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 ;返回命令
二、交換機顯示命令:
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中的配置信息
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怕生成樹議
三. 路由器配置命令
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
+線路號 清除線路
四. 三層交換機配置命令
配置一組二層埠
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 192.20.135.21 255.255.255.0
Switch(config-if)# no shutdown
配置VLAN
configure terminal 進入配置狀態
vlan vlan-id 輸入一個VLAN號, 然後進入vlan配態,可以輸入一個新的VLAN號或舊的來進行修改
3. 思科交換機常用命令及配置
1.設置主機名/系統名 switch(config)# hostname 「hostname」 switch(enable) set system name name-string
2.設置登錄口令 switch(config)# enable password level 1 password switch(enable) set password
switch(enable) set enalbepass
3.設置遠程訪問 switch(config)# inte***ce vlan 1
switch(config-if)# ip address ip-address netmask
switch(config-if)# ip default-gateway ip-address switch(enable) set inte***ce sc0 ip-address netmask broadcast-address
switch(enable) set inte***ce sc0 vlan
switch(enable) set ip route default gateway
4.啟用和瀏覽CDP信息 switch(config-if)# cdp enable
switch(config-if)# no cdp enable switch(enable) set cdp {enable|disable} mole/port
5、給交換機配置使能密碼,進入特權模式時需要輸入密碼才能進入,避免設備可以被其他人員使用。cisco-sw1(config)#enable secret ciscoswitchps:secret表示密碼用的密文
6、交換機配置VLAN,並給將埠加入到該VLAN:cisco-sw1(config)#vlan 2cisco-sw1(config-vlan)#name testcisco-sw1(config-vlan)#exitcisco-sw1(config)#interface fastEthernet 0/1cisco-sw1(config-if)#switchport mode accesscisco-sw1(config-if)#switchport access vlan 2
7、進入交換機某一埠switch enableswitch#configure terminalswitch(conf)# interface fastehernet 0/1switch(conf-if)#
8、show:查看命令,交換機的所有配置和其它相關信息都需要通過show命令查看。switch enableswitch# show version 察看系統中的所有版本信息switch#show vlan id 1 查看交換機有關vlan配置信息switch#show running-configure 查看交換機當前起作用的配置信息switch#show interface fastethernet 0/1 察看交換機1 介面具體配置和統計信息switch#show mac-address-table 查看mac地址轉發表
9、交換機恢復出廠switch enableswitch# erase startup-configureswitch# reload
10、telnet 遠程登錄設置:switchenswitch#configure terminalswich(conf)#enable password cisco 以cisco 為特權模式密碼swich(conf)#interface vlan 1 以vlan 1埠作為遠程登錄的介面,其他埠亦可swich(conf-if)#ip address 192.168.1.1 255.255.255.0swich(conf-if)#no shutswich(conf-if)#exitswich(conf)line vty 0 4 設置0-4 個用戶可以telnet 遠程登陸swich(conf-line)#password 123456swich(conf-line)#login
11、SSH遠程登錄設置:Switch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname cisco-sw1
交換機重新命名cisco-sw1(config)#ip domain-name cisco.com
配置域名cisco-sw1(config)#line vty 0 4cisco-sw1(config-line)#transport input ssh
登錄方式為SSHcisco-sw1(config-line)#exitcisco-sw1(config)#crypto key generate rsa
配置秘鑰The name for the keys will be: cisco-sw1.cisco.comChoose the size of the key molus in the range of 360 to 2048 for yourGeneral Purpose Keys. Choosing a key molus greater than 512 may takea few minutes.How many bits in the molus [512]: 1024
思科推薦使用1024% Generating 1024 bit RSA keys, keys will be non-exportable