思科三層交換機(jī)配置命令
發(fā)布時(shí)間:2014-04-30 15:40:03 作者:佚名
我要評論

這篇文章主要介紹了思科三層交換機(jī)配置命令,需要的朋友可以一起看看
1. 交換機(jī)支持的命令:
交換機(jī)基本狀態(tài):
switch: ;ROM狀態(tài), 路由器是rommon>
hostname> ;用戶模式
hostname# ;特權(quán)模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;接口狀態(tài)
交換機(jī)口令設(shè)置:
switch>enable ;進(jìn)入特權(quán)模式
switch#config terminal ;進(jìn)入全局配置模式
switch(config)#hostname ;設(shè)置交換機(jī)的主機(jī)名
switch(config)#enable secret xxx ;設(shè)置特權(quán)加密口令
switch(config)#enable password xxa ;設(shè)置特權(quán)非密口令
switch(config)#line console 0 ;進(jìn)入控制臺口
switch(config-line)#line vty 0 4 ;進(jìn)入虛擬終端
switch(config-line)#login ;允許登錄
switch(config-line)#password xx ;設(shè)置登錄口令xx
switch#exit ;返回命令
交換機(jī)VLAN設(shè)置:
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)入端口1
switch(config-if)#switchport access vlan 2 ;當(dāng)前端口加入vlan 2
switch(config-if)#switchport mode trunk ;設(shè)置為干線
switch(config-if)#switchport trunk allowed vlan 1,2 ;設(shè)置允許的vlan
switch(config-if)#switchport trunk encap dot1q ;設(shè)置vlan 中繼
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 ;設(shè)置IP地址
switch(config)#ip default-gateway ;設(shè)置默認(rèn)網(wǎng)關(guān)
switch#dir flash: ;查看閃存
交換機(jī)顯示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看當(dāng)前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息
補(bǔ)充 :
3層交換機(jī)多出的就是路由能力,體現(xiàn)在vlan的互相通信功能和端口的路由能力,下面介紹:
開啟路由功能:ip routing
進(jìn)入vlan 配置網(wǎng)段網(wǎng)關(guān)與路由配置接口相同
interface vlan 1
ip 192.168.1.1 255.255.255.0
路由配置與路由器配置相同只是把接口換為VLAN+VLAN號,開啟接口路由功能,進(jìn)入接口配置:no swichport
交換機(jī)基本狀態(tài):
switch: ;ROM狀態(tài), 路由器是rommon>
hostname> ;用戶模式
hostname# ;特權(quán)模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;接口狀態(tài)
交換機(jī)口令設(shè)置:
switch>enable ;進(jìn)入特權(quán)模式
switch#config terminal ;進(jìn)入全局配置模式
switch(config)#hostname ;設(shè)置交換機(jī)的主機(jī)名
switch(config)#enable secret xxx ;設(shè)置特權(quán)加密口令
switch(config)#enable password xxa ;設(shè)置特權(quán)非密口令
switch(config)#line console 0 ;進(jìn)入控制臺口
switch(config-line)#line vty 0 4 ;進(jìn)入虛擬終端
switch(config-line)#login ;允許登錄
switch(config-line)#password xx ;設(shè)置登錄口令xx
switch#exit ;返回命令
交換機(jī)VLAN設(shè)置:
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)入端口1
switch(config-if)#switchport access vlan 2 ;當(dāng)前端口加入vlan 2
switch(config-if)#switchport mode trunk ;設(shè)置為干線
switch(config-if)#switchport trunk allowed vlan 1,2 ;設(shè)置允許的vlan
switch(config-if)#switchport trunk encap dot1q ;設(shè)置vlan 中繼
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 ;設(shè)置IP地址
switch(config)#ip default-gateway ;設(shè)置默認(rèn)網(wǎng)關(guān)
switch#dir flash: ;查看閃存
交換機(jī)顯示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看當(dāng)前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息
補(bǔ)充 :
3層交換機(jī)多出的就是路由能力,體現(xiàn)在vlan的互相通信功能和端口的路由能力,下面介紹:
開啟路由功能:ip routing
進(jìn)入vlan 配置網(wǎng)段網(wǎng)關(guān)與路由配置接口相同
interface vlan 1
ip 192.168.1.1 255.255.255.0
路由配置與路由器配置相同只是把接口換為VLAN+VLAN號,開啟接口路由功能,進(jìn)入接口配置:no swichport
相關(guān)文章
- 這篇文章主要介紹了cisco交換機(jī)配置vlan方法,需要的朋友可以參考下2014-04-30
switch操作系統(tǒng)交換機(jī)設(shè)置介紹
這篇文章主要介紹了switch操作系統(tǒng)交換機(jī)設(shè)置方法,需要的朋友可以參考下2014-04-02- 這篇文章主要介紹了H3C S3100交換機(jī)常用操作的相關(guān)資料,需要的朋友可以參考下2014-03-17
- 在華為三層交換機(jī)上進(jìn)行VLAN間路由的配置,主要就是創(chuàng)建VLAN,端口劃分,三層VLAN接口地址配置,靜態(tài)路由或是RIP協(xié)議配置2014-02-19
利用交換機(jī)提升無盤網(wǎng)絡(luò)性能的方法
網(wǎng)絡(luò)現(xiàn)在流行的有千M網(wǎng)絡(luò)和百M(fèi)網(wǎng)絡(luò),萬M的也有,無盤網(wǎng)吧網(wǎng)絡(luò)要達(dá)到更大M的網(wǎng)絡(luò)環(huán)境,下面為大家介紹下如何利用交換機(jī)提升無盤網(wǎng)吧網(wǎng)絡(luò)性能2014-01-30- 所謂的poe交換機(jī)就是端口支持輸出功率達(dá)15.4W,符合IEEE802.3af標(biāo)準(zhǔn),通過網(wǎng)線供電的方式為標(biāo)準(zhǔn)的POE終端設(shè)備供電,免去額外的電源布線,感興趣的朋友可以了解下本文2014-01-21
- 連接交換機(jī)的console口到終端或PC仿真終端。用無Modem的直連線連接PC的串行口到交換機(jī)的console口2014-01-18
如何解決交換機(jī)的DDoS攻擊與內(nèi)網(wǎng)服務(wù)器DDoS攻擊的問題
內(nèi)網(wǎng)服務(wù)器DDoS攻擊和交換機(jī)的DDoS攻擊,直接影響網(wǎng)吧網(wǎng)絡(luò)的安全問題,下面與大家分享下具體的解決方法,感興趣的朋友可以參考下哈,希望對大家有所幫助2013-07-12路由模式怎么實(shí)現(xiàn)局域網(wǎng)中三層交換機(jī)互聯(lián)?實(shí)現(xiàn)局域網(wǎng)中三層交換機(jī)互聯(lián)
路由模式怎么實(shí)現(xiàn)局域網(wǎng)中三層交換機(jī)互聯(lián)?下面小編告訴大家方法,有需要的朋友可以看看2014-05-21