導航:首頁 > 程序命令 > 交換機基礎命令

交換機基礎命令

發布時間:2022-06-03 11:54:16

1. 交換機的命令具體怎麼使用

交換機的命令非常多,主要是用來配置交換機的,只有可網管的交換機(有console口的交換機)才能進行配置。
不同廠家、不同型號的交換機的配置命令也不大一樣。
舉個CISCO的命令例子吧:
hostname是給交換機命名的命令,如交換機本來的名字是Switch,使用(config)#hostname
JIAOHUANJI,就可以把交換機的名字改成JIAOHUANJI了。
交換機配置時還分很多種模式,每種模式下的配置命令也都有很大區別,具體的真不是三兩句說得清的,你只有買些教材看看了。

2. 華三交換機配置命令

華三交換機配置命令如下:

<H3C>system-view

[H3C]super password H3C:設置用戶分級密碼

[H3C]undo super password:刪除用戶分級密碼

[H3C]localuser bigheap 123456 1:Web網管用戶設置,1(預設)為管理級用戶,缺admin,admin

[H3C]undo localuser bigheap:刪除Web網管用戶

[H3C]user-interface aux 0:只支持0

[H3C-Aux]idle-timeout 2 50:設置超時為2分50秒,若為0則表示不超時,默認為5分鍾

[H3C-Aux]undo idle-timeout:恢復默認值

[H3C]user-interface vty 0:只支持0和1

[H3C-vty]idle-timeout 2 50:設置超時為2分50秒,若為0則表示不超時,默認為5分鍾

[H3C-vty]undo idle-timeout:恢復默認值

[H3C-vty]set authentication password 123456:設置telnet密碼,必須設置

[H3C-vty]undo set authentication password:取消密碼

[H3C]display users:顯示用戶

[H3C]display user-interface:顯示用戶界面狀態

(2)交換機基礎命令擴展閱讀:

H3C Switch命令:

一、模式命令:

1、用戶模式:Switch>

2、特權模式:Switch>enable

Switch#

3、全局配置模式:Switch#config terminal

Switch(config)#

4、介面配置模式:Switch(config)#interface fastethernet0/1

Switch(config-if)#

5、Line模式:Switch(config)#line console 0

Switch(config-line)#

二、特權模式下的命令:

1、查看機MAC地址:Switch#show mac-address-table

2、發現(CDP):

Switch#show cdp

Switch#show cdp interface fastethernet0/1

Switch#show cdp neighbors

Switch#show cdp neighbors detail

Switch#show cdp entry

工作原理:

交換機工作於OSI參考模型的第二層,即數據鏈路層。交換機內部的CPU會在每個埠成功連接時,通過將MAC地址和埠對應,形成一張MAC表。

在今後的通訊中,發往該MAC地址的數據包將僅送往其對應的埠,而不是所有的埠。因此,交換機可用於劃分數據鏈路層廣播,即沖突域;但它不能劃分網路層廣播,即廣播域。

參考資料:網路—交換機

參考資料:網路—交換機命令

3. 普通交換機常用配置命令是什麼

第一個回答的那個就挺詳細的,算是普通操作吧。基本上包括第一次進機的配置,密碼配置,創建vlan,對特定埠設定訪問vlan,基本的就這些了,其他的比如show命令,這個有很多選項的,show
running-config之類的查看工作狀態和排錯的也很多也重要。

4. 交換機的基本命令是什麼

「Switch>」

5. 交換機全部命令和漢語翻譯,高分送上!

