网络工程综合试验

合集下载
  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个路由器、二台交换机、二台三层交换机、一台防火墙)构建一
个园区网,通过防火墙与校园网相联,实现到In ternet的访问。

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

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

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

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

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

(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服务器,但可以访问EMaii服务器。

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

(9) IP分配规则根据实验室分区划分):
A区:
IP 范围:192.168.0.0 —192.168.7.255
192.168.254.0 —192.168.254.15 (路由器Seriai 口用)
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)
总体设计:
R3 S1/0 192.168.254.5 S1/0 192.168.254.6
R4 SO/2 192.168.254.1 S 0/2 192.168.254.2
R5 S0/1 192.168.254.9 S0/1 192.168.254.10
试验拓扑:
R1
area 0
:92. M
■I 0
Sffl
L IAX 00
VLVsbO
O
..XhOO
ISffL 2. I: E---- J 92.1^8. L 139—
I 劇16&1,2^.: 25 L轮]6&…7.n——
IM:TH扎;:rim
:^2.北&區A——
:眩備点-1C-/M
192. Jfik 1. IL—LKJ. l^K. L 110 女
FO/O
.I6fr. t.2/2l
FG.-24 FO/1 I
晦I
FO/O. 2
191佩L】沸
area 2HO.ft
6S_2_L ;24
VLA>-
100
魄I圖——
192.1 SO*. 3.210/24
area 3
试验步骤:
1单臂路由:
在交换机9上划分vian100和vian200 ,分别划分端口到两个vlan 中,将f0/24 口设置为trunk与R4的fO/O 口相连
SW10009(co nfig)#vla n 100
SW10009(co nfig-vla n)#ex
SW10009(config)#vlan 200
SW10009(co nfig-vla n)#ex
SW10009(co nfig)#i nterface range f0/1-4
SW10009(co nfig-if-ra nge)#switchport vlan200 中
SW10009(c on fig-if-ra nge)#ex
SW10009(co nfig)#i nterface range f0/5-8
SW10009(co nfig-if-ra nge)#switchport vlan200 中
SW10009(co nfig-if-ra nge)#exit
SW10009(co nfig)#i nt f0/24
// 创建vlan100
// 创建vlan200
access vlan 100 //将端口f0/1-4 划归到access vlan 200 //将端口f0/5-8 划归到
SW10009(co nfig-if)#switchport mode trunk
SW10009(config-if)#switchport trunk allowed vlan all // 设置 trunk 允许所有 vian 通过
SW10009(c on fig-if)#
在R4接口 f0/0上划分子端口,f0/0.1和vlan 100关联,f0/0.2和vian200关联 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)#eneapsulation 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 (con fig-subif)#e ncapsulation dot1Q 200 R10004 (con fig-subif)#
用主机A ping 的结果
//将接口设置trunk
设置一台主机 AIP 地址为192.168.1.11/25 网关为 192.168.1.1 接在交换机的 vla n100
另一台主机BIP 地址为192.168.1.139/25 网关为 192.168.1.129 接在交换机的 vla n200
PC>pi ng 192.168.1.1 可以pi ng 通f0/0.1 ,也就是via n100 和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-sec on ds:
Minimum = 33ms, Maximum = 94ms, Average = 59ms
PC>pi ng 192.168.1.129 可以pi ng 通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-sec on ds:
Minimum = 31ms, Maximum = 62ms, Average = 51ms
PC>pi ng 192.168.1.139 可以pi ng 通vlan200 上的主机,也就是via n200 和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-sec on ds:
Mi nimum = 64ms, Maximum = 109ms, Average = 97ms
SW10007 (con fig-if-ra nge)#ex SW10007 (con fig)#i nt range f0/5-8
SW10007 (con fig-if-ra nge)#switchport access vlan 400 中
SW10007 (con fig-if-ra nge)#ex SW10007 (con fig)#i nt f0/24
此时单臂路由成功
2.三层交换机和路由器相连 用到两种方式,一种是在三层交换机上划分两个 vlan300和vian400 将属于vlan300的接口与路由器相连 一种是在三层交换机上划分两个 vian500和vlan600,
外给默认的vlanl 也分配IP 地址,将属于vlanl 的接口与路由器相连 ,分别分配IP ,
分别分配IP ,另
方法 用交换机SW7和R6实现 SW10007(co nfig)#vla n 300 SW10007 (con fig-vla n) #ex SW10007 (con fig)#vla n 400 SW10007 (con fig-vla n) #ex SW10007 (con fig)#i nt range f0/1-4 // 创建 vlan300
// 创建 vlan400
SW10007 (con fig-if-ra nge)#switchport access vlan 300
// 将端口 f0/1-4 划归到vlan300
// 将端口 f0/1-4 划归到vlan400

