网络工程综合实验

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

课程设计报告
设计名称:网络工程综合实验
系(院):计算机科学学院
专业班级:
姓名:陈浩
学号:
指导教师:邱林陈中举
设计时间:2013.12.16 - 2010.12.27
设计地点:4#网络工程实验室
一、课程设计目的
网络工程综合实验是网络工程及计算机相关专业的重要实践环节之一,该内容可以培养学生理论联系实际的设计思想,训练综合运用所学的计算机网络基础理论知识,结合实际网络设备,解决在设计、安装、调试网络中所遇到的问题,从而使基础理论知识得到巩固和加深。

学生通过综合实验学习掌握网络设计中的一般设计过程和方法,熟悉并掌握运用二层交换机、三层交换机、路由器和防火墙的配置技术。

另外通过实验,可以掌握组建计算机网络工程的基本技术,特别是网络规划、交换机路由器等网络设备的基本功能与选型以及网络应用服务器的基本配置
,同时提高学生的应用能力和动手实践能力。

二、课程设计要求
(1)通过资料查阅和学习,了解园区网络规划、设计的一般方法。

(2)参考和研究一些公司和高校/企业园区网的规划和建设方案,结合《网络工程》课程中所学知识,积极完成设计任务。

(3)认真完成需求分析,并根据需求分析完成园区网络的总体方案设计,确定网络逻辑拓扑结构和所采用的网络技术、主要设备的性能指标,进而完成设备的选型,并选用相应的网络连接技术。

(4)根据设计内容与具体要求,实现园区网内的连接,并在成功测试的基础上实现Web服务器、FTP服务器、电子邮件服务器的安装配置,并能按任务书要求进行访问。

(5)认真按时完成课程设计报告,课程设计报告内容包括:课程设计目的、设计任务与要求、需求分析、网络设计、设备调试安装以及设计心得等几个部分,具体要求见设计报告模板。

三、课程设计内容
用一组实验设备(4个路由器、二台交换机、二台三层交换机、一台防火墙)构建一个园区网,通过防火墙与校园网相联,实现到Internet的访问。

具体要求如下:
(1)在一台两层交换机SW1上划分2个VLAN(Vlan 100和Vlan 200,用户数均为100)。

要求实现:两个Vlan均能通过路由器访问外网,但两个Vlan之间不能通信。

(2)在一台三层交换机SW3上划分2个VLAN(Vlan 300和Vlan 400,Vlan300用户数100,Vlan400用户数200),两个Vlan之间能够通信。

要求:两个Vlan均只能通过路由器访问校园网(10.X.X.X),而不能访问Internet。

(3)另外一台两层交换机SW2和一台三层交换机SW4之间使用冗余连接,在两台交换机上均划分两个Vlan(Vlan 500和Vlan 600,Vlan500用户数200,Vlan600用户数100),要求Vlan500可以访问内网所有VLAN,Vlan600既可以访问内网,又可以访问Internet。

(4)园区网全网通信采用OSPF动态路由协议,路由设计要求有路由汇聚。

(5)SW1 、SW3、SW4分别和三台接入级路由器DCR1700相连,三台路由器和部门级路由器DCR2600相连。

然后DCR2600路由器通过防火墙实现此园区网与外网(校园网)相联,要求内网通过防火墙上配置NAT协议访问外网。

(6)画出网络拓扑图,并给各VLAN划分IP地址、掩码、网关,以及各网络设备接口的IP地址。

(7)需要在SW1中的VLAN100里面安装WWW、FTP、电子邮件等基本服务。

用访问控制列表使VLAN300和VLAN500中的用户在上班时间(9:00~17:00)不允许访问FTP 服务器和WWW服务器,但可以访问EMail 服务器。

(8)IP分配规则:根据以上需求设计IP地址。

