switch配置1.docx
- 文档编号:30057866
- 上传时间:2023-08-04
- 格式:DOCX
- 页数:18
- 大小:41.08KB
switch配置1.docx
《switch配置1.docx》由会员分享,可在线阅读,更多相关《switch配置1.docx(18页珍藏版)》请在冰豆网上搜索。
switch配置1
Switch基本配置
将VTP配置成client模式
Switch#conft
Switch(config)#vtpclient
Switch(config)#vtpdomainGSP_COM
Switch(config)#vtppasswordGSP_COM
配置管理IP
Switch#conft
Switch(config)#interfacevlan2
Switch(config-if)#ipaddress10.128.48.190255.255.255.0
Switch(config-if)#nosh
配置网关
Switch(config)#ipdefault-gateway10.128.48.254
将端口划到Vlan
Switch(config)#interfacerangefastEthernet0/1-23
Switch(config-if-range)#switchportaccessvlinexian67
Switch(config-if-range)#spanning-treeportfast
Switch(config-if-range)#switchportmodeaccess
Fa0/24配置成trunk口
Switch(config)#interfacefastEthernet0/24
Switch(config-if)#switchportmodetrunk
配置en密码
switch#conft
switch(config)#enablesecret******
配置telnet密码VTY(virtualtypeterminal)虚拟终端连接
switch#conft
switch(config)#linevty04
switch(config-line)#password******
switch(config-line)#exit
switch(config)#servicepassword-encryption
配置SNMP协议
access-list99permit10.128.26.207
snmp-servercommunitygzlisRO99
snmp-serverhost10.128.26.206gzlis
更改VLAN
IMG_B2_PD_2FC_135A#conft
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
IMG_B2_PD_2FC_135A(config)#inter
IMG_B2_PD_2FC_135A(config)#interfacef0/22
IMG_B2_PD_2FC_135A(config-if)#swi
IMG_B2_PD_2FC_135A(config-if)#switchportacce
IMG_B2_PD_2FC_135A(config-if)#switchportaccessvlan42
IMG_B2_PD_2FC_135A(config-if)#exit
IMG_B2_PD_2FC_135A(config)#exit
IMG_B2_PD_2FC_135A#showrun
Buildingconfiguration...
WR
配置Switch
Switch#shvtpstatus=>showVTP信息
VTPVersion:
2
ConfigurationRevision:
0
MaximumVLANssupportedlocally:
128
NumberofexistingVLANs:
5
VTPOperatingMode:
Server
VTPDomainName:
VTPPruningMode:
Disabled
VTPV2Mode:
Disabled
VTPTrapsGeneration:
Disabled
MD5digest:
0x570xCD0x400x650x630x590x470xBD
Configurationlastmodifiedby0.0.0.0at0-0-0000:
00:
00
LocalupdaterIDis0.0.0.0(novalidinterfacefound)
将VTPOperatingMode:
Server改为clitent
Switch#vlandatabase
Switch(vlan)#vtpclient?
配置Domainname
Switch(vlan)#vtpdomainGSP_IMG
配置VTPPassword
Switch(vlan)#vtppassword=>password要和domain名字一样。
GSP_IMG
保存wr
configvlan
Switch#configureterminal
Switch(config)#interfacevlan2=>进入管理vlan
Switch(config-if)#ipaddress10.128.16.228255.255.255.0=>配置vlanip
Switch(config-if)#noshutdown
配置default-gateway
Switch(config)#ipdefault-gateway10.128.16.254
将port划到vlan
Switch(config)#interfacef0/1(单个端口)
Switch(config)#interfacerangefastEthernet0/1-23
Switch(config-if-range)#switchportaccessvlan35=>将1-23port划到vlan35
将24port做trunk
Switch(config)#interfacefastEthernet0/24
Switch(config-if)#switchportmodetrunk
Switch(config-if)#switchporttrunkencapsulationdot
配置快速发送
conft到相应端品
Switch(config-if)#spanning-treeportfast
配置端品为数据模式
conft到相应端口
Switch(config-if)#switchportmodeaccess
配置en密码及telnet密码
switch(config)#enablesecret****=>*号为密码
switch#conft
switch(config)#linevty04
switch(config-line)#password****=>*号为密码
switch(config-line)#exit
switch(config)#servicepassword-encryption
cisco2960加login指令
清除交换机配置
switch#erasenvram
清除vlan信息
switch(config)#deletevlan.dat
switch#reload
清除log
switch#clearlogging
配置SNMP通过HostMonitor监视Switch
access-list99permit10.128.26.207
snmp-servercommunitygzlisRO99
snmp-serverhost10.128.26.206gzlis
端品监听
interfaceFastEthernet0/42=>接的是DNSServer安装Sniffer
descriptiontoDNS:
192.168.20.5
portmonitorFastEthernet0/1=>fa0/1接的是interjak
switchportaccessvlan20
spanning-treeportfast
fa0/42监听fa0/1
支持中继上的所有VLAN
switch(config-if)#switchporttrunkallowedvlanall
显示端口信息摘要
switch#shipintbrief
设备:
一台3560交換機,四台2960交換機
在3550上劃分9個VLAN並開啟DHCP服務(交換機名為Gather)
VLAN10,name:
serverlan IP:
128.10.0.254網段:
128.10.0.0/24(作管理VLAN)
VLAN11,name:
room1IP:
128.10.1.62網段:
128.10.1.0/26
VLAN12,name:
room2IP:
128.10.1.126網段:
128.10.1.64/26
VLAN13,name:
room3IP:
128.10.1.190網段:
128.10.1.128/26
VLAN14,name:
room4IP:
128.10.1.254網段:
128.10.1.192/26
VLAN15,name:
class1 IP:
128.10.2.126網段:
128.10.2.0/25
VLAN16,name:
class2 IP:
128.10.2.254網段:
128.10.2.128/25
VLAN17,name:
experiment IP:
128.10.3.254網段:
128.10.3.0/24
VLAN18,name:
building IP:
128.10.5.254網段:
128.10.4.0/23
四台2960交換機設置
Switch1name:
serverlanvlan10ip:
128.10.0.253(默認VLAN1為管理VLAN)
Switch2name:
roomvlan11/12/13/14ip:
128.10.1.253(VLAN14為管理VLAN)
Switch3name:
classvlan15/16ip:
128.10.2.253(VLAN16為管理VLAN)
Switch4name:
officevlan17/18ip:
128.10.5.253(VLAN18為管理VLAN)
3550端口F0/1接Switch1端口G1/1
3550端口F0/2接Switch2端口G1/1
3550端口F0/3接Switch3端口G1/1
Switch3端口G1/2接Switch4端口G1/1
C3560主交换机配置
Switch>enable
Switch#configureterminal
Switch(config)#hostnameGather交換機命名
Gather(config)#enablesecretbbb設置特權模式的加密密碼
Gather(config)#lineconsole0進入console狀態(0表示只有一個口访问)
Gather(config-line)#passwordaaa設置console口登陸口令
Gather(config-line)#login允許登陸(必須設置password後才有效)
Gather(config-line)#linevty04進入telnet狀態(04表示可以有5个用户访问,最多是015)
Gather(config-line)#passwordaaa設置telnet登陸口令
Gather(config-line)#login允許登陸(必須設置password後才有效)
Gather(config-line)#end返回到特權模式
Gather#vlandatabase進入VLAN全局模式
Gather(vlan)#vlan10nameserverlan創建VLAN10並命名
Gather(vlan)#vlan11nameroom1創建VLAN11並命名
Gather(vlan)#vlan12nameroom2創建VLAN12並命名
Gather(vlan)#vlan13nameroom3創建VLAN13並命名
Gather(vlan)#vlan14nameroom4創建VLAN14並命名
Gather(vlan)#vlan15nameclass1創建VLAN15並命名
Gather(vlan)#vlan16nameclass2創建VLAN16並命名
Gather(vlan)#vlan17nameexperiment創建VLAN17並命名
Gather(vlan)#vlan18namebuilding創建VLAN18並命名
Gather(vlan)#exit返回到上一層
Gather#configureterminal
Gather(config)#interfacevlan10進入VLAN10逻辑端口
Gather(config-if)#ipaddress128.10.0.254255.255.255.0設置VLAN10IP及掩碼
Gather(config-if)#noshutdown激活VLAN10為管理VLAN
Gather(config-if)#interfacevlan11進入VLAN11逻辑端口
Gather(config-if)#ipaddress128.10.1.62255.255.255.192設置VLAN11IP及掩碼
Gather(config-if)#interfacevlan12進入VLAN12逻辑端口
Gather(config-if)#ipaddress128.10.1.126255.255.255.192設置VLAN12IP及掩碼
Gather(config-if)#interfacevlan13進入VLAN13逻辑端口
Gather(config-if)#ipaddress128.10.1.190255.255.255.192設置VLAN13IP及掩碼
Gather(config-if)#interfacevlan14進入VLAN14逻辑端口
Gather(config-if)#ipaddress128.10.1.254255.255.255.192設置VLAN14IP及掩碼
Gather(config-if)#interfacevlan15進入VLAN15逻辑端口
Gather(config-if)#ipaddress128.10.2.126255.255.255.128設置VLAN15IP及掩碼
Gather(config-if)#interfacevlan16進入VLAN16逻辑端口
Gather(config-if)#ipaddress128.10.2.254255.255.255.128設置VLAN16IP及掩碼
Gather(config-if)#interfacevlan17進入VLAN17逻辑端口
Gather(config-if)#ipaddress128.10.3.254255.255.255.0設置VLAN17IP及掩碼
Gather(config-if)#interfacevlan18進入VLAN18逻辑端口
Gather(config-if)#ipaddress128.10.5.254255.255.254.0設置VLAN18IP及掩碼
Gather(config-if)#exit返回上一層
Gather(config)#iprouting開啟IP路由、使VLAN間可以通信
Gather(config)#interfacefastethernet0/1進入端口1
Gather(config-if)#switchportmodeaccess设置只能連接一個VLAN的中繼(主幹)模式
Gather(config-if)#switchportaccessvlan10允许VLAN10通信
Gather(config-if)#descriptionserverlan添加端口的文字描述
Gather(config-if)#interfacefastethernet0/2進入端口2
Gather(config-if-range)#switchportmodetrunk設置中繼/主幹模式(共享VLAN)
Gather(config-if)#descriptionroom添加端口的文字描述
Gather(config-if)#interfacefastethernet0/3進入端口3
Gather(config-if-range)#switchportmodetrunk設置中繼/主幹模式(共享VLAN)
Gather(config-if)#descriptionclass添加端口的文字描述
Gather(config-if)#end返回到特權模式
Gather#vlandatabase進入VLAN全局模式
Gather(vlan)#vtpdomainMIS設置VTP域名為MIS
Gather(vlan)#vtpserver設置為server模式(下層交換機學習此交換機VLAN信息)
Gather(vlan)#vtpv2啟用V2版本(所有同VTP域交換機都必須是相同版本)
Gather(vlan)#exit返回上一層
Gather#configureterminal進入全局模式
Gather(config)#ServiceDhcp啟用DHCP服務(默认配置了地址池就会启用)
Gather(config)#ipdhcppoolserverlan創建並設置地址池名稱
Gather(dhcp-config)#network128.10.0.0255.255.255.0設置子網IP段
Gather(dhcp-config)#default-router128.10.0.254設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolroom1創建並設置地址池名稱
Gather(dhcp-config)#network128.10.1.0255.255.255.192設置子網IP段
Gather(dhcp-config)#default-router128.10.1.62設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolroom2創建並設置地址池名稱
Gather(dhcp-config)#network128.10.1.64255.255.255.192設置子網IP段
Gather(dhcp-config)#default-router128.10.1.126設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolroom3創建並設置地址池名稱
Gather(dhcp-config)#network128.10.1.128255.255.255.192設置子網IP段
Gather(dhcp-config)#default-router128.10.1.190設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolroom4創建並設置地址池名稱
Gather(dhcp-config)#network128.10.1.192255.255.255.192設置子網IP段
Gather(dhcp-config)#default-router128.10.1.254設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolclass1創建並設置地址池名稱
Gather(dhcp-config)#network128.10.2.0255.255.255.128設置子網IP段
Gather(dhcp-config)#default-router128.10.2.126設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolclass2創建並設置地址池名稱
Gather(dhcp-config)#network128.10.2.128255.255.255.128設置子網IP段
Gather(dhcp-config)#default-router128.10.2.254設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolexperiment創建並設置地址池名稱
Gather(dhcp-config)#network128.10.3.0255.255.255.0設置子網IP段
Gather(dhcp-config)#default-router128.10.3.254設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#ipdhcppoolbuilding創建並設置地址池名稱
Gather(dhcp-config)#network128.10.4.0255.255.254.0設置子網IP段
Gather(dhcp-config)#default-router128.10.5.254設置網關
Gather(dhcp-config)#dns-server128.10.0.2設置DNS地址
Gather(dhcp-config)#exit返回上一层
Gather(config)#ipdhcpexcluded-address128.10.0.1128.10.0.10保留IP段(必須是連續的)
Gather(config)#ipdhcpexcluded-address128
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- switch 配置
![提示](https://static.bdocx.com/images/bang_tan.gif)