網路技術知識其實也是弱電裡面的一個難點,這個一般是在大學課程裡面才能詳細的學習,今天小編帶來的是交換機的基本配置命令。
一、基本配置命令
switch> 使用者模式
1:進入特權模式 enable
switch> enable
switch#
2:進入全域性配置模式 configure terminal
switch> enable
switch#c onfigure terminal
switch(conf)#
3:交換機命名 hostname aptech2950 以 aptech2950 為例
switch> enable
switch#c onfigure terminal
switch(conf)#hostname aptch-2950
aptech2950(conf)#
4:配置使能口令 enable password cisco 以 cisco 為例
switch> enable
switch#c onfigure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# enable password cisco
5:配置使能密碼 enable secret ciscolab 以 cicsolab 為例
switch> enable
switch#c onfigure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# enable secret ciscolab
6:設定虛擬區域網 vlan 1 interface vlan 1
switch> enable
switch#c onfigure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# interface vlan 1
aptech2950(conf-if)#ip address 配置交換機埠 ip 和子網掩碼
aptech2950(conf-if)#no shut 是配置處於執行中
aptech2950(conf-if)#exit
aptech2950(conf)#ip default-gateway 192.168.254 設定閘道器地址
7:進入交換機某一埠 interface fastehernet 0/17 以 17 埠為例
switch> enable
switch#c onfigure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# interface fastehernet 0/17
aptech2950(conf-if)#
8:檢視命令 show
switch> enable
switch# show version 察看系統中的所有版本資訊
show interface vlan 1 檢視交換機有關 ip 協議的配置資訊
show running-configure 檢視交換機當前起作用的配置資訊
show interface fastethernet 0/1 察看交換機 1 介面具體配置和統計資訊
show mac-address-table 檢視 mac 地址表
show mac-address-table aging-time 檢視 mac 地址表自動老化時間
9:交換機恢復出廠預設恢復命令
switch> enable
switch# erase startup-configure
switch# reload
10:雙工模式設定
switch> enable
switch#c onfigure terminal
switch2950(conf)#hostname aptch-2950
aptech2950(conf)# interface fastehernet 0/17 以 17 埠為例
aptech2950(conf-if)#duplex full/half/auto 有 full , half, auto 三個可選
項
11:cdp 相關命令
switch> enable
switch# show cdp 檢視裝置的 cdp 全域性配置資訊
show cdp interface fastethernet 0/17 檢視 17 埠的 cdp 配置資訊
show cdp traffic 檢視有關 cdp 包的統計資訊
show cdp nerghbors 列出與裝置相連的 cisco 裝置
12:csico2950 的.密碼恢復
拔下交換機電源線。
用手按著交換機的 MODE 鍵,插上電源線
在 switch:後執行 flash_ini 命令:switch: flash_ini
檢視 flash 中的檔案: switch: dir flash:
把“”檔案改名為“”: switch: rename flash: flash:
執行 boot: switch: boot
交換機進入是否進入配置的對話,執行 no :
進入特權模式察看 flash 裡的檔案: show flash :
把“”檔案改名為“”: switch: rename flash: flash:
把 “ ” 拷 入 系 統 的 “ running-configure ”: copy flash: system :
running-configure
把配置模式重新設定密碼存檔,密碼恢復成功。
13:交換機 telnet 遠端登入設定:
switch>en
switch#c onfigure terminal
switch(conf)#hostname aptech-2950
aptech2950(conf)#enable password cisco 以 cisco 為特權模式密碼
aptech2950(conf)#interface fastethernet 0/1 以 17 埠為 telnet 遠端登入埠
aptech2950(conf-if)#ip address
aptech2950(conf-if)#no shut
aptech2950(conf-if)#exit
aptech2950(conf)line vty 0 4 設定 0-4 個使用者可以 telnet 遠端登陸
aptech2950(conf-line)#login
aptech2950(conf-line)#password edge 以 edge 為遠端登入的使用者密碼
主機設定:
ip 主機的 ip 必須和交換機埠的地址在同一網路
段
netmask
gate-way 閘道器地址是交換機埠地址
執行:
telnet
進入 telnet 遠端登入介面
password : edge
aptech2950>en
password: cisco
aptech#
14:交換機配置的重新載入和儲存
設定完成交換機的配置後:
aptech2950(conf)#reload
是否儲存(y/n) y: 儲存設定資訊 n:不儲存設定資訊