中小型校园网网络规划设计
vrrp vrid 1 track interface GigabitEthernet0/0/24 reduced 120//配置与上端联动,发生故障VRRP的优先级下降120变成60。核心交换机1与2运行VRRP双机热备,使用双链路端口聚合连接,与防火墙运行OSPF,汇聚运行MSTP与VLAN Trunk。interface GigabitEthernet0/0/1//进入端口g0/0/1。in
某实验中学需要组建校园网,学校有教学楼、办公楼、实验楼、图书馆、食堂与宿舍等区域,现需要将他们相互连接组建成一套校园网网络,彼此之间可以相互访问,实现资源共享,可访问校园网数据中心服务器,还可以访问互联网进行学习办公。
根据学校整体划分成核心层、汇聚层与接入层。核心层采用双机热备,汇聚层通过双链路链接到主备核心。学校内部互联网之间通过出口路由器进行连接,核心与出口路由之间部署一台防火墙做网络安全防御。具体网络拓扑规划如下:

图2-1 网络规划拓扑图
- 核心层采用主备核心做双机热备,设计在主备核心之间使用VRRP热备份路由协议,主备之间使用二条物理链路连接,使用端口聚合协议将二个物理端口聚合成一个逻辑端口,提高网络链路稳定性。
- 汇聚层使用二条物理链路分别连接到主备核心交换机,通过VLAN Trunk协议进行相互通信。为防止网络产生环路,设计使用MSTP生成树协议。
- 接入层与汇聚层之间运行二层架构,通过VLAN Trunk协议进行相互通信。教学楼、办公楼等不同区域使用不同VLAN做逻辑隔离。
- 核心层与防火墙、路由器之间使用OSPF动态路由协议。出口路由器上配置默认路由访问互联网,再使用路由重分发技术,将默认路由引入到OSPF协议中。
- 路由器上使用NAT地址转换技术,让学校内网私有IP地址通过路由器连接电信运营商外网接口的公网IP地址做NAT地址转换访问互联网。
- 使用防火墙划将学校划分成Trust与untrust区域,学校内部为trust区域,外部互联网为untrust区域,配置允许学校内部访问互联网,禁止互联网访问校园网内部,保障网络信息安全。
- 学校无线网络采用AC+AP方式进行安装部署,所有无线AP由AC控制器进行统一控制管理,释放同一个SSID无线网络信号,在学校内部无线网络在不同AP之间可以自动漫游。
根据学校规模,规划在藤县实验中学使用172.16.0.0/16的IP网段,再划分子网,每个子网使用最后一个IP地址作为本网段的通信网关。IP地址具体规划如下:
藤县实验中学业务IP地址规划:
|
序号 |
名称 |
IP |
子网掩码 |
VLAN |
网关 |
备注 |
|
1 |
教学楼 |
172.16.1.0 |
255.255.255.0 |
1 |
172.16.1.254 |
|
|
2 |
办公楼 |
172.16.2.0 |
255.255.255.0 |
2 |
172.16.2.254 |
|
|
3 |
实训楼 |
172.16.3.0 |
255.255.255.0 |
3 |
172.16.3.254 |
|
|
4 |
图书馆 |
172.16.4.0 |
255.255.255.0 |
4 |
172.16.4.254 |
|
|
5 |
食堂 |
172.16.5.0 |
255.255.255.0 |
5 |
172.16.5.254 |
|
|
6 |
宿舍 |
172.16.6.0 |
255.255.255.0 |
6 |
172.16.6.254 |
|
|
7 |
无线网络 |
172.16.7.0 |
255.255.255.0 |
8 |
172.16.7.254 |
|
|
8 |
数据中心 |
172.16.100.0 |
255.255.255.0 |
100 |
172.16.100.254 |
根据学校网络拓扑,技术协议规划,使用华为ENSP模拟器对该学校网络进行模拟仿真配置,各个网络设备具体配置如下:
- 配置路由器接口IP地址
sysname AR1 //修改设备名称
interface GigabitEthernet0/0/1 //进入端口g0/0/1
ip address 8.8.8.2 255.255.255.0 //配置接口IP
quit //退出
interface GigabitEthernet0/0/0
ip address 172.16.200.5 255.255.255.252
quit
- 配置静态路由指向互联网,发布内网OSPF路由
ip route-static 0.0.0.0 0 8.8.8.1 //配置默认路由
ospf 1 //创建OSPF进程1并进入配置模式
area 0.0.0.0 //配置区域为0
network 172.16.200.0 0.0.0.3 //发布路由网段
- 配置ACL允许所有IP通过路由器NAT访问外网
acl number 3001 //创建高级ACL3001
rule 1 permit ip //创建策略1,允许所有IP
quit
interface GigabitEthernet0/0/1 //进入端口G0/0/1
nat outbound 3001 //将ACL3001中策略匹配的IP做NAT转换
quit
防火墙主要用户校园网内部网络安全防御,允许内部访问外部,禁止互联网访问校园网,与其它设备之间运行OSPF路由协议。
- 配置内外网IP地址
interface GigabitEthernet1/0/1 //进入端口g1/0/0
ip address 172.16.200.2 255.255.255.252 //配置接口IP
quit
interface GigabitEthernet1/0/1
ip address 172.16.200.5 255.255.255.252
service-manage all permit
quit
interface GigabitEthernet1/0/2
undo shutdown
ip address 172.16.200.9 255.255.255.252
service-manage all permit
quit
quit
- 配置安全区域,将相应端口加入进去
firewall zone trust //创建内部区域trust
add interface GigabitEthernet1/0/2 //将端口1/0/2加入
add interface GigabitEthernet1/0/3 //将端口1/0/3加入
quit
firewall zone untrust //创建外部区域untrust
add interface GigabitEthernet1/0/1
quit
- 配置路由,默认路由与OSPF路由
ospf 1
area 0.0.0.0
network 172.16.200.4 0.0.0.3
network 172.16.200.8 0.0.0.3
network 172.16.200.0 0.0.0.3
quit
quit
- 配置安全策略,允许内网访问外网
security-policy //进入安全策略配置模式
rule name 1 //创建安全规则1
source-zone trust //源区域为内部
destination-zone untrust //目的区域为外部
action permit //允许访问
quit
quit
核心交换机1与2运行VRRP双机热备,使用双链路端口聚合连接,与防火墙运行OSPF,汇聚运行MSTP与VLAN Trunk。
- 修改交换机命明,配置VLAN,MSTP,将核心主配置为STP的根桥。
sysname Core1
vlan batch 2 to 7 100 //创建业务VLAN
stp region-configuration //进入STP配置模式
instance 1 vlan 1 to 7 //创建实例1,将VLAN加入
active region-configuration //激活STP配置
stp instance 1 root primary //配置为根桥
- 配置VLAN接口IP,其中VLAN200用于OSPF路由接口。VRRP配置与上联口联动,当上联口Down时,优先级降低120变成60
Vlan 200 //创建路由接口VLAN
quit
interface Vlanif200 //创建VLANIF200
ip address 172.16.200.6 255.255.255.252 //配置接口IP
quit
interface GigabitEthernet0/0/24 //进入端口G0/0/24
port link-type access //配置成ACCESS模式
port default vlan 200 //将端口加入到VLAN200
quit
interface Vlanif1 //创建业务VLANIF1
ip address 172.16.1.252 255.255.255.0 //配置接口IP
vrrp vrid 1 virtual-ip 172.16.1.254 //配置VRRP虚拟IP
vrrp vrid 1 priority 180 //配置VRRP的优先级为180
vrrp vrid 1 track interface GigabitEthernet0/0/24 reduced 120 //配置与上端联动,发生故障VRRP的优先级下降120变成60
quit
interface Vlanif2
ip address 172.16.2.252 255.255.255.0
vrrp vrid 2 virtual-ip 172.16.2.254
vrrp vrid 2 priority 180
vrrp vrid 2 track interface GigabitEthernet0/0/24 reduced 120
quit
interface Vlanif3
ip address 172.16.3.252 255.255.255.0
vrrp vrid 3 virtual-ip 172.16.3.254
vrrp vrid 3 priority 180
vrrp vrid 3 track interface GigabitEthernet0/0/24 reduced 120
quit
interface Vlanif4
ip address 172.16.4.252 255.255.255.0
vrrp vrid 4 virtual-ip 172.16.4.254
vrrp vrid 4 priority 180
vrrp vrid 4 track interface GigabitEthernet0/0/24 reduced 120
quit
interface Vlanif5
ip address 172.16.5.252 255.255.255.0
vrrp vrid 5 virtual-ip 172.16.5.254
vrrp vrid 5 priority 180
vrrp vrid 5 track interface GigabitEthernet0/0/24 reduced 120
quit
interface Vlanif6
ip address 172.16.6.252 255.255.255.0
vrrp vrid 6 virtual-ip 172.16.6.254
vrrp vrid 6 priority 180
vrrp vrid 6 track interface GigabitEthernet0/0/24 reduced 120
quit
interface Vlanif7
ip address 172.16.7.252 255.255.255.0
vrrp vrid 7 virtual-ip 172.16.7.254
vrrp vrid 7 priority 180
vrrp vrid 7 track interface GigabitEthernet0/0/24 reduced 120
quit
interface Vlanif100
ip address 172.16.100.252 255.255.255.0
vrrp vrid 100 virtual-ip 172.16.100.254
vrrp vrid 100 priority 180
vrrp vrid 100 track interface GigabitEthernet0/0/24 reduced 120
quit
- 发布OSPF路由网段,配置默认路由
ospf 1
area 0.0.0.0
network 172.16.200.4 0.0.0.3
network 172.16.1.0 0.0.0.255
network 172.16.2.0 0.0.0.255
network 172.16.3.0 0.0.0.255
network 172.16.4.0 0.0.0.255
network 172.16.5.0 0.0.0.255
network 172.16.6.0 0.0.0.255
network 172.16.7.0 0.0.0.255
network 172.16.100.0 0.0.0.255
quit
quit
- 开启DHCP服务,配置无线使用的两个网段使用DHCP可以自动获取IP,排除网段中250-253这三个IP地址不做DHCP分配。
dhcp enable //开启DHCP服务
ip pool vlan7 //创建地址池7
gateway-list 172.16.7.254 //配置网关
network 172.16.7.0 mask 255.255.255.0 //配置分配网段
dns-list 114.114.114.114 8.8.8.8 //配置分配DNS
excluded-ip-address 172.16.7.250 172.16.7.253 //排除250-253不做分配
quit
interface Vlanif7 //进入VLANFI7
dhcp select global //选择为全局地址池。
quit
- 配置端口聚合,主备核心使用21与22口捆绑成一个聚合口,并配置成Trunk模式,允许相应VLAN通过。
interface Eth-Trunk1 //创建聚合组1
port link-type trunk //配置成Trunk模式
port trunk allow-pass vlan 1 to 7 100 //允许VLAN通过
quit
interface GigabitEthernet0/0/21 //进入端口21
eth-trunk 1 //加入到聚合组1
quit
interface GigabitEthernet0/0/22
eth-trunk 1
quit
- 配置与下联交换机的级联口为Trunk模式,并允许VLAN通过。
port-group 1 //创建端口组1
group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/10 //将端口1-10加入
port link-type trunk //配置成Trunk
port trunk allow-pass vlan 2 to 7 100 //允许VLAN通过
quit
核心交换机备配置流程方法与核心主一致,按照实际情况修改IP地址、VRRP优先级,MSTP生成树与发布路由。
- 修改设备名称,创建VLAN,配置MSTP
sysname Core2
vlan 200
vlan 100
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
stp instance 1 root secondary
- 配置VLAN接口IP,VRRP等,VRRP的优先级低于核心1
interface Vlanif200
ip address 172.16.200.10 255.255.255.252
quit
interface GigabitEthernet0/0/24
port link-type access
port default vlan 200
quit
interface Vlanif1
ip address 172.16.1.253 255.255.255.0
vrrp vrid 1 virtual-ip 172.16.1.254
vrrp vrid 1 priority 80
quit
interface Vlanif2
ip address 172.16.2.253 255.255.255.0
vrrp vrid 2 virtual-ip 172.16.2.254
vrrp vrid 2 priority 80
quit
interface Vlanif3
ip address 172.16.3.253 255.255.255.0
vrrp vrid 3 virtual-ip 172.16.3.254
vrrp vrid 3 priority 80
quit
interface Vlanif4
ip address 172.16.4.253 255.255.255.0
vrrp vrid 4 virtual-ip 172.16.4.254
vrrp vrid 4 priority 80
quit
interface Vlanif5
ip address 172.16.5.253 255.255.255.0
vrrp vrid 5 virtual-ip 172.16.5.254
vrrp vrid 5 priority 80
quit
interface Vlanif6
ip address 172.16.6.253 255.255.255.0
vrrp vrid 6 virtual-ip 172.16.6.254
vrrp vrid 6 priority 80
quit
interface Vlanif7
ip address 172.16.7.253 255.255.255.0
vrrp vrid 7 virtual-ip 172.16.7.254
vrrp vrid 7 priority 80
quit
interface Vlanif100
ip address 172.16.100.253 255.255.255.0
vrrp vrid 100 virtual-ip 172.16.100.254
vrrp vrid 100 priority 80
quit
- 配置OSPF路由协议,默认路由协议
ospf 1
area 0.0.0.0
network 172.16.200.8 0.0.0.3
network 172.16.1.0 0.0.0.255
network 172.16.2.0 0.0.0.255
network 172.16.3.0 0.0.0.255
network 172.16.4.0 0.0.0.255
network 172.16.5.0 0.0.0.255
network 172.16.6.0 0.0.0.255
network 172.16.7.0 0.0.0.255
network 172.16.100.0 0.0.0.255
quit
quit
ip route-static 0.0.0.0 0.0.0.0 172.16.200.5
- 配置DHCP地址池,在接口上应用
dhcp enable
ip pool vlan7
gateway-list 172.16.7.254
network 172.16.7.0 mask 255.255.255.0
dns-list 114.114.114.114 8.8.8.8
excluded-ip-address 172.16.7.250 172.16.7.253
quit
interface Vlanif7
dhcp select global
quit
- 配置端口聚合,级联端口Trunk
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 1 to 7 100
quit
interface GigabitEthernet0/0/21
eth-trunk 1
quit
interface GigabitEthernet0/0/22
eth-trunk 1
quit
port-group 1
group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/10
port link-type trunk
port trunk allow-pass vlan 2 to 7 100
quit
汇聚交换机用于接入交换机级联汇聚使用,所有端口配置为Trunk模式。各个汇聚交换机配置都一样。
配置命令:
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
quit
port-group 1
group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/24
port link-type trunk
port trunk allow-pass vlan all
quit
-
服务器接入
数据中心交换机用于服务器的网络接入使用,与主备核心运行Trunk模式,连接服务器使用ACCESS模式。
vlan 100
quit
stp region-configuration
instance 1 vlan 100
active region-configuration
quit
interface GigabitEthernet0/0/24
port link-type trunk
port trunk allow-pass vlan all
quit
interface GigabitEthernet0/0/23
port link-type trunk
port trunk allow-pass vlan all
quit
port-group 1
group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/20
port link-type access
port default vlan 100
quit
终端设备接入交换机连接客户端配置成ACCESS模式,连接上端汇聚为Trunk模式,各个接入交换机配置原理一样,加入到不同VLAN中。连接AP的端口配置PVID VLAN为7
- 教学楼
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
quit
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet0/0/1
port link-type access
port default vlan 1
quit
interface Ethernet0/0/2 //进入端口2
port link-type trunk //配置Trunk模式
port trunk allow-pass vlan all //允许VLAN通过
port trunk pvid vlan 7 //配置PVID的VLAN ID 为7
quit
- 办公楼
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
quit
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet0/0/1
port link-type access
port default vlan 2
quit
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
port trunk pvid vlan 7
quit
- 实训楼
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
quit
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet0/0/1
port link-type access
port default vlan 3
quit
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
port trunk pvid vlan 7
quit
- 图书馆
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
quit
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet0/0/1
port link-type access
port default vlan 4
quit
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
port trunk pvid vlan 7
quit
- 食堂
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
quit
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet0/0/1
port link-type access
port default vlan 5
quit
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
port trunk pvid vlan 7
quit
- 宿舍
vlan batch 2 to 7
stp region-configuration
instance 1 vlan 1 to 7
active region-configuration
quit
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet0/0/1
port link-type access
port default vlan 6
quit
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
port trunk pvid vlan 7
quit
1)教学楼访问数据中心


DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐


所有评论(0)