(9)IP分配规则根据实验室分区划分):
A区:
IP范围:192.168.0.0 -192.168.7.255
192.168.254.0-192.168.254.15 ( 路由器Serial口用)
202.103.0.11(防火墙连互联网用IP)
10.206.207.11 (防火墙连校园网用IP)
B区:
IP范围:192.168.8.0 -192.168.15.255
192.168.254.16-192.168.254.31( 路由器Serial口用)
202.103.0.12(防火墙连互联网用IP)
10.206.207.12 (防火墙连校园网用IP)
C区:
IP范围:192.168.16.0 -192.168.23.255
192.168.254.32-192.168.254.47 ( 路由器Serial口用)
202.103.0.13(防火墙连互联网用IP)
10.206.207.13 (防火墙连校园网用IP)
D区:
IP范围:192.168.24.0 -192.168.31.255
192.168.254.48-192.168.254.63 ( 路由器Serial口用)
202.103.0.14(防火墙连互联网用IP)
10.206.207.14 (防火墙连校园网用IP)
E区:
IP范围:192.168.32.0 -192.168.39.255
192.168.254.64-192.168.254.79 ( 路由器Serial口用)
202.103.0.15(防火墙连互联网用IP)
10.206.207.15(防火墙连校园网用IP)
F区:
IP范围:192.168.40.0 -192.168.47.255
192.168.254.80-192.168.254.95 ( 路由器Serial口用)
202.103.0.16(防火墙连互联网用IP)
10.206.207.16 (防火墙连校园网用IP)
总体设计:
试验拓扑:
试验步骤:
1 单臂路由:
在交换机9上划分vlan100和vlan200,分别划分端口到两个vlan中,将f0/24口设置为trunk与R4的f0/0口相连
SW10009(config)#vlan 100 //创建vlan100
SW10009(config-vlan)#ex
SW10009(config)#vlan 200 //创建vlan200
SW10009(config-vlan)#ex
SW10009(config)#interface range f0/1-4
SW10009(config-if-range)#switchport access vlan 100 //将端口f0/1-4划归到vlan200中SW10009(config-if-range)#ex
SW10009(config)#interface range f0/5-8
SW10009(config-if-range)#switchport access vlan 200 //将端口f0/5-8划归到vlan200中SW10009(config-if-range)#exit
SW10009(config)#int f0/24
SW10009(config-if)#switchport mode trunk //将接口设置trunk
SW10009(config-if)#switchport trunk allowed vlan all //设置trunk允许所有vlan通过
SW10009(config-if)#
在R4接口f0/0上划分子端口,f0/0.1和vlan100关联,f0/0.2和vlan200关联
R10004(config)#interface f0/0
R10004 (config-if)#no shutdown //开启端口f0/0
R10004 (config-if)#int f0/0.1
R10004 (config-subif)#ip address 192.168.1.1 255.255.255.128 //在子端口f0/0.1上设置IP地址R10004 (config-subif)#encapsulation dot1Q 100 //将子端口和交换机的vlan100相关联注意:dot1Q后面接的数字一定要跟交换机中vlan号对应
R10004 (config-subif)#int f0/0.2 //在子端口f0/0.2上同理
R10004 (config-subif)#ip address 192.168.1.129 255.255.255.128
R10004 (config-subif)#encapsulation dot1Q 200
R10004 (config-subif)#
设置一台主机AIP地址为192.168.1.11/25 网关为192.168.1.1 接在交换机的vlan100上另一台主机BIP地址为192.168.1.139/25 网关为192.168.1.129 接在交换机的vlan200上用主机A ping的结果
PC>ping 192.168.1.1 可以ping通f0/0.1,也就是vlan100和f0/0.1相关联Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=94ms TTL=255
Reply from 192.168.1.1: bytes=32 time=49ms TTL=255
Reply from 192.168.1.1: bytes=32 time=62ms TTL=255
Reply from 192.168.1.1: bytes=32 time=33ms TTL=255
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 33ms, Maximum = 94ms, Average = 59ms
PC>ping 192.168.1.129 可以ping通f0/0.2
Pinging 192.168.1.129 with 32 bytes of data:
Reply from 192.168.1.129: bytes=32 time=31ms TTL=255
Reply from 192.168.1.129: bytes=32 time=62ms TTL=255
Reply from 192.168.1.129: bytes=32 time=49ms TTL=255
Reply from 192.168.1.129: bytes=32 time=62ms TTL=255
Ping statistics for 192.168.1.129:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 31ms, Maximum = 62ms, Average = 51ms
PC>ping 192.168.1.139 可以ping通vlan200上的主机,也就是vlan200和f0/0.2相关联Pinging 192.168.1.139 with 32 bytes of data:
Reply from 192.168.1.139: bytes=32 time=109ms TTL=127
Reply from 192.168.1.139: bytes=32 time=109ms TTL=127
Reply from 192.168.1.139: bytes=32 time=109ms TTL=127
Reply from 192.168.1.139: bytes=32 time=64ms TTL=127
Ping statistics for 192.168.1.139:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 64ms, Maximum = 109ms, Average = 97ms
此时单臂路由成功
2.三层交换机和路由器相连
用到两种方式,一种是在三层交换机上划分两个vlan300和vlan400,分别分配IP,将属于vlan300的接口与路由器相连
一种是在三层交换机上划分两个vlan500和vlan600,分别分配IP,另外给默认的vlan1也分配IP地址,将属于vlan1的接口与路由器相连
方法一:
用交换机SW7和R6实现
SW10007(config)#vlan 300 //创建vlan300
SW10007 (config-vlan)#ex
SW10007 (config)#vlan 400 //创建vlan400
SW10007 (config-vlan)#ex
SW10007 (config)#int range f0/1-4
SW10007 (config-if-range)#switchport access vlan 300 //将端口f0/1-4划归到vlan300中
SW10007 (config-if-range)#ex
SW10007 (config)#int range f0/5-8
SW10007 (config-if-range)#switchport access vlan 400 //将端口f0/1-4划归到vlan400中
SW10007 (config-if-range)#ex
SW10007 (config)#int f0/24
SW10007 (config-if)#switchport access vlan 300 //将端口f0/24划归到vlan300中
SW10007 (config-if)#ex
SW10007 (config)#int vlan 300 //进入vlan接口配置模式
SW10007 (config-if)#ip address 192.168.2.2 255.255.255.0 //分配IP
SW10007 (config-if)#no shutdown
SW10007 (config-if)#ex
SW10007 (config)#int vlan 400 //vlan400同理
SW10007 (config-if)#ip address 192.168.3.1 255.255.255.0
SW10007 (config-if)#no shutdown
SW10007 (config-if)#ex
SW10007 (config)#ip routing //开启三层交换机路由功能
SW10007 (config)#
此时三层交换机两个vlan可以相互通信
配置一台主机C 地址192.168.2.11/24 网关192.168.2.2 //vlan300的地址
配置一台主机D 地址192.168.3.11/24 网关192.168.3.1 //vlan400的地址
用主机C ping的结果
PC>ping 192.168.2.2可以ping通vlan300,也就是网关
Pinging 192.168.2.2 with 32 bytes of data:
Reply from 192.168.2.2: bytes=32 time=47ms TTL=255
Reply from 192.168.2.2: bytes=32 time=31ms TTL=255
Reply from 192.168.2.2: bytes=32 time=15ms TTL=255
Reply from 192.168.2.2: bytes=32 time=32ms TTL=255
Ping statistics for 192.168.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 47ms, Average = 31ms
PC>ping 192.168.3.1 可以ping通vlan400,也就是三层交换机内部两个vlan可以相互通信Pinging 192.168.3.1 with 32 bytes of data:
Reply from 192.168.3.1: bytes=32 time=18ms TTL=255
Reply from 192.168.3.1: bytes=32 time=31ms TTL=255
Reply from 192.168.3.1: bytes=32 time=18ms TTL=255
Reply from 192.168.3.1: bytes=32 time=31ms TTL=255
Ping statistics for 192.168.3.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 18ms, Maximum = 31ms, Average = 24ms
PC>ping 192.168.3.11 可以ping通主机D
Pinging 192.168.3.11 with 32 bytes of data:
Reply from 192.168.3.11: bytes=32 time=62ms TTL=127
Reply from 192.168.3.11: bytes=32 time=62ms TTL=127
Reply from 192.168.3.11: bytes=32 time=47ms TTL=127
Reply from 192.168.3.11: bytes=32 time=62ms TTL=127
Ping statistics for 192.168.3.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 47ms, Maximum = 62ms, Average = 58ms
连通路由器和交换机的命令
R10006(config)#int f0/0
R10006 (config-if)#ip address 192.168.2.1 255.255.255.0
R10006 (config-if)#no shutdown
R10006 (config-if)#ex
R10006 (config)#router ospf 1 /在路由器R6上配置OSPF协议
R10006 (config-router)#network 192.168.2.0 255.255.255.0 area 2 //声明网段和区域,拓扑图给出
R10006 (config-router)#
SW10007 (config)#router ospf 1 //在交换机SW7上配置OSPF协议
SW10007 (config-router)#network 192.168.2.0 255.255.255.0 area 2 //声明网段和区域
SW10007 (config-router)#network 192.168.3.0 255.255.255.0 area 2 //声明网段和区域
SW10007 (config-router)#
此时主机C和主机D都可以pingt通R6的f0/0接口
R10006#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.2.0/24 is directly connected, FastEthernet0/0
O 192.168.3.0/24 [110/2] via 192.168.2.2, 00:50:20, FastEthernet0/0
路由表中有R6学习交换机vlan400的路由
方法二
用交换机SW8和R5
SW10008(config)#vlan 500 //创建vlan500
SW10008 (config-vlan)#ex
SW10008(config)#vlan 600 //创建vlan600
SW10008 (config-vlan)#ex
SW10008 (config)#int range f0/1-4
SW10008(config-if-range)#switchport access vlan 500 //将端口f0/1-4划归到vlan500中SW10008 (config-if-range)#ex
SW10008 (config)#int range f0/5-8
SW10008(config-if-range)#switchport access vlan 600 //将端口f0/1-4划归到vlan600中SW10008 (config-if-range)#ex
SW10008 (config)#int f0/24
SW10008(config-if)#switchport access vlan 1 //将端口f0/24划归到vlan1中SW10008 (config-if)#ex
SW10008 (config)#int vlan 500 //进入vlan接口配置模式
SW10008 (config-if)#ip address 192.168.7.1 255.255.255.0 //分配IP
SW10008 (config-if)#no shutdown
SW10008 (config-if)#ex
SW10008 (config)#int vlan 600 //vlan400同理
SW10008(config-if)#ip address 192.168.6.1 255.255.255.0
SW10008 (config-if)#no shutdown
SW10008 (config)#int vlan 1 //vlan1同理
SW10008(config-if)#ip address 192.168.4.2 255.255.255.0
SW10008 (config-if)#no shutdown
SW10008 (config-if)#ex
SW10008 (config)#ip routing //开启三层交换机路由功能
SW10008 (config)#
此时SW10008中的vlan500,vlan600和vlan1 之间都是互通的
主机E 192.168.7.11/24 网关192.168.7.1 //vlan500IP地址
主机F 192.168.6.11/24 网关192.168.6.1 //vlan600IP地址
主机E ping结果
PC>ping 192.168.7.1
Pinging 192.168.7.1 with 32 bytes of data:
Reply from 192.168.7.1: bytes=32 time=63ms TTL=255 Reply from 192.168.7.1: bytes=32 time=32ms TTL=255 Reply from 192.168.7.1: bytes=32 time=13ms TTL=255 Reply from 192.168.7.1: bytes=32 time=31ms TTL=255 Ping statistics for 192.168.7.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 13ms, Maximum = 63ms, Average = 34ms PC>ping 192.168.6.1
Pinging 192.168.6.1 with 32 bytes of data:
Reply from 192.168.6.1: bytes=32 time=17ms TTL=255 Reply from 192.168.6.1: bytes=32 time=16ms TTL=255 Reply from 192.168.6.1: bytes=32 time=15ms TTL=255 Reply from 192.168.6.1: bytes=32 time=32ms TTL=255 Ping statistics for 192.168.6.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 32ms, Average = 20ms PC>ping 192.168.4.1
Pinging 192.168.4.1 with 32 bytes of data:
Reply from 192.168.4.1: bytes=32 time=31ms TTL=254 Reply from 192.168.4.1: bytes=32 time=63ms TTL=254 Reply from 192.168.4.1: bytes=32 time=63ms TTL=254 Reply from 192.168.4.1: bytes=32 time=63ms TTL=254 Ping statistics for 192.168.4.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 31ms, Maximum = 63ms, Average = 55ms PC>ping 192.168.6.11
Pinging 192.168.6.11 with 32 bytes of data:
Reply from 192.168.6.11: bytes=32 time=46ms TTL=127
Reply from 192.168.6.11: bytes=32 time=63ms TTL=127
Reply from 192.168.6.11: bytes=32 time=63ms TTL=127
Reply from 192.168.6.11: bytes=32 time=30ms TTL=127
Ping statistics for 192.168.6.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 30ms, Maximum = 63ms, Average = 50ms
连通路由器和交换机的命令
R10005(config)#int f0/0
R10005 (config-if)#ip address 192.168.4.1 255.255.255.0
R10005 (config-if)#no shutdown
R10005 (config-if)#ex
R10005 (config)#router ospf 1
R10005 (config-router)#network 192.168.4.0 255.255.255.0 area 3
R10005 (config-router)#
SW10008#conf
SW10008 (config)#router ospf 1
SW10008 (config-router)#network 192.168.4.0 255.255.255.0 area 3
SW10008 (config-router)#network 192.168.6.0 255.255.255.0 area 3
SW10008 (config-router)#network 192.168.7.0 255.255.255.0 area 3
SW10008 (config-router)#
R10005 #show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.4.0/24 is directly connected, FastEthernet0/0
O 192.168.6.0/24 [110/2] via 192.168.4.2, 00:13:55, FastEthernet0/0
O 192.168.7.0/24 [110/2] via 192.168.4.2, 00:13:55, FastEthernet0/0
路由表中有R5学习交换机vlan500和vlan600的路由
此时三个边缘区域已经成功创建,开始创建骨干区域
骨干区域通过R1分别连接R4,R5,R6
R10005(config)#int s2/0
R10005 (config-if)#clock rate 9600
注意:Seral口在链路上是up,但是在协议上是down,那就是缺少这条命令,声明速率。

