日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

思科Cisco 2960系列交換機(jī)配置命令

 milo2008 2014-07-17

配置密碼:

2960>en ;第一次密碼為空 
2960h#conf t ;進(jìn)入全局配置模式 
2960(config)#hostname swa ;設(shè)置交換機(jī)名 
2960(config)#enable secret aaa ;設(shè)置特權(quán)加密口令為 aaa 
2960(config)#enable password aax ;設(shè)置特權(quán)非密口令為 aax 
2960(config)#line console 0 ;進(jìn)入控制臺(tái)口(Rs232) 
2960(config-line)#password aa ;設(shè)置登錄口令aa 
2960(config-line)#login ;登錄要求口令驗(yàn)證 
2960(config-line)#line vty 0 4 ;進(jìn)入虛擬終端virtual tty 
2960(config-line)#password a ;設(shè)置登錄口令a 
2960(config-line)#login ;登錄要求口令驗(yàn)證 
2960(config-line)#exit ;返回上一層 
2960(config)#exit ;返回上一層 
2960#sh run ;看配置信息 
2960#exit ;返回命令

配置Vlan

新建一個(gè)Vlan的命令

Switch>enable     進(jìn)入特權(quán)模式

Switch#configure terminal      進(jìn)入全局配置模式

Switch (config)# vlan vlan-id     創(chuàng)建一個(gè)Vlan或者進(jìn)入Vlan配置模式

Switch (config-vlan)# name vlan-name 給Vlan命名(取消設(shè)置:no name)

Switch (config-vlan)# mtu mtu-size 設(shè)置最大通訊量(取消設(shè)置:no mtu)

Switch (config-vlan)#remote-span    開啟遠(yuǎn)程流量監(jiān)控(關(guān)閉:no remote-span)

Switch (config-vlan)# end 回到特權(quán)模式

Switch#show vlan {name vlan-name | id vlan-id}        查看當(dāng)前配置

Switch#copy running-config startup config 保存配置

刪除Vlan的命令

Switch>enable     進(jìn)入特權(quán)模式

Switch#configure terminal      進(jìn)入全局配置模式

Switch (config)# no vlan vlan-id       刪除Vlan

Switch (config)# end 回到特權(quán)模式

Switch#show vlan brief    查看刪除情況

Switch#copy running-config startup config 保存配置

端口加入特定Vlan的命令

Switch>enable     進(jìn)入特權(quán)模式

Switch#configure terminal      進(jìn)入全局配置模式

Switch (config)# interface interface-id    進(jìn)入端口配置

Switch (config-if)# switchport mode access     將接口的模式設(shè)為訪問模式

Switch (config-if)# switchport access vlan vlan-id 將端口加入指定的Vlan(恢復(fù)端口默認(rèn)配置:default interface interface-id)

Switch (config-if)# end       回到特權(quán)模式

Switch#show running-config interface interface-id     查看端口模式

Switch#show interfaces interface-id switchport 查看端口詳細(xì)配置

Switch#copy running-config startup-config 保存配置

批量端口加入特定Vlan的命令

int range fa0/1 - 10

switchport   access   VLan   V2

將特定端口設(shè)為trunk

2960-01(config)#default interface fastEthernet 0/1    端口恢復(fù)默認(rèn)值    

2960-01(config)#interface fastethernet0/1            進(jìn)入端口模式

2960-01(config-if)#switchport mode trunk           設(shè)置端口為trunk模式

2960-01(config-if)#switchport nonegotiate          將接口設(shè)置為不協(xié)商模式

2960-01(config-if)end

2960-01#wr

啟用snmp

Switch>enable     進(jìn)入特權(quán)模式

Switch#configure terminal      進(jìn)入全局配置模式

Switch (config)# snmp-server community string [view view-name] [ro | rw] [access-list-number]

(關(guān)閉snmp: no snmp-server)

(刪除團(tuán)體字符: no snmp-server community string)    配置snmp團(tuán)體字符并開啟snmp代理服務(wù)

String: 團(tuán)體口令字符(所有SNMP命令中只有設(shè)置團(tuán)體口令的snmp-server community是必須的,其它的都是可選的.)

View: view 可以用于限定哪些MIB分支不能用本community-string存取預(yù)先用snmp-server view定義

ro | rw: ro獲得MIB對(duì)象信息;rw獲得并可以修改MIB對(duì)象信息

access-list-number:訪問列表號(hào)

Switch (config)#access-list access-list-number {deny |

permit} source [source-wildcard]     配置拒絕或者允許訪問snmp代理服務(wù)的IP地址,訪問列表號(hào)為上一步指定的列表號(hào)

Switch (config)#end    回到特權(quán)模式

Switch#show running-config 查看配置

Switch#copy running-config startup-config 保存配置

cisco2960口令恢復(fù)

交換機(jī)口令恢復(fù)的步驟

