六月丁香五月婷婷,丁香五月婷婷网,欧美激情网站,日本护士xxxx,禁止18岁天天操夜夜操,18岁禁止1000免费,国产福利无码一区色费

學習啦 > 學習電腦 > 電腦入門 > 思科2960交換機的配置命令

思科2960交換機的配置命令

時間: 志藝942 分享

思科2960交換機的配置命令

  你還在為不知道思科2960交換機的配置命令而煩惱么?接下來是小編為大家收集的思科2960交換機的配置命令教程,希望能幫到大家。

  思科2960交換機的配置命令的方法

  交換機基本狀態(tài):

  switch: ;ROM狀態(tài), 路由器是rommon>

  hostname> ;用戶模式

  hostname# ;特權(quán)模式

  hostname(config)# ;全局配置模式

  hostname(config-if)# ;接口狀態(tài)

  交換機口令設置:

  switch>enable ;進入特權(quán)模式

  switch#config terminal ;進入全局配置模式

  switch(config)#hostname ;設置交換機的主機名

  switch(config)#enable secret xxx ;設置特權(quán)加密口令

  switch(config)#enable password xxa ;設置特權(quán)非密口令

  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 ;設置發(fā)vtp域名

  switch(config)#vtp password ;設置發(fā)vtp密碼

  switch(config)#vtp mode server ;設置發(fā)vtp模式

  switch(config)#vtp mode client ;設置發(fā)vtp模式

  交換機設置IP地址:

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

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

  switch(config)#ip default-gateway ;設置默認網(wǎng)關(guān)

  switch#dir flash: ;查看閃存

  交換機顯示命令:

  switch#write ;保存配置信息

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

  switch#show run ;查看當前配置信息

  switch#show vlan ;查看vlan配置信息

  switch#show interface ;查看端口信息

  switch#show int f0/0 ;查看指定端口信息

  交換機命令總結(jié)

  基本配置命令

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

  Switch #config terminal 進入全局配置模式

  Switch (config)#hostname 設置交換機的主機名

  Switch(config)#enable password 進入特權(quán)模式的密碼(明文形式保存)

  Switch(config)#enable secret 加密密碼(加密形式保存) (優(yōu)先)

  Switch(config)#ip default-gateway 配置交換機網(wǎng)關(guān)

  Switch(config)#show mac-address-table 查看MAC地址

  Switch(config)logging synchronous 阻止控制臺信息覆蓋命令行上的輸入

  Switch(config)no ip domain-lookup 關(guān)閉DNS查找功能

  Switch(config)exec-timeout 0 0 阻止會話退出

  使用Telnet遠程式管理

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

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

  Switch (config-line)# login 要求口令驗證

  控制臺口令

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

  switch(config-line)# password xx

  switch(config-line)# 設置登錄口令login 允許登錄

  Cisco發(fā)現(xiàn)協(xié)議(CDP)

  Switch(config)#show cdp 顯示Cisco設備全局配置信息

  Switch(config)#show cdp interface 端口 查看CDP配置下端口信息

  Switch(config)#show cdp neighbors 顯示直連Cisco設備信息

  Switch(config)#show cdp neighbors detail 查看鄰居詳細信息

  恢復出廠配置

  Switch(config)#erase startup-config

  Switch(config)delete vlan.dat

  配置接口標識 接口標識用于區(qū)分路由器的各個接口。

  switch(config)#interface fastethernet 0/1 以0/1 接口為例

  switch(config)# description this is a fast Ethernet port used to connecting the company’s intranet!

  Vtp配置

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

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

  switch(config)#vtp mode server /client/transparent 設置vtp服務器模式

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

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

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

  Vlan基本配置

  Switch#vlan database 進去vlan配置模式

  Switch(vlan)#vlan 號碼 name 名稱 創(chuàng)建vlan及vlan名

  Switch(vlan)#vlan號碼 mtu數(shù)值 修改MTU大小

  Switch(vlan)#exit 更新vlan數(shù)據(jù)并推出

  Switch#show vlan 查看\驗證

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

  叫NO 刪除VLAN

  VLAN 中添加 刪除端口

  Switch#config terminal 進入全局配置

  Switch(config)#interface fastethernet0/1 進入要分配的端口

  Switch(config-if)#Switchport mode access 定義二層端口

  Switch(config-if)#Switchport acces vlan 號 把端口分給一個vlan

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

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

  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中刪除vlan

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

  查看vlan信息 Switch#show vlan brief 所有vlan信息

  查看vlan信息 Switch#show vlan id 某個vlan信息

  注:Switch#show int trunk 查看trunk協(xié)議

  注:可以使用default interface interface-id 還原接口到默認配置狀態(tài)

  Trunk

  開啟(no) ——將端口設置為永久中繼模式

  關(guān)閉(off) ——將端口設置為永久非中繼模式, 并且將鏈路轉(zhuǎn)變?yōu)榉侵欣^鏈路

  企望(desirable)——讓端口主動試圖將鏈路轉(zhuǎn)換成中繼鏈路

  自動(auto) ——使該端口愿意將鏈路變成中繼鏈路

  配置接口為動態(tài)協(xié)商模式

  Switch(config)#interface 接口號

  Switch(config)#switchport mode dynamic desirable/auto

  生成樹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 <0-65535> 指定交換機優(yōu)先級(基于vlan)

  Switch(config)#no spanning-tree vlan priority 將交換機的優(yōu)先級恢復默認值(基于vlan)

  Switch(config-if)#spanning-tree vlan cost <0-200000000> 指定端口成本(起用trunk的端口模式下)

  Switch(config-if)#spanning-tree vlan port-prioty <0-255> 指定交換機端口優(yōu)先級(基于vlan)

  Switch(config-if)#spanning-tree portfast 配置速端口(連接終端設備的端口狀態(tài))如pc機

  Switch(config)#spanning-tree uplinkfast 配置上行速端口

  注:在配置上行速端口前要先將基于vlan上的網(wǎng)橋優(yōu)先級,網(wǎng)橋成本恢復默認值。起用了該命令后在進行優(yōu)先級更改,

  注:vlan為可選參數(shù),當沒有該參數(shù)時將修改所有vlan網(wǎng)橋的優(yōu)先級\及所有的vlan端口成本

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

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

  Switch#show spanning-tree interface detail 瀏覽詳細生成樹端口配置信息

  以太網(wǎng)通道配置

  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}在鏈路間實現(xiàn)負載均衡

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

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

  交換機顯示命令:

  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 cdp cisco設備發(fā)現(xiàn)協(xié)議 (可以查看聆接設備)

  switch#show cdp traffic 杳看接收和發(fā)送的cdp包統(tǒng)計信息

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

  switch#show interface f0/1 switchport 查看有關(guān)switchport的配置

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

  配置接口標識 接口標識用于區(qū)分路由器的各個接口。

  switch(config)#interface fastethernet 0/1 以0/1 接口為例

  switch(config)# description this is a fast Ethernet port used to connecting the company’s intranet!

  Vtp配置

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

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

  switch(config)#vtp mode server /client/transparent 設置vtp服務器模式

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

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

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

  Vlan基本配置

  Switch#vlan database 進去vlan配置模式

  Switch(vlan)#vlan 號碼 name 名稱 創(chuàng)建vlan及vlan名

  Switch(vlan)#vlan號碼 mtu數(shù)值 修改MTU大小

  Switch(vlan)#exit 更新vlan數(shù)據(jù)并推出

  Switch#show vlan 查看\驗證

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

  叫NO 刪除VLAN

  VLAN 中添加 刪除端口

  Switch#config terminal 進入全局配置

  Switch(config)#interface fastethernet0/1 進入要分配的端口

  Switch(config-if)#Switchport mode access 定義二層端口

  Switch(config-if)#Switchport acces vlan 號 把端口分給一個vlan

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

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

  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中刪除vlan

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

  查看vlan信息 Switch#show vlan brief 所有vlan信息

  查看vlan信息 Switch#show vlan id 某個vlan信息

  注:Switch#show int trunk 查看trunk協(xié)議

  注:可以使用default interface interface-id 還原接口到默認配置狀態(tài)

  Trunk

  開啟(no) ——將端口設置為永久中繼模式

  關(guān)閉(off) ——將端口設置為永久非中繼模式, 并且將鏈路轉(zhuǎn)變?yōu)榉侵欣^鏈路

  企望(desirable)——讓端口主動試圖將鏈路轉(zhuǎn)換成中繼鏈路

  自動(auto) ——使該端口愿意將鏈路變成中繼鏈路

  配置接口為動態(tài)協(xié)商模式

  Switch(config)#interface 接口號

  Switch(config)#switchport mode dynamic desirable/auto

  生成樹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 <0-65535> 指定交換機優(yōu)先級(基于vlan)

  Switch(config)#no spanning-tree vlan priority 將交換機的優(yōu)先級恢復默認值(基于vlan)

  Switch(config-if)#spanning-tree vlan cost <0-200000000> 指定端口成本(起用trunk的端口模式下)

  Switch(config-if)#spanning-tree vlan port-prioty <0-255> 指定交換機端口優(yōu)先級(基于vlan)

  Switch(config-if)#spanning-tree portfast 配置速端口(連接終端設備的端口狀態(tài))如pc機

  Switch(config)#spanning-tree uplinkfast 配置上行速端口

  注:在配置上行速端口前要先將基于vlan上的網(wǎng)橋優(yōu)先級,網(wǎng)橋成本恢復默認值。起用了該命令后在進行優(yōu)先級更改,

  注:vlan為可選參數(shù),當沒有該參數(shù)時將修改所有vlan網(wǎng)橋的優(yōu)先級\及所有的vlan端口成本

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

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

  Switch#show spanning-tree interface detail 瀏覽詳細生成樹端口配置信息

  以太網(wǎng)通道配置

  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}在鏈路間實現(xiàn)負載均衡

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

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

  交換機顯示命令:

  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 cdp cisco設備發(fā)現(xiàn)協(xié)議 (可以查看聆接設備)

  switch#show cdp traffic 杳看接收和發(fā)送的cdp包統(tǒng)計信息

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

  switch#show interface f0/1 switchport 查看有關(guān)switchport的配置

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

看了“思科2960交換機的配置命令”還看了:

1.cisco2960交換機安裝配置基礎(chǔ)詳解

2.思科交換機配置命令 交換機VLAN設置方法

3.思科交換機配置教程詳解

4.Cisco 2960交換機的基礎(chǔ)安裝配置教程

5.思科交換機基本配置實例講解

6.思科2960系列交換機限速命令

2743394