在神码实验室中是physical-layer speed 9600
R10005 (config-if)#no shutdown
R10005 (config-if)#ip address 192.168.254.10 255.255.255.252 //注意子网掩码,30位
R10005 (config-if)#ex
R10005 (config)#router ospf 1
R10005 (config-router)#network 192.168.254.10 255.255.255.252 area 0 //声明区域0——骨干区域
R10005 (config-router)#network 192.168.4.0 255.255.255.0 area 3 //声明区域3
R10006 (config)#int s3/0
R10006 (config-if)#no shutdown
R10006 (config-if)#clock rate 9600
R10006 (config-if)#ip address 192.168.254.2 255.255.255.252 //注意子网掩码,30位
R10006 (config-if)#ex
R10006 (config)#router ospf 1
R10006 (config-router)#network 192.168.254.0 255.255.255.252 area 0 //声明区域0——骨干区域
R10006 (config-router)#network 192.168.2.0 255.255.255.0 area 2 //声明区域2
R10004 (config)#int s2/0
R10004 (config-if)#no shutdown
R10004 (config-if)#clock rate 9600
R10004 (config-if)#ip address 192.168.254.6 255.255.255.252 //注意子网掩码,30位
R10004 (config-if)#ex
R10004 (config)#router ospf 1
R10004 (config-router)#network 192.168.254.4 255.255.255.252 area 0 //声明区域0——骨干区域
R10004 (config-router)#network 192.168.1.0 255.255.255.128 area 1 //声明区域1
R10004 (config-router)#network 192.168.1.128 255.255.255.128 area 1 //声明区域1
R10001 (config)#int s2/0
R10001 (config-if)#no shutdown
R10001 (config-if)#clock rate 9600
R10001 (config-if)#ip address 192.168.254.9 255.255.255.252 //注意子网掩码,30位
R10001 (config)#int s3/0
R10001 (config-if)#no shutdown
R10001 (config-if)#clock rate 9600
R10001 (config-if)#ip address 192.168.254.1 255.255.255.252 //注意子网掩码,30位
R10001 (config)#int s8/0
R10001 (config-if)#no shutdown
R10001 (config-if)#clock rate 9600
R10001 (config-if)#ip address 192.168.254.5 255.255.255.252 //注意子网掩码,30位
R10001 (config-router)#network 192.168.254.0 255.255.255.252 area 0 //声明区域0——骨干区域
R10001 (config-router)#network 192.168.254.4 255.255.255.252 area 0 //声明区域0——骨干区域
R10001 (config-router)#network 192.168.254.8 255.255.255.252 area 0 //声明区域0——骨干区域
R10005#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/25 is subnetted, 2 subnets
O IA 192.168.1.0 [110/129] via 192.168.254.9, 00:09:34, Serial2/0
O IA 192.168.1.128 [110/129] via 192.168.254.9, 00:09:34, Serial2/0
O IA 192.168.2.0/24 [110/129] via 192.168.254.9, 00:09:34, Serial2/0
O IA 192.168.3.0/24 [110/130] via 192.168.254.9, 00:09:34, Serial2/0
C 192.168.4.0/24 is directly connected, FastEthernet0/0
O 192.168.6.0/24 [110/2] via 192.168.4.2, 00:30:58, FastEthernet0/0
O 192.168.7.0/24 [110/2] via 192.168.4.2, 00:30:58, FastEthernet0/0
192.168.254.0/24 is variably subnetted, 4 subnets, 2 masks
O 192.168.254.0/30 [110/128] via 192.168.254.9, 00:09:34, Serial2/0
O 192.168.254.4/30 [110/128] via 192.168.254.9, 00:09:34, Serial2/0
C 192.168.254.8/30 is directly connected, Serial2/0
C 192.168.254.9/32 is directly connected, Serial2/0
R10006#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/25 is subnetted, 2 subnets
O IA 192.168.1.0 [110/129] via 192.168.254.1, 00:32:11, Serial3/0
O IA 192.168.1.128 [110/129] via 192.168.254.1, 00:32:11, Serial3/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
O 192.168.3.0/24 [110/2] via 192.168.2.2, 00:31:46, FastEthernet0/0
O IA 192.168.4.0/24 [110/129] via 192.168.254.1, 00:10:22, Serial3/0
O IA 192.168.6.0/24 [110/130] via 192.168.254.1, 00:10:22, Serial3/0
O IA 192.168.7.0/24 [110/130] via 192.168.254.1, 00:10:22, Serial3/0 192.168.254.0/24 is variably subnetted, 4 subnets, 2 masks
C 192.168.254.0/30 is directly connected, Serial3/0
C 192.168.254.1/32 is directly connected, Serial3/0
O 192.168.254.4/30 [110/128] via 192.168.254.1, 00:32:11, Serial3/0 O 192.168.254.8/30 [110/128] via 192.168.254.1, 00:32:11, Serial3/0 R10004#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/25 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0.1
C 192.168.1.128 is directly connected, FastEthernet0/0.2
O IA 192.168.2.0/24 [110/129] via 192.168.254.5, 00:32:13, Serial2/0
O IA 192.168.3.0/24 [110/130] via 192.168.254.5, 00:32:13, Serial2/0
O IA 192.168.4.0/24 [110/129] via 192.168.254.5, 00:10:54, Serial2/0
O IA 192.168.6.0/24 [110/130] via 192.168.254.5, 00:10:54, Serial2/0
O IA 192.168.7.0/24 [110/130] via 192.168.254.5, 00:10:54, Serial2/0 192.168.254.0/24 is variably subnetted, 4 subnets, 2 masks
O 192.168.254.0/30 [110/128] via 192.168.254.5, 00:32:46, Serial2/0 C 192.168.254.4/30 is directly connected, Serial2/0
C 192.168.254.5/32 is directly connected, Serial2/0
O 192.168.254.8/30 [110/128] via 192.168.254.5, 00:32:46, Serial2/0
R10001#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/25 is subnetted, 2 subnets
O IA 192.168.1.0 [110/65] via 192.168.254.6, 00:33:13, Serial8/0
O IA 192.168.1.128 [110/65] via 192.168.254.6, 00:33:13, Serial8/0
O IA 192.168.2.0/24 [110/65] via 192.168.254.2, 00:32:42, Serial3/0
O IA 192.168.3.0/24 [110/66] via 192.168.254.2, 00:32:42, Serial3/0
O IA 192.168.4.0/24 [110/65] via 192.168.254.10, 00:11:24, Serial2/0
O IA 192.168.6.0/24 [110/66] via 192.168.254.10, 00:11:24, Serial2/0
O IA 192.168.7.0/24 [110/66] via 192.168.254.10, 00:11:24, Serial2/0
192.168.254.0/24 is variably subnetted, 6 subnets, 2 masks
C 192.168.254.0/30 is directly connected, Serial3/0
C 192.168.254.2/32 is directly connected, Serial3/0
C 192.168.254.4/30 is directly connected, Serial8/0
C 192.168.254.6/32 is directly connected, Serial8/0
C 192.168.254.8/30 is directly connected, Serial2/0
C 192.168.254.10/32 is directly connected, Serial2/0
由于PT模拟器里的路由器没有ospf路由汇总命令,所以不能做汇总试验
不过这里给出命令
有两种,都是在ospf路由协议模式下
Summary-address 网络号掩码
Area 区域号range 网络号掩码
ACL设定
有两种访问控制列表:标准访问控制列表和扩展访问控制列表
当使用标准访问控制列表时,需要靠近目的端口,理由很简
单,标准访问控制列表是根据源端口拒绝访问的,越靠近源端口拒绝访问流越多,很有可能把不需要拒绝访问的流量拒绝了。