SW10007 (con fig-if)#ex SW10007 (config)#int vlan 300
// 进入 vlan 接口配置模式
SW10007 (config-if)#ip address 192.16822 255.255.255.0 // 分配 IP
SW10007 (con fig-if)# no shutdow n SW10007 (con fig-if)#ex SW10007 (con fig)#i nt vlan 400
//vla n400 同理
Reply from 192.168.2.2: bytes=32 time=47ms TTL=255 Reply from 192.168.2.2: bytes=32 time=31ms TTL=255
SW10007 (config-if)#switchport access vlan 300 //将端口 f0/24划归到vlan300
SW10007 (con fig-if)#ip address 192.168.3.1
SW10007 (con fig-if)# no shutdow n SW10007 (con fig-if)#ex SW10007 (con fig)#ip rout ing SW10007 (con fig)#
此时三层交换机两个 vlan 可以相互通信 配置一台主机 C 地址192.168.2.11/24 配置一台主机 D 地址192.168.3.11/24 用主机C ping 的结果
PC>pi ng 192.168.2.2 可以 pi ng 通
255.255.255.0
//开启三层交换机路由功能
网关 192.168.2.2 //vla n300 的地址 网关 192.168.3.1
//vlan400 的地址
vlan300,也就是网关
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-sec on ds:
Minimum = 15ms, Maximum = 47ms, Average = 31ms
PC>pi ng 192.168.3.1 可以pi ng通via n400 ,也就是三层交换机内部两个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-sec onds:
Minimum = 18ms, Maximum = 31ms, Average = 24ms
PC>pi ng 192.168.3.11 可以pi ng 通主机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
Pi ng statistics for 192.168.3.11:
Packets: Sent = 4, Received = 4, Lost = 0(0% loss),
Approximate round trip times in milli-sec on ds:
Mi nimum = 47ms, Maximum = 62ms, Average = 58 ms 连通路由器和交换机的命令
R10006(co nfig)# int f0/0
R10006 (con fig-if)#ip address 192.168.2.1 255.255.255.0
R10006 (con fig-if)# no shutdow n
R10006 (con fig-if)#ex
R10006 (config)#router ospf 1 /在路由器R6 上配置OSPF 协议
R10006 (con fig-router)# network 192.168.2.0 255.255.255.0 area 2 区域,拓扑图给出 R10006 (con fig-router)#
SW10007 (con fig-router)# network 192.168.2.0 255.255.255.0 area 2 SW10007 (con fig-router)# network 192.168.3.0 255.255.255.0 area 2 SW10007 (con fig-router)#
此时主机C 和主机D 都可以pingt 通R6的f0/0接口
R10006#show ip route
Codes: C - conn ected, S - static, I - IGRP , R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF in ter 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 * - can didate default, U - per-user static route, o - ODR P - periodic dow nl oaded static route
Gateway of last resort is not set
SW10007 (con fig)#router ospf 1
//在交换机SW7上配置 OSPF 协议
//声明网段和
//声明网段和区域 //声明网段和区域
192.168.2.0/24 is directly conn ected, FastEthernetO/O
O 192.168.3.0/24 [110/2] via 192.168.2.2, 00:50:20, FastEthernet0/0 路由表中有R6学习交换机vlan400的路由
方法二
用交换机SW8和R5
SW10008 (con fig-if-ra nge)#ex SW10008 (con fig)#i nt f0/24
SW10008(config)#vlan 500 SW10008 (con fig-vla n) #ex SW10008(config)#vlan 600 SW10008 (con fig-vla n) #ex SW10008 (con fig)#i nt range f0/1-4 SW10008(co nfig-if-ra nge)#switchport 中
SW10008 (con fig-if-ra nge)#ex SW10008 (con fig)#i nt range f0/5-8 SW10008(co nfig-if-ra nge)#switchport
// 创建 vlan500
// 创建 vlan600
access vlan 500 // 将端口 f0/1-4 划归到 access vlan 600 // 将端口 f0/1-4 划归到 vlan 500
vlan 600
SW10008(c on fig-if)#switchport access vlan 1 SW10008 (con fig-if)#ex SW10008 (config)#int vlan 500
// 进入 vlan 接口配置模式
SW10008 (config-if)#ip address 192.168.7.1 255.255.255.0 // 分配 IP
SW10008 (con fig-if)# no shutdow n SW10008 (con fig-if)#ex SW10008 (con fig)#i nt vlan 600
//vla n400 同理
SW10008(co nfig-if)#ip address 192.16861 255.255.255.0 SW10008 (con fig-if)# no shutdow n SW10008 (con fig)#i nt vlan 1
//vla n1 同理
SW10008(co nfig-if)#ip address 192.168.4.2 255.255.255.0 SW10008 (con fig-if)# no shutdow n SW10008 (con fig-if)#ex SW10008 (config)#ip routing //开启三层交换机路由功能
SW10008 (con fig)#
PC>pi ng 192.168.7.1
主机E 192.168.7.11/24 网关 192.168.7.1 //vla n500IP 地址 主机F 192.168.6.11/24
网关 192.168.6.1
//vla n600IP 地址
主机E
ping 结果
之间都是互通的 //将端口 fO/24划归到vlan1中
此时 SW10008 中的 vlan500,vlan600 和 vlan1
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-sec on ds:
Mi nimum = 13ms, Maximum = 63ms, Average = 34ms
PC>pi ng 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.16861:
Packets: Sent = 4, Received = 4, Lost = 0(0% loss),
Approximate round trip times in milli-sec on ds:
Minimum = 15ms, Maximum = 32ms, Average = 20ms PC>pi ng 192.168.4.1
Pin gi ng 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-sec onds:
Minimum = 31ms, Maximum = 63ms, Average = 55ms
PC>pi ng 192.168.6.11
Pinging 192.168611 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-sec on ds:
Minimum = 30ms, Maximum = 63ms, Average = 50ms
连通路由器和交换机的命令
R10005(co nfig)# int f0/0
R10005 (con fig-if)#ip address 192.168.4.1 255.255.255.0
R10005 (con fig-if)# no shutdow n
R10005 (con fig-if)#ex
R10005 (con fig)#router ospf 1
R10005 (con fig-router)# network 192.168.4.0 255.255.255.0 area 3 R10005 (con fig-router)#
SW10008#co nf
SW10008 (con fig)#router ospf 1
SW10008 (con fig-router)# network 192.16840 255.255.255.0 area 3
SW10008 (con fig-router)# network 192.168.6.0 255.255.255.0 area 3
SW10008 (con fig-router)# network 192.168.7.0 255.255.255.0 area 3 SW10008 (con fig-router)#
R10005 #show ip route
Codes: C - conn ected, S - static, I - IGRP , R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF in ter 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
* - can didate default, U - per-user static route, o - ODR
P - periodic dow nl oaded static route
Gateway of last resort is not set
C 192.168.4.0/24 is directly conn ected, 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(co nfig)#i nt s2/0
R10005 (con fig-if)#clock rate 9600
注意:Seral 口在链路上是up ,但是在协议上是down ,那就是缺少这条命令,声明速率。

