基本上思科三層交換機配備命令
1. 交換機適用的命令:
交換機基本上狀態(tài):
switch: ;ROM狀態(tài), 路由器是rommon>
hostname> ;客戶方式
hostname# ;權(quán)利方式
hostname(config)# ;全局性配制方式
hostname(config-if)# ;插口狀態(tài)
交換機動態(tài)口令設定:
switch>enable ;進到權(quán)利方式
switch#config terminal ;進到全局性配制方式
switch(config)#hostname ;設定交換機的IP地址
switch(config)#enable secret xxx ;設定權(quán)利數(shù)據(jù)加密動態(tài)口令
switch(config)#enable password xxa ;設定權(quán)利非密動態(tài)口令
switch(config)#line console 0 ;進到控制面板口
switch(config-line)#line vty 0 4 ;進到虛似終端設備
switch(config-line)#login ;容許登陸
switch(config-line)#password xx ;設定登陸動態(tài)口令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 ;現(xiàn)階段端口號添加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網(wǎng)站域名
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)關
switch#dir flash: ;查詢閃存芯片
交換機表明命令:
switch#write ;儲存配備信息內(nèi)容
switch#show vtp ;查詢vtp配備信息內(nèi)容
switch#show run ;查詢現(xiàn)階段配備信息內(nèi)容
switch#show vlan ;查詢vlan配置信息內(nèi)容
switch#show interface ;查看端口信息
switch#show int f0/0 ;查詢特定端口號信息內(nèi)容
填補 :
3層交換機空出的便是路由器工作能力,反映在vlan的相互之間通訊作用和端口號的路由器工作能力,下邊詳細介紹:
打開路由器作用:ip routing
進到vlan 配備ip段網(wǎng)關ip與路由器配備插口同樣
interface vlan 1
ip 192.168.1.1 255.255.255.0
路由器配備與路由器配置同樣僅僅把插口替換成VLAN VLAN號,打開插口路由器作用,進到插口配備:no swichport