当使用扩展访问控制列表时,就需要靠近源端口,理由是扩展访问控制列表是根据目的端口拒绝流量的,不存在标准访问控制列表的问题,并且放在靠近源端口提高路由器的性能。

要求:vlan100和vlan200之间不能互访,但都能访问外网实现:在R10004的单臂路由子端口上设定访问控制列表101 R10004 (config)#access-list 101 deny icmp 192.168.1.0 0.0.0.127 192.168.1.128 0.0.0.127
//拒绝vlan100访问vlan200,当然这只是拒绝ping功能,如果要拒绝其他的功能那就需要增加语句,不过跟这个同理
例如:
R10004 (config)#access-list 101 deny tcp 192.168.1.0 0.0.0.127 192.168.1.128 0.0.0.127 eq www
//拒绝vlan100访问vlan200 中web服务
R10004 (config)#access-list 101 deny icmp 192.168.1.128 0.0.0.127 192.168.1.0 0.0.0.127
//拒绝vlan200访问vlan100
//达到要求的命令
R10004 (config-ext-nacl)#deny ip 192.168.1.0 0.0.0.127 192.168.1.128 0.0.0.127
R10004 (config-ext-nacl)#deny ip 192.168.1.128 0.0.0.127 192.168.1.0 0.0.0.127
R10004 (config-ext-nacl)#permit ip any any
R10004 (config)#int f0/0.1
R10004 (config-subif)#ip access
R10004 (config-subif)#ip access-group 101 in //把访问控制列表设定在f0/0.1子端口上
R10004 (config-subif)#ex
R10004 (config)#int f0/0.2
R10004 (config-subif)#ip access
R10004 (config-subif)#ip access-group 101 in //把访问控制列表设定在f0/0.2子端口上
R10004 (config-subif)#
要求:vlan300和vlan400只能访问校园网10.X.X.X,不能访问Internet
实现:在SW10007上创建访问控制列表
SW10007 (config)#ip access-list extended 101
SW10007 (config-ext-nacl)#permit ospf 192.168.2.0 0.0.0.255 192.168.0.0 0.0.255.255
//允许vlan300通过ospf动态路由协议交换路由
SW10007 (config-ext-nacl)#permit ospf 192.168.3.0 0.0.0.255 192.168.0.0 0.0.255.255
//允许vlan400通过ospf动态路由协议交换路由
SW10007 (config-ext-nacl)#permit ip 192.168.2.0 0.0.0.255 192.168.0.0 0.0.255.255
//允许vlan300访问园区网,首先需要能访问创建的园区网才行
SW10007 (config-ext-nacl)#permit ip 192.168.3.0 0.0.0.255 192.168.0.0 0.0.255.255
//允许vlan400访问园区网
SW10007 (config-ext-nacl)#permit ip 192.168.2.0 0.0.0.255 10.0.0.0 0.0.0.255
//允许vlan300访问校园网
SW10007 (config-ext-nacl)#permit ip 192.168.3.0 0.0.0.255 10.0.0.0 0.0.0.255
//允许vlan400访问校园网
SW10007 (config)#access-list 101 deny ip any any
三层交换机中vlan相当于路由器的接口
SW10007 (config)#int vlan 300
SW10007 (config-if)#ip access-group 101 in
SW10007 (config-if)#ex
SW10007 (config)#int vlan 400
SW10007 (config-if)#ip access-group 101 in
SW10007 (config-if)#
要求:Vlan500可以访问内网所有VLAN,Vlan600既可以访问内网,又可以访问Internet 命令:
SW10008 (config)#ip access-list extended cisco
//命名扩展访问扩展列表
注意:命名访问控制列表可以插入语句,也可以单条语句的删除
SW10008 (config-ext-nacl)#permit ospf 192.168.4.0 0.0.0.255 192.168.0.0 0.0.255.255
SW10008 (config-ext-nacl)#permit ospf 192.168.6.0 0.0.0.255 192.168.0.0 0.0.255.255
SW10008 (config-ext-nacl)#permit ospf 192.168.7.0 0.0.0.255 192.168.0.0 0.0.255.255
SW10008 (config-ext-nacl)#permit ip 192.168.7.0 0.0.0.255 192.168.0.0 0.0.255.255
SW10008 (config-ext-nacl)#permit ip 192.168.6.0 0.0.0.255 any
SW10008 (config)#int vlan 500
SW10008 (config-if)#ip acces
SW10008 (config-if)#ip access-group ex
SW10008 (config-if)#ip access-group cisco in
SW10008 (config-if)#ex
SW10008 (config)#int vlan 600
SW10008 (config-if)#ip acces
SW10008 (config-if)#ip access-group cisco in
要求:需要在SW1中的VLAN100里面安装WWW、FTP、电子邮件等基本服务。

用访问控制列表使VLAN300和VLAN500中的用户在上班时间(9:00~17:00)不允许访问FTP服务器和WWW服务器,但可以访问EMail 服务器。

//定义时间范围
R10004 (config)#time-range test
R10004 (config-time-range)#periodic weekdays 9:00 to 17:00
R10004 (config)#ip access-list extended cisco
R10004 (config-ext-nacl)#deny tcp 192.168.3.0 0.0.0.255 192.168.1.0 0.0.0.127 time-range test eq 80 R10004 (config-ext-nacl)#deny tcp 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.127 time-range test eq 80 R10004 (config-ext-nacl)#deny tcp 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.127 time-range test eq 21 R10004 (config-ext-nacl)#deny tcp 192.168.3.0 0.0.0.255 192.168.1.0 0.0.0.127 time-range test eq 21如有侵权请联系告知删除,感谢你们的配合!。

相关文档
最新文档