交換機配置命令詳解 1. 交換機支持的命令: 交換機基本狀態: switch: ;ROM狀態, 路由器是rommon hostname ;用戶模式 hostname# ;特權模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;介面狀態 交換機口令設置: switchenable ;進入特權模式 switch#config terminal ;進入全局配置模式 switch(config)#hostname ;設置交換機的主機名 switch(config)#enable secret xxx ;設置特權加密口令 switch(config)#enable password xxa ;設置特權非密口令 switch(config)#line console 0 ;進入控制台口 switch(config-line)#line vty 0 4 ;進入虛擬終端 switch(config-line)#login ;允許登錄 switch(config-line)#password xx ;設置登錄口令xx switch#exit ;返回命令 交換機VLAN設置: 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-if)#switchport access vlan 2 ;當前埠加入vlan 2 switch(config-if)#switchport mode trunk ;設置為干線 switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlan switch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼 switch(config)#vtp domain ;設置發vtp域名 switch(config)#vtp password ;設置發vtp密碼 switch(config)#vtp mode server ;設置發vtp模式 switch(config)#vtp mode client ;設置發vtp模式 交換機設置IP地址: switch(config)#interface vlan 1 ;進入vlan 1 switch(config-if)#ip address ;設置IP地址 switch(config)#ip default-gateway ;設置默認網關 switch#dir flash: ;查看快閃記憶體 交換機顯示命令: switch#write ;保存配置信息 switch#show vtp ;查看vtp配置信息 switch#show run ;查看當前配置信息 switch#show vlan ;查看vlan配置信息 switch#show interface ;查看埠信息 switch#show int f0/0 ;查看指定埠信息

6. 簡述交換機的幾種配置模式,以及進入的操作命令是什麼

交換機的模式有普通用戶模式、特權用戶模式、全局配置模式、介面配置模式、vlan配置模式、恢復交換機的預設配置等等。

1、普通用戶模式

開機直接進入普通用戶模式,在該模式下我們只能查詢交換機的一些基礎信息,如版本號(show version) 等,許可權最低,只能使用少量的查看行政的命令。如需進入特權模式一般需要密碼。。

2、特權用戶模式

在普通用戶模式下輸入enable命令即可進入特權用戶模式,在該模式下我們可以查看交換機的配置信息和調試信息等等,使用更多的查看性質的命令和做一些少量修改的路由器參數命令,進入全局配置模式不需要任何密碼。

3、全局配置模式

在特權用戶模式下輸入c terminal命令即可進入全局配置模式,在該模式下主要完成全局參數的配置,不能使用查看性質的命令,在此模式下做大量的路由配置模式,可用在此基礎上介面配置模式,線路配置模式,路由進程模式。

4、介面配置模式

在全局配置模式下輸入interface interface-list 即可進入介面配置模式,在該模式下主要完成介面參數的配置。

5、vlan配置模式

在全局配置模式下輸入vlan vlan-number即可進入vlan配置模式,在該配置模式下可以完成vlan的一些相關配置。

6、恢復交換機的預設配置
為了不讓實驗受交換機以前的配置影響,常常需要先恢復交換機的預設配置。在特權用戶模式下順序使用erase,restet命令即可恢復交換機的預設配置。

(6)交換機基礎命令擴展閱讀:

交換機說明:

1、在實驗環境中,如果配置兩個vlan: vlan1, vlan2, 注意其中vlan1是交換機默認的vlan,既不能創建也不能刪除,所有埠都屬於vlan1,所以應該首先創建vlan2,然後為各個vlan分配埠(switchport interface-list)。

2、使用命令行進行配置的時候,在任何模式下均可以使用「?」來幫助我們完成配置。

使用「?」可以查詢任何模式下可以使用的命令;或者某參數後面可以輸入的參數;或者以某字母開始的命令。例如在全局配置模式下輸入「?」或「show ?」或「s?」,可以看看它們分別有什麼幫助信息顯示。

如果你不能確認當前模塊所在的插槽的編號,可以通過命令行中的show命令來查看插槽以及插槽.上的埠信息;也可以在路由器特權EXEC模式下執行show version命 令,在路由器版本信息中有每個模塊所在插槽編號的信息。

7. 交換機的常用配置命令

a、更改遠程TELNNET密碼
Switch#configure terminal

Switch(config)#line vty 0 4

Switch(config-line)#password qycx123

Switch(config-line)#login

Switch(config-line)#exit

b、更改進入全局配置模式時的密碼

Switch#configure terminal

Switch(config)#enable secret qycx123

思科交換機常用命令——創建並劃分VLAN

a、創建VLAN

Switch#vlan database

Switch(vlan)#vlan 99 name office (創建vlan 99 並命名為office)

b、將埠劃分至vlan

