做下来觉得比较像是计算机网络的课设,有用的话就点个👍,谢谢您嘞 |
建议先简单了解一下ensp各种设备和简单指令,文章和视频教程都很多就不做推荐了。 文章里包括拓扑图设计、路由设置以及部分关键命令。
开发环境
- ENSP V3【V2也差不多、且更推荐可以识别简化指令的V2】
一、校区互联
实验要求
- 某高校包括3个校区(F校区、X校区、T校区),通过租用运营商的专线实现互联,每个校区均划分为3个网段,包括科研、教学和财务
- 3个校区之间要求互联互通
- T校区财务服务器IP地址为10.0.3.2且仅提供3个校区的财务vlan能够访问,其他vlan不能访问
物理设备
设备 | 数量 | 命名及用途 | 备注 | |
---|---|---|---|---|
AR1220 路由器 |
4 | F | F校区 | 1220型具有交换功能,如用其他型号需在路由器下接交换机实现相应功能 |
X | X校区 | |||
T | T校区 | |||
R | 学校总路由器 | |||
服务器 | 1 | 财务服务器 | 学校内部财务服务器 | 仅财务可访问 |
PC | 9 | F财务 | 代表F校区财务网段 | 每台PC划分一个网段 |
F教学 | 代表F校区教学网段 | |||
F科研 | 代表F校区科研网段 | |||
X财务 | 代表X校区财务网段 | |||
X教学 | 代表X校区教学网段 | |||
X科研 | 代表X校区科研网段 | |||
T财务 | 代表T校区财务网段 | |||
T教学 | 代表T校区教学网段 | |||
T科研 | 代表T校区科研网段 |
拓扑图
- 物理连接与设备基本配置
VLAN配置
- F校区 在F路由器中划分三个vlan; 其中vlan 1的ip为192.168.1.1/24,vlan 2的ip为192.168.2.1/24,vlan3的ip为192.168.3.1/24。
- X校区 在X路由器中划分三个vlan; 其中vlan 1的ip为192.168.4.1/24,vlan 2的ip为192.168.5.1/24,vlan3的ip为192.168.6.1/24。
- T校区 在T路由器中划分三个vlan; 其中vlan 1的ip为192.168.7.1/24,vlan 2的ip为192.168.8.1/24,vlan3的ip为192.168.9.1/24。
路由配置
- F校区
interface Ethernet0/0/2
port link-type access
port default vlan 2 //将教学网段链接至vlan 2
#
interface Ethernet0/0/3
port link-type access
port default vlan 3 //将科研网段链接至vlan 3
#
interface Vlanif1
ip address 192.168.1.1 255.255.255.0 //设置财务网关
#
interface Vlanif2
ip address 192.168.2.1 255.255.255.0 //设置教学网关
#
interface Vlanif3
ip address 192.168.3.1 255.255.255.0 //设置科研网关
#
interface GigabitEthernet0/0/0
ip address 20.0.1.2 255.255.255.0 //配置对外端口ip
#
ip route-static 0.0.0.0 0.0.0.0 20.0.1.1 //配置默认转发下一跳
- X校区
interface Ethernet0/0/2
port link-type access
port default vlan 2 //将教学网段链接至vlan 2
#
interface Ethernet0/0/3
port link-type access
port default vlan 3 //将科研网段链接至vlan 3
#
interface Vlanif1
ip address 192.168.4.1 255.255.255.0 //设置财务网关
#
interface Vlanif2
ip address 192.168.5.1 255.255.255.0 //设置教学网关
#
interface Vlanif3
ip address 192.168.6.1 255.255.255.0 //设置科研网关
#
interface GigabitEthernet0/0/0
ip address 20.0.2.2 255.255.255.0 //配置对外端口ip
#
ip route-static 0.0.0.0 0.0.0.0 20.0.2.1 //配置默认转发下一跳
- T校区
acl number 3000
rule 1 permit ip source 192.168.1.0 0.0.0.255 destination 10.0.3.2 0
rule 2 permit ip source 192.168.4.0 0.0.0.255 destination 10.0.3.2 0
rule 3 permit ip source 192.168.7.0 0.0.0.255 destination 10.0.3.2 0
rule 4 deny ip destination 10.0.3.2 0 //配置ACL规则,限制财务服务器访问
#
interface Ethernet0/0/2
port link-type access
port default vlan 2 //将教学网段链接至vlan 2
#
interface Ethernet0/0/3
port link-type access
port default vlan 3 //将科研网段链接至vlan 3
#
interface Ethernet0/0/4
port link-type access
port default vlan 4 //将服务器网段链接至vlan 4
#
interface Vlanif1
ip address 192.168.7.1 255.255.255.0 //设置财务网关
#
interface Vlanif2
ip address 192.168.8.1 255.255.255.0 //设置教学网关
#
interface Vlanif3
ip address 192.168.9.1 255.255.255.0 //设置科研网关
#
interface Vlanif4
ip address 10.0.3.1 255.255.255.0 //设置服务器网关
#
interface GigabitEthernet0/0/0
ip address 20.0.3.2 255.255.255.0 //配置对外端口ip
traffic-filter outbound acl 3000
traffic-filter inbound acl 3000 //设置ACL规则
#
ip route-static 0.0.0.0 0.0.0.0 20.0.3.1 //配置默认转发下一跳
- R
interface GigabitEthernet2/0/1
ip address 20.0.1.1 255.255.255.0 //配置向F端口ip
#
interface GigabitEthernet2/0/2
ip address 20.0.2.1 255.255.255.0 //配置向X端口ip
#
interface GigabitEthernet2/0/3
ip address 20.0.3.1 255.255.255.0 //配置向T端口ip
#
ip route-static 10.0.3.0 255.255.255.0 20.0.3.2 //服务器
ip route-static 192.168.1.0 255.255.255.0 20.0.1.2
ip route-static 192.168.2.0 255.255.255.0 20.0.1.2
ip route-static 192.168.3.0 255.255.255.0 20.0.1.2 //F
ip route-static 192.168.4.0 255.255.255.0 20.0.2.2
ip route-static 192.168.5.0 255.255.255.0 20.0.2.2
ip route-static 192.168.6.0 255.255.255.0 20.0.2.2 //X
ip route-static 192.168.7.0 255.255.255.0 20.0.3.2
ip route-static 192.168.8.0 255.255.255.0 20.0.3.2
ip route-static 192.168.9.0 255.255.255.0 20.0.3.2 //T
//配置路由转发下一跳
安全策略要求
- 在T路由器中设置ACL规则实现财务服务器限制访问:
acl number 3000
rule 1 permit ip source 192.168.1.0 0.0.0.255 destination 10.0.3.2 0 //允许翡翠湖财务访问
rule 2 permit ip source 192.168.4.0 0.0.0.255 destination 10.0.3.2 0 //允许宣城财务访问
rule 3 permit ip source 192.168.7.0 0.0.0.255 destination 10.0.3.2 0 //允许屯溪路财务访问
rule 4 deny ip destination 10.0.3.2 0 //拒绝其他ip访问
验证
-
三校区互联
- F→X
- F→T
- X→F
- X→T
- T→F
- T→X
- F→X
-
财务服务器限制访问
- 财务访问
- 教学、科研访问
- 财务访问
二、校园网络安全设置
实验要求
- 老校区内部网络分为办公区域和服务器区域
- 办公区域内部IP地址段为192.168.1.0/24
- ISP提供的公网地址为202.102.192.9
- 服务器区域有一台内部文件服务器(内部IP:192.168.0.10),ISP提供的公网IP地址为202.102.192.10
- 新校区IP地址段为200.110.10.0/24
- 未授权用户IP地址段为100.110.10.0/24
- 办公区域用户要求访问互联网
- 内部文件服务器仅对外提供21端口的访问
- 文件服务器仅允许新校区授权IP地址能够访问,非授权IP地址不能访问
物理设备
设备 | 数量 | 命名及用途 | 备注 | |
---|---|---|---|---|
AR1220 路由器 |
5 | Internet | 外网 | 1220型具有交换功能,如用其他型号需在路由器下接交换机实现相应功能 |
Non | 未授权用户 | |||
NEW | 新校区 | |||
OLD | 老校区 | |||
R | 学校总路由器 | |||
|
没啥用可删除,是之前没理清思路加上去的,删除注意修改路由表 | |||
服务器 | 1 | FileSystem | 老校区内部文件服务器 | 仅内网可访问 |
PC | 7 | NEW1 | 新校区PC机 | — |
NEW2 | ||||
NEW3 | 新校区客户机 | |||
OLD1 | 老校区PC机 | |||
OLD2 | 老校区客户机 | |||
CLIENT | 未授权用户客户机 | |||
USER | 未授权用户PC机 |
拓扑图
- 物理连接与设备基本配置
VLAN配置
- 老校区 在OLD路由器中划分两个vlan; 其中vlan 1的ip为192.168.1.1/24,vlan 2的ip为192.168.0.1/24。
路由配置
- Internet(外网)
interface GigabitEthernet0/0/0
ip address 202.102.192.10 255.255.255.0 //配置公网ip
- Non(未授权用户)
ip route-static 0.0.0.0 0.0.0.0 100.110.10.1 //配置默认转发下一跳
#
interface GigabitEthernet0/0/0
ip address 100.110.10.3 255.255.255.0 //配置向外端口ip
nat static global 100.110.10.33 inside 192.168.3.3 netmask 255.255.255.255
nat static enable //配置静态NAT
#
interface GigabitEthernet0/0/1
ip address 192.168.3.1 255.255.255.0 //配置向内端口ip
- NEW(新校区)
interface GigabitEthernet0/0/0
ip address 200.110.10.3 255.255.255.0 //配置向外端口ip
nat static global 200.110.10.33 inside 192.168.10.3 netmask 255.255.255.255
nat static global 200.110.10.44 inside 192.168.10.4 netmask 255.255.255.255
nat static global 200.110.10.55 inside 192.168.10.5 netmask 255.255.255.255
nat static enable //配置静态NAT
#
interface GigabitEthernet0/0/1
ip address 192.168.11.1 255.255.255.0 //配置向内端口ip
#
ip route-static 0.0.0.0 0.0.0.0 200.110.10.1 //向外
ip route-static 192.168.10.0 255.255.255.0 192.168.11.3 //向内
//配置转发下一跳
- OLD(老校区)
acl number 3000
rule 0 permit ip source 192.168.1.0 0.0.0.255 //服务于NAT
acl number 3001
rule 0 permit tcp source 200.110.10.0 0.0.0.255 destination 192.168.0.10 0 destination-port eq ftp
rule 1 permit tcp source 192.168.1.0 0.0.0.255 destination 192.168.0.10 0 destination-port eq ftp
acl number 3002
rule 0 deny icmp
//服务Server,仅提供21端口
//设置ACL规则
#
nat alg ftp enable //开启alg ftp支持
#
interface Vlanif1
ip address 192.168.1.1 255.255.255.0 //配置办公区域网关
#
interface GigabitEthernet2/0/0
ip address 192.168.0.1 255.255.255.0 //配置服务器区域网关
traffic-filter outbound acl 3002
traffic-filter inbound acl 3002 //设置对服务器ACL规则
#
interface GigabitEthernet0/0/0
ip address 200.110.11.3 255.255.255.0 //配置向内网端口ip
traffic-filter inbound acl 3001 //设置对服务器ACL规则
#
interface GigabitEthernet0/0/1
ip address 202.102.192.9 255.255.255.0 //配置向外网端口ip
nat outbound 3000 //配置NAT
#
ip route-static 100.110.10.0 255.255.255.0 200.110.11.1 //未授权用户
ip route-static 200.110.10.0 255.255.255.0 200.110.11.1 //新校区
ip route-static 202.102.192.0 255.255.255.0 202.102.192.10 //访问外网
//配置路由转发下一跳
- R(学校总路由器)
interface GigabitEthernet0/0/1
ip address 100.110.10.1 255.255.255.0 //配置向未授权用户端口ip
#
interface GigabitEthernet2/0/1
ip address 200.110.10.1 255.255.255.0 //配置向新校区端口ip
#
interface GigabitEthernet2/0/2
ip address 200.110.11.1 255.255.255.0 //配置向老校区端口ip
#
ip route-static 100.110.10.0 255.255.255.0 100.110.10.3 //未授权用户
ip route-static 192.168.0.0 255.255.255.0 200.110.11.3 //老校区服务器区域
ip route-static 192.168.1.0 255.255.255.0 200.110.11.3 //老校区办公区域
ip route-static 200.110.10.0 255.255.255.0 200.110.10.3 //新校区
//配置路由转发下一跳
安全策略要求
- 在OLD路由器中设置ACL规则实现内部服务器限制访问:
acl number 3001
rule 0 permit tcp source 200.110.10.0 0.0.0.255 destination 192.168.0.10 0 destination-port eq ftp //允许新校区IP访问服务器,并限制端口
rule 1 permit tcp source 192.168.1.0 0.0.0.255 destination 192.168.0.10 0 destination-port eq ftp //允许老校区IP访问服务器,并限制端口
acl number 3002
rule 0 deny icmp //拒绝ICMP访问
验证
-
新校区与老校区办公区域
- 新校区→老校区办公区域
- 老校区办公区域→新校区
- 新校区→老校区办公区域
-
老校区办公区域访问外网
-
服务器访问
- 新校区→服务器
- 老校区办公区域→服务器
- 未授权用户→服务器
- 新校区→服务器
实现方法并不唯一,文中也并非最优解 欢迎交流讨论与指正 |