⒈串口線連接到到交換機(jī)的console口。

⒉先按住交換機(jī)面板上的mode鍵,然后打開電源。

⒊初始化flash。

>flash_init

⒋更名含有password的配置文件。

>rename flash:config.text flash:config.old

⒌啟動(dòng)交換機(jī)。

>boot

⒍進(jìn)入特權(quán)模式。

>enable

⒎此時(shí)開機(jī)是已忽略password。

#rename flash:config.old flash:config.text

⒏copy配置文件到當(dāng)前系統(tǒng)中。

#copy flash:config.text system:running-config

⒐修改口令。

#configure terminal

#enable secret

⒑保存配置。

#write

===================================================================================================
(一)使能口令(enable password),口令以明文顯示 
使能密碼 (enbale secret), 口令以密文顯示 
Switch.> /*用戶直行模式提示符 
Switch.>enable /*進(jìn)入特權(quán)模式 
Switch.# /*特權(quán)模式(進(jìn)入前要輸入密文) 
Switch.#config terminal /*進(jìn)入全局配置模式 
Switch.(config)# /*配置模式提示符 
Switch.(config)# hostname Pconline /*設(shè)置主機(jī)名Pconline 
Pconline(config)# enable password cisco3560 /*設(shè)置使能口令為pconline 
Pconline(config)# enable secret cisco3560 /*設(shè)置使能密碼為network 
Pconline(config)# line vty 0 15 /*設(shè)置虛擬終端線 
Pconline(config-line)# login /*設(shè)置登陸驗(yàn)證 
Pconline(config-line)# password cisco3560 /*設(shè)置虛擬終端登陸密碼 
二、 交換機(jī)VLAN設(shè)置 
Switch.> /*用戶直行模式提示符 
Switch.>enable /*進(jìn)入特權(quán)模式 
switch#vlan database ; 進(jìn)入VLAN設(shè)置 
switch(vlan)# vlan 2 ; 建VLAN 2 
switch(vlan)#no vlan 2 ; 刪vlan 2 
switch(config)#int f0/1 ; 進(jìn)入網(wǎng)絡(luò)端口1 
switch(config)#int giga0/1 ; 進(jìn)入?yún)R聚千兆口1 
switch(config-if)# duplex {auto | full | half} 設(shè)置端口為---自動(dòng)/全雙工/半雙工 
switch(config-if)#switchport mode trunk ; 當(dāng)前端口設(shè)置為匯聚口 
switch(config-if)#switchport mode access ; 當(dāng)前端口設(shè)置為接入模式 
switch(config-if)#switchport trunk allowed vlan 1,2 ;設(shè)置1,2號(hào)口允許的vlan組 
switch(config-if)#switchport trunk vlan 2 ; 設(shè)置1號(hào)口允許的vlan 
switch(config-if)#switchport access vlan 2 ; 當(dāng)前端口加入vlan 2 
switch(config-if)#switchport trunk encap dot1q ; 設(shè)置vlan 中繼 
cisco網(wǎng)絡(luò)中,交換機(jī)在局域網(wǎng)中最終穩(wěn)定狀態(tài)的接口類型主要有四種: 
access/ trunk/ multi/ dot1q-tunnel。 
1、access: 主要用來接入終端設(shè)備,如PC機(jī)、服務(wù)器、打印服務(wù)器等。 
2、trunk: 主要用在連接其它交換機(jī),以便在線路上承載多個(gè)vlan。 
3、multi: 在一個(gè)線路中承載多個(gè)vlan,但不像trunk,它不對(duì)承載的數(shù)據(jù)打標(biāo)簽。主要用于接入支持多vlan的服務(wù)器或者一些網(wǎng)絡(luò)分析設(shè)備?,F(xiàn)在基本不使用此類接口,在cisco的網(wǎng)絡(luò)設(shè)備中,也基本不支持此類接口了。 
4、dot1q-tunnel: 用在Q-in-Q隧道配置中。 
switch(config)#vtp domain ; 設(shè)置發(fā)vtp域名 
switch(config)#vtp password ; 設(shè)置發(fā)vtp密碼 
switch(config)#vtp mode server ;設(shè)置發(fā)vtp模式 
switch(config)#vtp mode client ;設(shè)置發(fā)vtp模式 
三. 交換機(jī)設(shè)置IP地址 
switch(config)#interface vlan 1 進(jìn)入vlan 1 
switch(config-if)#ip address 132.37.48.3 255.255.255.0; 設(shè)置交換機(jī)管理IP 
switch(config)#ip default-gateway 132.37.48.1 ;設(shè)置交換機(jī)默認(rèn)網(wǎng)關(guān) 
switch(config)#end; 退出當(dāng)前模式 
Switch#conf t 進(jìn)入特權(quán)模式 
Switch(config)# interface fa0/5 
Switch(config-if)# shutdown 關(guān)閉端口 
Switch(config-if)# no shutdown 打開端口 
四. 交換機(jī)顯示命令 
特權(quán)模式下: 
switch#write ; 保存配置信息 
switch#show vtp ; 查看vtp配置信息 
switch#show run ; 查看當(dāng)前配置信息 
switch#show vtp ; 查看交換機(jī)vtp信息 
switch#show vlan ; 查看vlan配置信息 
switch#show interface ; 查看端口信息 
Switch#show interfaces fastethernet 0/1 switchport ;顯示二層端口的狀態(tài),可以用來決定此口是否為二層或三層口。 switch#show int f0/0 ; 查看指定端口信息 
sw1924_b#show ip; 查看上述設(shè)置環(huán)境 
sw1924_b#show versi;查看交換機(jī)的版本等信息 
sw1924_b#show running-config;查看交換機(jī)的當(dāng)前運(yùn)行配置等全部信息 
sw1924_b#show int e0/1;查看交換機(jī)的第1個(gè)端口信息 
基于端口的MAC地址綁定 
Switch#config terminal #進(jìn)入配置模式 
Switch(config)# Interface fastethernet 0/1 #進(jìn)入具體端口配置模式 
Switch(config-if)#Switchport port-secruity #配置端口安全模式 
Switch(config-if )switchport port-security mac-address MAC(主機(jī)的MAC地址) 
#配置該端口要綁定的主機(jī)的MAC地址 
Switch(config-if )no switchport port-security mac-address MAC(主機(jī)的MAC地址) 
#刪除綁定主機(jī)的MAC地址 

====================================================================================================

配置步驟 注釋 
配置密碼 
Switch>en 特權(quán)模式 
Switch#conf t 配置模式 
Switch(config)#host SAT2960 改變?cè)O(shè)備名稱 
Switch(config)#ena se cisco 特權(quán)口令 
Switch(config)#line vty 0 15 修改遠(yuǎn)程登陸口令 
Switch(config-line)#login             
Switch(config-line)#password cisco 
Switch(config-line)#line con 0 修改串口登陸口令 
Switch(config-line)#login             
Switch(config-line)#password noco 
Switch(config-line)#exit 
Switch(config)#exit 
Switch# 
創(chuàng)建VLAN (特權(quán)模式下用vlan database命令) 
SAT2960#vlan database 
SAT2960(vlan)#vlan 2 name Marketing 創(chuàng)建并命名 
VLAN 2 modified: 
Name: Marketing 
SAT2960(vlan)#apply 應(yīng)用 
APPLY complete 
SAT2960(vlan)#(Ctrl+C) 退出 
SAT2960#sh vlan brief 驗(yàn)證 
設(shè)置IP信息 
默認(rèn)情況下,VLAN1是管理VLAN,所有接口均是VLAN1的成員 
SAT2960(config)#int vlan1 進(jìn)入管理VLAN 
SAT2960(config-if)#ip address 172.16.10.16 255.255.255.0 
SAT2960(config-if)#no shut 打開接口 
SAT2960(config-if)#exit 
SAT2960(config)#ip default-gateway 172.16.10.1 
SAT2960(config)# 
SAT2960交換機(jī)配置文件的擦除: 
SAT2960交換機(jī)配置文件是存儲(chǔ)在NVRAM中的,使用copy run start 來保存當(dāng)前運(yùn)行的配置到NVRAM中,擦除SAT2960 里面的start-config文件,使用命令:
SAT2960#erase start-config
SAT2960#reload

配置端口描述:(使用 description 命令)
SAT2960(config)#int fa 0/1
SAT2960(config-if)#description haha
SAT2960(config-if)#exit
可以使用show interface 和 show running-config 命令來查看這些描述信息;

給VLAN分配端口: 
SAT2960(config-if)#int f0/2 
SAT2960(config-if)#switchport access vlan 2 
SAT2960(config-if)#int f0/3 
SAT2960(config-if)#switchport access vlan 3 
SAT2960(config-if)#int f0/4 
SAT2960(config-if)#switchport access vlan 4 
SAT2960(config-if)#exit 
SAT2960(config)#exit 
驗(yàn)證配置信息,如下: 
SAT2960#sh vlan brief 
配置中繼端口——打trunk 
SAT2960(config)#int f0/12 
SAT2960(config-if)#switchport mode trunk 
SAT2960(config-if)#(ctrl+c) 
SAT2960# 
驗(yàn)證配置信息: 
SAT2960#sh run 
保存設(shè)置 
SAT2960#wr mem 
或者 
SAT2960#copy running-config startup-config 

常用調(diào)試命令           
a、顯示所有配置命令:Switch#show run           
b、顯示所有接口狀態(tài):Switch#show ip int brief           
c、顯示所有VLAN的信息:Switch#show vlan brief


========================================================


    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多