Switch(config)#interface fastEthernet 0/8

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 99 (將8號快速以太口劃分至vlan 99)

思科交換機常用命令——調試命令

a、顯示所有配置命令:Switch#show run

b、顯示所有介面狀態:Switch#show ip int brief

c、顯示所有VLAN的信息:Switch#show vlan brief

cisco交換機還是比較常用的,於是我研究了一下Cisco交換機命令的大總結,在這里拿出來和大家分享一下,希望對大家有用。我所針對的都是Cisco的設備而言的,華為的可以跟據手冊來查,配置都是差不多的,這里華子就不多寫華為的設備了,了解的也不是很多。

Cisco交換機命令之使用Telnet遠程式管理

switch(config)#interface vlan 1 進入vlan 1

switch(config-if)#ip address 設置IP地址

switch(config-if)#ip default-gateway 設置默認網關

switch(config)#line vty 0 4 進入虛擬終端

switch(config-line)#login 允許登錄

switch(config-line)#password xx 設置登錄口令

switch#exit 返回命令

Cisco交換機命令之控制台口令

switch(config)#line console 0 進入控制台口

switch(config-line)#login 允許登錄

switch(config-line)#password xx 設置登錄口令

switch#exit 返回命令

Cisco交換機命令之基本介面配置

switch(config)#interface f0/1 進入f0/1介面

switch(config-if)#plex full 配置全雙工模式

switch(config-if)#speed 100 配置速率

switch(config-if)#description to ***** 介面描述

switch(config)#ip domain-name ***.com 設置或名伺服器

switch(config)#mac-address-table aging-time 設置mac表超時時間

switch#write 保存配置信息

switch# running-config startup-config 保存當前配置nvram

switch#erase startup-config 清除配置文件

Cisco交換機命令之交換機VLAN設置:

switch#vlan database 進入VLAN設置

switch(vlan)#vlan 2 建VLAN 2

switch(vlan)#name 名字 建VLAN 2的名稱

switch(vlan)#no vlan 2 刪vlan 2

注:刪除vlan時原屬於此vlan的埠處於非激活狀態,直到重新分配為止。

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

switch(config-if)#switchport mode access 當前埠工作莫試

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

switch(config-if)#switchport mode trunk 設置為干線

switch(config-if)#switchport trunk encapsulation dot1q 設置vlan 中繼協議

switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干線

switch(config-if)#switchport trunk allowed vlan add 1,2 ; 從Trunk中添加vlans

switch(config-if)#switchport trunk allowed vlan remove 1,2 ;從Trunk中刪除vlans

switch(config-if)#switchport trunk pruning vlan remove 1,2 ;從Trunk中關閉局部修剪

Cisco交換機命令之乙太網通道配置

switch(config)#interface range fasternet0/1 - 2 將fasternet0/1和0/2 口捆綁

switch(config-if)#channel-group 1 mode on 配置以太通道模式

switch(config-if)#port-channel load-balance {dst-mac | src-mac}在鏈路間實現負載均衡

switch#show etherchannel 1 summary 查看通道信息

switch#show etherchannel load-balance 查看通道信息

Cisco交換機命令之vtp配置

switch(config)#vtp domain 設置vtp域名

switch(config)#vtp password 設置vtp密碼

switch(config)#vtp mode server 設置vtp伺服器模式

switch(config)#vtp mode client 設置vtp客戶機模式

switch(config)#vtp mode transparent 設置vtp 透明模式

switch(config)#vtp version 設置vtp版本

switch(config)#vtp pruning 啟用vtp修解

switch(config)#no vtp pruning 關閉vtp修解

注:要想從vtp中減少一台交換機只需將該交換機vtp 名更改

Cisco交換機命令之生成樹stp:

switch(config)#spanning-tree vlan 啟用stp生成樹(基於vlan)

switch(config)#spanning-tree vlan root primary 指定根交換機(基於vlan)

switch(config)#spanning-tree vlan root secondary 指定備用根交換機(基於vlan)

switch(config)#spanning-tree vlan priority 指定交換機優先順序(基於vlan)

switch(config)#no spanning-tree vlan priority 將交換機的優先順序恢復默認值(基於vlan)

