三层与二层交换机的配置脚本配置数据网线接口网络分配汇编.docx
《三层与二层交换机的配置脚本配置数据网线接口网络分配汇编.docx》由会员分享,可在线阅读,更多相关《三层与二层交换机的配置脚本配置数据网线接口网络分配汇编.docx(22页珍藏版)》请在冰豆网上搜索。
![三层与二层交换机的配置脚本配置数据网线接口网络分配汇编.docx](https://file1.bdocx.com/fileroot1/2023-1/31/1dbecd0a-10dd-4808-914e-879e892a9500/1dbecd0a-10dd-4808-914e-879e892a95001.gif)
三层与二层交换机的配置脚本配置数据网线接口网络分配汇编
三层交换机配置部分
#//改三层交换机的名字
sysnameLYXXX-9303
#//开启交换机的FTP服务方便后期备份配置
FTPserverenable
#//划分VLAN
vlanbatch99255100012001210to121112211231124112511300
vlanbatch1310to1311132113311341135114001500160017001800
#//根据需要开启DHCP服务
dhcpenable
#//注释VLAN
vlan99
descriptionLinShi
vlan255
descriptionGuanLli
vlan1000
descriptionUplink
vlan1200
descriptionBanGongLou
vlan1210
descriptionBanGongLou_JiaoShi
vlan1211
descriptionBanGongLou_1F
vlan1221
descriptionBanGongLou_2F
vlan1231
descriptionBanGongLou_3F
vlan1241
descriptionBanGongLou_4F
vlan1251
descriptionBanGongLou_5F
vlan1300
descriptionJiaoXueLou
vlan1310
descriptionJiaoXueLou_JiaoShi
vlan1311
descriptionJiaoXueLou_1F
vlan1321
descriptionJiaoXueLou_2F
vlan1331
descriptionJiaoXueLou_3F
vlan1341
descriptionJiaoXueLou_4F
vlan1351
descriptionJiaoXueLou_5F
vlan1400
descriptionWIFI
vlan1500
descriptionWeiJiShi
vlan1600
descriptionSERVER
vlan1700
descriptionKaoQin
vlan1800
descriptionJianKong
#//增加管理账户
aaa
authentication-schemedefault
authorization-schemedefault
accounting-schemedefault
domaindefault
domaindefault_admin
local-useradminpasswordcipherlylsjy01
local-useradminservice-typehttp
local-userlylsjypasswordcipherlylsjy01
local-userlylsjyprivilegelevel3
local-userlylsjyservice-typetelnethttp
#//网络没有完全划分完成前做了一个临时VLAN,把所有的地址段都放到了这里,可以不影响大家上网。
(网络完成后删除掉)
interfaceVlanif99
descriptionLinShi
ipaddress10.16.200.254255.255.255.0
ipaddress10.16.201.254255.255.255.0sub
ipaddress10.16.202.254255.255.255.0sub
ipaddress10.16.203.254255.255.255.0sub
ipaddress10.16.204.254255.255.255.0sub
ipaddress10.16.206.254255.255.255.0sub
ipaddress10.16.207.254255.255.255.0sub
#//管理地址段
interfaceVlanif255
descriptionGuanLi
ipaddress10.1.1.1255.255.255.0
#//上联地址段
interfaceVlanif1000
descriptionUP_link_JiaoTiJu
ipaddress10.17.254.50255.255.255.252
#//无线覆盖地址段,并开启DHCP(关闭DNS,防止手机上网,后期还有验证功能)
interfaceVlanif1400
descriptionWIFI
ipaddress10.16.205.254255.255.255.128
dhcpselectinterface
dhcpserverexcluded-ip-address10.16.205.23010.16.205.253
#//上联端口上联教体局
interfaceGigabitEthernet1/0/0
portlink-typeaccess
portdefaultvlan1000
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/1
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//服务器测试口调试临时网络的上网信息
interfaceGigabitEthernet1/0/2
portlink-typeaccess
portdefaultvlan99
#//WIFI控制端AC的管理接口
interfaceGigabitEthernet1/0/3
portlink-typeaccess
portdefaultvlan1400
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/4
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/5
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/6
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/7
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/8
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/9
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/10
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/11
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/12
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/13
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/14
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/15
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/16
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/17
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/18
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/19
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/20
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息
interfaceGigabitEthernet1/0/21
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息(并且注释了本口是教学楼的某个交换机)
interfaceGigabitEthernet1/0/22
descriptionJiaoXueLou
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//trunk口透传VLAN信息(并且注释了本口是教学楼的某个交换机)
interfaceGigabitEthernet1/0/23
descriptionJiaoXueLou
portlink-typetrunk
undoporttrunkallow-passvlan1
porttrunkallow-passvlan2to4094
#//静态路由,将学校的地址段路由到上联地址
iproute-static0.0.0.00.0.0.010.17.254.49
#//设置账户的认证模式
user-interfacecon0
user-interfacevty04
authentication-modeaaa
user-interfacevty1620
VLAN地址段分配
VLAN
vlan注释
vlan作用
可用IP段
子网掩码
网关
vlan1000
Uplink
上联
10.17.254.50
255.255.255.252
vlan0255
GuanLli
管理用
10.1.1.1--10.1.1.254
10.16.200.33-10.16.200.61
255.255.255.0
255.255.255.224
10.1.1.1
10.16.200.62
vlan0099
LinShi
临时上网
10.16.200.x—10.16.207.x
255.255.255.0
x
vlan1200
BanGongLou
办公楼
10.16.204.1--10.16.204.61
255.255.255.192
10.16.204.62
vlan1210
BanGongLou_JiaoShi
办公楼教室
10.16.205.1--10.16.205.61
255.255.255.192
10.16.205.62
vlan1211
BanGongLou_1F
办公楼1楼
10.16.204.65--10.16.204.93
255.255.255.224
10.16.204.94
vlan1221
BanGongLou_2F
办公楼2楼
10.16.204.97--10.16.204.125
255.255.255.224
10.16.204.126
vlan1231
BanGongLou_3F
办公楼3楼
10.16.204.129--10.16.204.157
255.255.255.224
10.16.204.158
vlan1241
BanGongLou_4F
办公楼4楼
10.16.204.161--10.16.204.189
255.255.255.224
10.16.204.190
vlan1251
BanGongLou_5F
办公楼5楼
10.16.204.193--10.16.204.221
255.255.255.224
10.16.204.222
vlan1300
JiaoXueLou
教学楼
10.16.206.1--10.16.206.61
255.255.255.192
10.16.206.62
vlan1310
JiaoXueLou_JiaoShi
教学楼教室
10.16.205.65--10.16.205.125
255.255.255.192
10.16.205.126
vlan1311
JiaoXueLou_1F
教学楼1楼
10.16.206.65--10.16.206.125
255.255.255.192
10.16.206.126
vlan1321
JiaoXueLou_2F
教学楼2楼
10.16.206.129--10.16.206.157
255.255.255.224
10.16.206.158
vlan1331
JiaoXueLou_3F
教学楼3楼
10.16.206.161--10.16.206.189
255.255.255.224
10.16.206.190
vlan1341
JiaoXueLou_4F
教学楼4楼
10.16.206.193--10.16.206.221
255.255.255.224
10.16.206.222
vlan1351
JiaoXueLou_5F
教学楼5楼
10.16.206.225--10.16.206.253
255.255.255.224
10.16.206.254
vlan1400
WIFI
无线覆盖
10.16.205.129--10.16.205.253
255.255.255.128
10.16.205.254
vlan1500
WeiJiShi
微机室1
10.16.201.1--10.16.201.125
255.255.255.128
10.16.201.126
微机室2
10.16.201.129--10.16.201.253
255.255.255.128
10.16.201.254
微机室3
10.16.202.1--10.16.202.125
255.255.255.128
10.16.202.126
辅助教室
10.16.202.129--10.16.202.253
255.255.255.128
10.16.202.254
vlan1600
SERVER
服务器
10.16.200.1--10.16.200.30
255.255.255.244
10.16.200.31
vlan1700
KaoQin
考勤
10.16.200.65--10.16.200.93
255.255.255.244
10.16.200.94
vlan1800
JianKong
监控
10.16.200.129--10.16.200.189
255.255.255.192
10.16.200.190
交换机地址及位置
交换机名称
交换机位置
交换机IP
BanGongLou_1F
办公楼1楼
10.1.1.11
BanGongLou_2F
办公楼2楼
10.1.1.12
BanGongLou_3F
办公楼3楼
10.1.1.13
BanGongLou_4F
办公楼4楼
10.1.1.14
BanGongLou_5F
办公楼5楼
10.1.1.15
JiaoXueLou_1F_1
教学楼1楼
10.1.1.16
JiaoXueLou_1F_2
教学楼1楼
10.1.1.17
JiaoXueLou_2F_1
教学楼2楼
10.1.1.18
JiaoXueLou_2F_2
教学楼2楼
10.1.1.19
JiaoXueLou_3F_1
教学楼3楼
10.1.1.20
JiaoXueLou_3F_2
教学楼3楼
10.1.1.21
JiaoXueLou_4F_1
教学楼4楼
10.1.1.22
JiaoXueLou_4F_2
教学楼4楼
10.1.1.23
JiaoXueLou_5F_1
教学楼5楼
10.1.1.24
JiaoXueLou_5F_2
教学楼5楼
10.1.1.25
二层交换机配置部分
#//改三层交换机的名字
sysnameLY15-2326-JiaoXueLou_1F_1
#//开启交换机的FTP服务方便后期备份配置
FTPserverenable
#//划分VLAN
vlanbatch99255100012001210to121112211231124112511300
vlanbatch1310to1311132113311341135114001500160017001800
#//临时使用VLAN(改造完成后需要删除)
vlan99
descriptionLinShi
#//增加管理账户
aaa
authentication-schemedefault
authorization-schemedefault
accounting-schemedefault
domaindefault
domaindefault_admin
local-useradminpasswordcipherlylsjy01
local-useradminservice-typehttp
local-userlylsjypasswordcipherlylsjy01
local-userlylsjyprivilegelevel3
local-userlylsjyservice-typetelnethttp
#//管理地址段
interfaceVlanif255
descriptionGuanLi
ipaddress10.1.1.16255.255.255.0
#//将交换机的1-22口划分为数据口,用来链接各教室和办公室(注意办公和教学的VLAN不能使用一个本配置为学校的教室中有一个备用的网口,教室的前网口使用楼层VLAN方便管理,教室的后网口使用楼VLAN方便后期教室内安装各种监控设备)交换机的23和24口为
interfaceEthernet0/0/1
portlink-typeaccess
portdefaultvlan1310
interfaceEthernet0/0/2
portlink-typeaccess
portdefaultvlan1310
interfaceEthernet0/0/3
portlink-typeaccess
portdefault