在神码实验室中是physical-layer speed 9600
R10005 (con fig-if)# no
shutdown
R10005 (con fig-if)#ip address 192.168.254.10
//注意子网掩码,255.255.255.252
30位
R10005 (con fig-
if)#ex
R10005 (con fig)#router ospf
1
R10005 (con fig-router)# network 192.168.254.10 255.255.255.252 area
//声明区域0 0
骨干区域
R10005 (con fig-router)# network 192.168.4.0 255.255.255.0 area
//声明区域3
3
R10006 (con fig)#i nt s3/0
R10006 (con fig-if)# no shutdow n
R10006 (con fig-if)#clock rate
9600
R10006 (config-if)#ip address 192.168.254.2 255.255.255.252 //注意子网掩码,
30位
R10006 (con fig-if)#ex
R10006 (con fig)#router ospf 1
R10006 (con fig-router)# network 192.168.254.0 255.255.255.252 area 0 //声明区域o—骨干区域
R10006 (con fig-router)# network 192.168.2.0 255.255.255.0 area 2 //声明区域2
R10004 (config)#int s2/0
R10004 (con fig-if)# no shutdow n
R10004 (con fig-if)#clock rate 9600
R10004 (config-if)#ip address 192.168.254.6 255.255.255.252 //注意子网掩码,
30位
R10004 (con fig-if)#ex
R10004 (con fig)#router ospf 1
R10004 (con fig-router)# network 192.168.254.4 255.255.255.252 area 0 //声明区域0—骨干区域
R10004 (con fig-router)# network 192.168.1.0 255.255.255.128 area 1 //声明区域1
R10004 (con fig-router)# network 192.168.1.128 255.255.255.128 area 1 //声明区域1
R10001 (con fig)# int s2/0
R10001 (con fig-if)# no shutdow n
R10001 (con fig-if)#clock rate 9600
R10001 (con fig-if)#ip address 192.168.254.9 255.255.255.252 //注意子网掩码,30位
R10001 (con fig)# int s3/0
R10001 (con fig-if)# no shutdow n
R10001 (con fig-if)#clock rate 9600
R10001 (con fig-if)#ip address 192.168.254.1 255.255.255.252 //注意子网掩码,30位
R10001 (con fig)# int s8/0
R10001 (con fig-if)# no shutdow n
R10001 (con fig-if)#clock rate 9600
R10001 (con fig-if)#ip address 192.168.254.5 255.255.255.252 //注意子网掩码,30位
R10001 (con fig-router)# network 192.168.254.0 255.255.255.252 area 0 //声明区域0——骨干区域
R10001 (con fig-router)# network 192.168.254.4 255.255.255.252 area 0 //声明区域0——骨干区域
R10001 (con fig-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 in ter 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
* - can didate default, U - per-user static route, o - ODR
P - periodic dow nl oaded static route
Gateway of last resort is not set
192.168.1.0/25 is sub netted, 2 sub nets
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 conn ected, 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 sub netted, 4 sub nets, 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 conn ected, 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 in ter area C 192.168.254.9/32 is directly conn ected, Serial2/0
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
* - can didate default, U - per-user static route, o - ODR
P - periodic dow nl oaded static route
Gateway of last resort is not set
192.168.1.0/25 is sub netted, 2 sub nets
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 conn ected, 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 sub netted, 4 sub nets, 2 masks
C 192.168.254.1/32 is directly conn ected, 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
C 192.168.254.0/30 is directly conn ected, Serial3/0
R10004#show ip route
Codes: C - conn ected, S - static, I - IGRP , R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF in ter 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
* - can didate default, U - per-user static route, o - ODR
P - periodic dow nl oaded static route
Gateway of last resort is not set
192.168.1.0/25 is sub netted, 2 sub nets
C 192.168.1.0 is directly conn ected, FastEthernet0/0.1
C 192.168.1.128 is directly conn ected, 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.7.0/24 [110/130] via 192.168.254.5, 00:10:54, Serial2/0
192.168.254.0/24 is variably sub netted, 4 sub nets, 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 conn ected, Serial2/0
C 192.168.254.5/32 is directly conn ected, 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 - conn ected, S - static, I - IGRP , R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF in ter 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
* - can didate default, U - per-user static route, o - ODR
P - periodic dow nl oaded static route
Gateway of last resort is not set
192.168.1.0/25 is sub netted, 2 sub nets
192.168.1.128 [110/65] via 192.168.254.6, 00:33:13, Serial8/0
O IA
O IA 192.168.1.0 [110/65] via 192.168.254.6, 00:33:13, Serial8/0
O IA 192.168.3.0/24 [110/66] via 192.168.254.2, 00:32:42, Seria l3/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 sub netted, 6 sub nets, 2 masks
C 192.168.254.0/30 i s directly conn ected, Serial3/0
C 192.168.254.2/32 i s directly conn ected, Serial3/0
C 192.168.254.4/30 i s directly conn ected, Serial8/0
C 192.168.254.6/32 i s directly conn ected, Serial8/0
C 192.168.254.8/30 i s directly conn ected, Serial2/0
C 192.168.254.10/32 is directly conn ected, Serial2/0
由于PT模拟器里的路由器没有ospf路由汇总命令,所以不能做汇总试验不过这里给出命令有两种,都是在ospf路由协议模式下
Summary-address 网络号掩码
Area 区域号range 网络号掩码
ACL设定
有两种访问控制列表:标准访问控制列表和扩展访问控制
列表
当使用标准访问控制列表时,需要靠近目的端口,理由很
简单,标准访问控制列表是根据源端口拒绝访问的,越靠近源端口拒绝访问流越多,很有可能把不需要拒绝访问的
流量拒绝了。

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

要求:vlanlOO和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
//拒绝vlan 100访问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 (con fig-ext- nacl)#de ny ip 192.168.1.0 0.0.0.127 192.168.1.128 0.0.0.127
R10004 (con fig-ext- nacl)#de ny ip 192.168.1.128 0.0.0.127 192.168.1.0 0.0.0.127
R10004 (con fig-ext -n acl)#permit ip any any
R10004 (con fig)# int f0/0.1
R10004 (con fig-subif)#ip access
R10004 (config-subif)#ip access-group 101 in // 把访问控制列表设定在f0/0.1 子端口上
R10004 (con fig-subif)#ex
R10004 (con fig)# int f0/0.2
R10004 (con fig-subif)#ip access
R10004 (config-subif)#ip access-group 101 in // 把访问控制列表设定在f0/0.2 子端口上
R10004 (con fig-subif)#
要求:vlan300和vlan400只能访问校园网10.X.X.X,不能访问Internet
实现:在SW10007上创建访问控制列表
SW10007 (con fig)#ip access-list exte nded 101
SW10007 (config-ext-nacl)#permit ospf 192.168.2.0 0.0.0.255 192.168.0.0 0.0.255.255
II允许vian300通过ospf动态路由协议交换路由
SW10007 (config-ext-nacl)#permit ospf 192.168.3.0 0.0.0.255 192.168.0.0 0.0.255.255
II允许vlan400通过ospf动态路由协议交换路由
SW10007 (config-ext-nacl)#permit ip 192.168.2.0 0.0.0.255 192.168.0.0 0.0.255.255
II允许vian300访问园区网,首先需要能访问创建的园区网才行
SW10007 (config-ext-nacl)#permit ip 192.168.3.0 0.0.0.255 192.168.0.0 0.0.255.255
II允许vlan400访问园区网
SW10007 (con fig-ext-nacl)#permit ip 192.168.2.0 0.0.0.255 10.0.0.0 0.0.0.255
II允许vlan300访问校园网
SW10007 (config-ext-nacl)#permit ip 192.168.3.0 0.0.0.255 10.0.0.0 0.0.0.255
II允许vlan400访问校园网
SW10007 (con fig)#access-list 101 deny ip any any
三层交换机中vlan相当于路由器的接口
SW10007 (con fig)#i nt vlan 300
SW10007 (con fig-if)#ip access-group 101 in
SW10007 (con fig-if)#ex
SW10007 (con fig)#i nt vlan 400
SW10007 (con fig-if)#ip access-group 101 in
SW10007 (con fig-if)#
要求:Via n500可以访问内网所有VLAN , Vian600既可以访问内网,又可以访问In ternet
命令:
SW10008 (con fig)#ip access-list exte nded cisco
//命名扩展访问扩展列表
注意:命名访问控制列表可以插入语句,也可以单条语句的删除
SW10008 (config-ext-nacl)#permit ospf 192.16840 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 (con fig)#i nt vlan 500
SW10008 (con fig-if)#ip acces
SW10008 (con fig-if)#ip access-group ex
SW10008 (con fig-if)#ip access-group cisco in
SW10008 (con fig-if)#ex
SW10008 (con fig)#i nt vlan 600
SW10008 (con fig-if)#ip acces
SW10008 (con fig-if)#ip access-group cisco in
要求:需要在SW1中的VLAN100里面安装WWW、FTP、电子邮件等基本服务。

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

//定义时间范围
R10004 (con fig)#time-ra nge test
R10004 (con fig-time-ra nge)#periodic weekdays 9:00 to 17:00
R10004 (con fig)#ip access-list exte nded cisco
R10004 (con fig-ext- nacl)#de ny tcp 192.16830 0.0.0.255 192.168.1.0 0.0.0.127 time-ra nge test eq 80
R10004 (con fig-ext- nacl)#de ny tcp 192.16820 0.0.0.255 192.168.1.0 0.0.0.127 time-ra nge test eq 80
R10004 (con fig-ext- nacl)#de ny tcp 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.127 time-ra nge test eq 21
R10004 (con fig-ext- nacl)#de ny tcp 192.168.3.0 0.0.0.255 192.168.1.0 0.0.0.127 time-ra nge test eq 21。

相关文档
最新文档