switch(config-if)#spanning-tree vlan cost 指定埠成本(起用trunk的埠模式下)

switch(config-if)#spanning-tree vlan port-prioty 指定交換機埠優先順序(基於vlan)

switch(config-if)#spanning-tree portfast 配置速埠(連接終端設備的埠狀態)如pc機

switch(config)#spanning-tree uplinkfast 配置上行速埠

switch(config)#spanning-tree vlan hello-time 配置交換機hello時間(基於vlan)

switch(config)#spanning-tree vlan forward-time 修改轉發延遲計時器(基於vlan)

switch(config)#spanning-tree vlan max-time 修改最大老化時間(基於vlan)

switch#show spanning-tree summery 檢測vlan生成樹配置

switch#show spanning-tree vlan detail 瀏覽詳細生成樹配置信息

switch#show spanning-tree interface detail 瀏覽詳細生成樹埠配置信息

Cisco交換機命令之交換機顯示命令:

switch#show vtp status 查看vtp配置信息

switch#show running-config 查看當前配置信息

switch#show vlan 查看vlan配置信息

switch#show interface 查看埠信息

switch#show int f0/0 查看指定埠信息

switch#dir flash: 查看快閃記憶體

switch#show version 查看當前版本信息

switch#show mac-address-table aging-time 查看mac超時時間

switch#show cdp cisco設備發現協議 (可以查看聆接設備)

switch#show cdp traffic 杳看接收和發送的cdp包統計信息

switch#show cdp neighbors 查看與該設備相鄰的cisco設備

switch#show interface f0/1 switchport 查看有關switchport的配置

switch#show cdp neighbors 查看與該設備相鄰的cisco設備

8. 交換機配置命令

1、交換機配置命令,英文名Switchboard Command,是一種計算機語言,用來控制交換機的語言。

9. ssh遠程交換機基本命令

一、配置思路
配置ssh遠程登陸,一般是有四個步驟:
1、首先選擇Console方式登陸交換機
2、開啟交換機的SSH服務功能並配置IP
3、生成加密密鑰
4、配置SSH管理的登入口令
二、配置步驟(以銳捷交換機的配置為例)
一、配置思路
配置ssh遠程登陸,一般是有四個步驟:
1、首先選擇Console方式登陸交換機
2、開啟交換機的SSH服務功能並配置IP
3、生成加密密鑰
4、配置SSH管理的登入口令
二、配置步驟(以銳捷交換機的配置為例)

10. 交換機的基本命令

交換機的啟動及基本配置
1924交換機上配置

sw1924_b#delete nvram
全部清除交換機的所有配置
sw1924_b#reload
重新啟動交換機(初始提示符為> )
sw1924_b#hostname sw1924
設置交換機的主機名
sw1924_b#enable secret cisco
設置加密密碼
sw1924_b#enable password level 1 cisco1
設置等級密碼(1最低)
sw1924_b#enable password level 15 cisco15
設置等級密碼(15最高)
sw1924_b#ip address 192.168.14.1 255.255.255.0
設置交換機的管理IP地址
sw1924_b#ip default-gateway 192.168.198.2
設置交換機的網關地址
sw1924_b#ip domain-name pctc.com.cn
設置交換機所連域的域名
sw1924_b#ip name-server 218.87.18.230
設置交換機所連域的域名伺服器IP
sw1924_b#show ip
查看上述設置環境
sw1924_b#show version
查看交換機的版本等信息
sw1924_b#show running-config
查看交換機的當前運行配置等全部信息
sw1924_b#show int e0/1
查看交換機的第1個埠信息

1924交換機配置埠屬性

sw1924_b#conf t
sw1924_b#interface ethernet 0/1
進入第1個埠
sw1924_b#description sw1924_b-e0/1-pc1
給埠寫入注釋信息
sw1924_b#plex auto/full/full-flow-control/half
設置埠的工作模式
sw1924_b#port secure
啟用埠安全性
sw1924_b#port secure max-mac-count 1
設置該埠允許對應的MAC地址數(默認132個)
sw1924_b#sh mac-address-table security
查看埠安全性

