思科2960交換機 配置命令大全

2021-08-31 18:37:01 字數 2984 閱讀 4163

1、使能口令(enable password),口令以明文顯示。

2、使能密碼(enbale secret), 口令以密文顯示。

switch.> /*使用者直行模式提示符

switch.>enable /*進入特權模式

switch.# /*特權模式(進入前要輸入密文)

switch.#config terminal /*進入全域性配置模式

switch.(config)# /*配置模式提示符

switch.(config)# hostname pconline /*設定主機名pconline

pconline(config)# enable password cisco3560 /*設定使能口令為pconline

pconline(config)# enable secret cisco3560 /*設定使能密碼為network

pconline(config)# line vty 0 15 /*設定虛擬終端線

pconline(config-line)# login /*設定登陸驗證

pconline(config-line)# password cisco3560 /*設定虛擬終端登陸密碼

switch.> /*使用者直行模式提示符

switch.>enable /*進入特權模式

switch#vlan database ; 進入vlan設定

switch(vlan)# vlan 2 ; 建vlan 2 switch(vlan)#no vlan 2 ; 刪vlan 2

switch(config)#int f0/1 ; 進入網路埠1

switch(config)#int giga0/1 ; 進入匯聚千兆口1

switch(config-if)# duplex 設定埠為---自動/全雙工/半雙工

switch(config-if)#switchport mode trunk ; 當前埠設定為匯聚口

switch(config-if)#switchport mode access ; 當前埠設定為接入模式

switch(config-if)#switchport trunk allowed vlan 1,2 ;設定1,2號口允許的vlan組

switch(config-if)#switchport trunk vlan 2 ; 設定1號口允許的vlan

switch(config-if)#switchport access vlan 2 ; 當前埠加入vlan 2

switch(config-if)#switchport trunk encap dot1q ; 設定vlan 中繼

cisco網路中,交換機在區域網中最終穩定狀態的介面型別主要有四種:

1、access: 主要用來接入終端裝置,如pc機、伺服器、列印伺服器等。

3、multi: 在乙個線路中承載多個vlan,但不像trunk,它不對承載的資料打標籤。

主要用於接入支援多vlan的伺服器或者一些網路分析裝置。現在基本不使用此類介面,在cisco的網路裝置中,也基本不支援此類介面了。

4、dot1q-tunnel: 用在q-in-q隧道配置中。

switch(config)#vtp domain ; 設定發vtp網域名稱

switch(config)#vtp password ; 設定發vtp密碼

switch(config)#vtp mode server ;設定發vtp模式

switch(config)#vtp mode client ;設定發vtp模式

switch(config)#inte***ce vlan 1 進入vlan 1 switch(config-if)#ip address 132.37.48.3 255.255.255.0; 設定交換機管理ip

switch(config)#ip default-gateway 132.37.48.1 ;設定交換機預設閘道器

switch(config)#end; 退出當前模式

switch#conf t 進入特權模式

switch(config)# inte***ce fa0/5

switch(config-if)# shutdown 關閉埠

switch(config-if)# no shutdown 開啟埠

特權模式下:

switch#write ; 儲存配置資訊

switch#show vtp ; 檢視vtp配置資訊

switch#show run ; 檢視當前配置資訊

switch#show vtp ; 檢視交換機vtp資訊

switch#show vlan ; 檢視vlan配置資訊

switch#show inte***ce ; 檢視埠資訊

switch#show inte***ces fastethernet 0/1 switchport ;顯示二層埠的狀態,可以用來決定此口是否為二層或三層口。

switch#show int f0/0 ; 檢視指定埠資訊

sw1924_b#show ip; 檢視上述設定環境

sw1924_b#show versi;檢視交換機的版本等資訊

sw1924_b#show running-config;檢視交換機的當前執行配置等全部資訊

sw1924_b#show int e0/1;檢視交換機的第1個埠資訊

基於埠的mac位址繫結 switch#config terminal #進入配置模式

switch(config)# inte***ce fastethernet 0/1 #進入具體埠配置模式

switch(config-if)#switchport port-secruity #配置埠安全模式

switch(config-if )switchport port-security mac-address mac(主機的mac位址) #配置該埠要繫結的主機的mac位址

switch(config-if )no switchport port-security mac-address mac(主機的mac位址)

#刪除繫結主機的mac位址

思科2960交換機配置命令

交換機基本狀態 switch rom狀態,路由器是rommon hostname 使用者模式 hostname 特權模式 hostname config 全域性配置模式 hostname config if 介面狀態 交換機口令設定 switch enable 進入特權模式 switch confi...

思科交換機配置試題 思科交換機配置命令

思科交換機配置命令 簡寫命令 完整命令 使用者模式 使用者模式 switch switch 特權模式 特權模式 switch en switch enable switch switch 全域性配置模式 全域性配置模式 switch conf t switch config terminal swi...

思科交換機配置試題 思科交換機RACL用法與配置

racl針對路由介面的控制通訊流量的安全策略。在交換機中,使用者可以在任何路由介面中應用racl,如 svi 交換虛擬介面vlan埠 或者交換機3層埠 第一步 建立vlan switch config vlan 10,20 switch config vlan exit 第二步 把介面劃分至相應的v...