sw1912_a#conf t
進入全局配置模式
sw1912_a#interface fastethernet 0/1
進入第1個埠
sw1912_a#description sw2912_a-f0/1-pc1
給埠寫入注釋信息
sw1912_a#plex auto/full/half
設置埠的工作模式
sw1912_a#port security
啟用埠安全性
sw1912_a#port security max-mac-count 1
設置該埠允許對應的MAC地址數(默認132個)
sw1912_a#end
返回特權模式
sw1912_a#sh port security
查看埠安全性

配置和查看MAC地址表

1924交換機配置MAC地址表

sw1924_b#mac-address-table aging-time 600
設置動態地址超時時間
sw1924_b#mac-address-table permanent 0000.0cdd.5a4d e0/3
定義永久MAC地址(綁定MAC地址)
sw1924_b#mac-address-table restricted static 0000.0cdd.aaed e0/6 e0/7
定義受限MAC地址
sw1924_b#address-violation disable/ignore/suspend
定義地址安全違規
sw1924_b#show mac-address-table
查看上述配置
sw1924_b#clear mac-addr restric static
清除受限MAC地址表項

2912交換機配置MAC地址表

sw2912_a#mac-address-table aging-time 700
設置動態地址超時時間
sw2912_a#mac-address-table static 0000.0cdd.5a4d e0/3
定義永久MAC地址(綁定MAC地址)
sw2912_a#mac-address-table secure 00d0.f80d.3333 f0/3 vlan 1
定義受限MAC地址
sw2912_a#port security action shutdown/trap
定義地址安全違規
sw2912_a#show port security
查看上述配置

配置VTP、VLAN、VLAN Trunk和STP

配置VTP

sw1924_a#conf t
sw1924_a#vtp server
定義VTP的工作模式
sw1924_a#vtp domain cisco
定義VTP的域名
sw1924_a#trunk on
啟用幹道

sw1924_b#vtp domain cisco
加入VTP域
sw1924_b#vtp client
定義VTP的工作模式
sw1924_b#trunk on
啟用幹道

sw1924_a#show trunk b
sw1924_a#show trunk b allowed-vlans
查看幹道信息

配置VLAN

sw1924_a#vlan 10 dept1
sw1924_a#vlan 20 dept2
sw1924_a#vlan 30 dept3
sw1924_a#vlan 40 dept4
定義所需VLAN
sw1924_a#show vlan
查看VLAN信息

sw1924_b#show vlan
sw1924_b#show vtp
查看VTP的信息
sw1924_b#int e0/1
sw1924_b#vlan-membership static 10
sw1924_b#int e0/2
sw1924_b#vlan-membership static 20
sw1924_b#int e0/3
sw1924_b#vlan-membership static 30
sw1924_b#int e0/4
sw1924_b#vlan-membership static 40
把介面劃入各自VLAN

配置spanning tree

sw1924_b#spantree 1
啟用生成樹協議
sw1924_b#sh spantree 1
查看生成樹信息
sw1924_b#no spantree 1
關閉生成樹協議
sw1924_b#sh spantree 1
查看生成樹信息

閱讀全文

與交換機基礎命令相關的資料

熱點內容
安卓如何開網路 瀏覽:730
宿來app什麼時候上線 瀏覽:764
成都python培訓機構好不好 瀏覽:421
mysql查看配置命令 瀏覽:597
v8編譯cmake 瀏覽:965
app品牌起步階段需要什麼營銷 瀏覽:358
壓縮機製冷劑溫度 瀏覽:930
會日語的程序員 瀏覽:19
網銀密碼加密失敗怎麼回事 瀏覽:727
android開發音樂播放器 瀏覽:808
ug120陣列命令快捷鍵 瀏覽:597
氣動隔膜式壓縮機 瀏覽:470
linux如何修改主機名 瀏覽:104
單片機游標上下移動 瀏覽:528
數據加密驗證 瀏覽:108
程序員被激怒 瀏覽:891
winxp找不到伺服器dns地址 瀏覽:842
以文本文件的格式保存考生文件夾 瀏覽:41
編譯原理文法分為幾類 瀏覽:570
JAVA基礎學python要多久 瀏覽:74