【东北大学计算机网络实验报告x】

时间:2021-11-04 15:46:08  来源:网友投稿

计算机网络实验实验报告

--- 小型校园网的设计与组建

12.1 实验目的

计算机网络是一门实践性较强的技术,课堂教学应该和实践环节紧密结合。计算机网络实

验培养学生具有独立进行计算机网络架构和设计能力, 提高学生的网络设备使用水平, 以及将理 论与实践相结合的能力。

12.2 实验环境及设备

2台路由器、2台交换机、3台PC机

12.3 实验的内容和要求 根据要求,设计并搭建一个校园网。要求进行子网划分和结构设计,并将网络结构建立起 来。最后完成网络设备的调试。

12.4 实验说明

某大学分为总校和分校, 为该校设计校园网,总校有一个局域网共 20台计算机,分校由VLAN 划分为两个局域网,分别有 10台计算机。该校被分配了一个 C类网段210.100.10.0,总校和分校各 有一台路由器及一台交换机。请进行网络设计,将总校和分校各个局域网连接起来。

根据要求,设计IP地址分配表,设计网络结构,画岀网络拓扑图。

根据设计搭建网络结构。

配置网络设备,完成网络调试。

提示:1)使用IP子网掩码的原理设计IP地址分配表。

2)用到的设备为两台路由器,以及两台交换机。

思考:1)要使总校局域网能够与分校两个局域网通信,如何配置静态路由?

2)如果分校两个局域网分别有 20台主机,交换机快速以太网口是否够用?如不够用,

则如何解决该问题?

12.5实验内容

12.5.1实验设计思路

由题意可知,共有总校20台计算机,分校局域网1里10台计算机,局域网2里 10台计算机,每个局域网中的主机数量不超过 32,所以要有5位作为主机位(此 时有2八5 = 32台主机)。题中给的是C类的局域网,所以除去5位主机位,还剩 下3位做子网号(此时有2 A 3 - 2 = 6个子网)。由此,可得到子网掩码位:

255.255.255.224。从6个子网中选择4个不重复的子网即可,分别分配给主校网 段、路由器间网段、分校局域网1网段、分校局域网2网段,这里我们选择子网001、 010、011、100。

12.5.2 IP地址分配表

用途

网段

网络号

子网掩码

子网号

起始IP地址

结束IP地址(实验 中用到的)

总校网

1

210.100.10.32

255.255.255.224

001

210.100.10.34

210.100.10.53

路由器间

2

210.100.10.64

255.255.255.224

010

210.100.10.65

210.100.10.66

分校网1

3

210.100.10.96

255.255.255.224

011

210.100.10.98

210.100.10.107

(包含一个路由 器快速以太网口 210.100.10.97 )

分校网2

4

210.100.10.128

255.255.255.224

100

210.100.10.130

210.100.10.139

(包含一个路由

器快速以太网口

210.100.10.129 )

暂未使用

5

210.100.10.160

255.255.255.224

101

210.100.10.161

210.100.10.190

暂未使用

6

210.100.10.192

255.255.255.224

110

210.100.10.193

210.100.10.221

12.5.4网络结构设计:

总校和分校各有一台路由器及一台交换机。

主校局域网中20台电脑用交换机相连;分校的两个局域网也由交换机相 连,分校的交换机通过使用 VLAN将交换机划分两个局域网,一个 VLAN下接 入10个端口,共用20个端口。

三个局域网之间的通信需要路由器来连接,主校路由器和分校路由器。主 校路由器连在主校交换机的 fO/24端口。而将分校路由器也接在分校交换机的

fO/24端口,由于分校区交换机被分为两个 VLAN,故路由器端口需设置为公共 端口,即tag VLAN的模式,同时该路由器应该配置为 fO/O的子接口形式:

f0/0.10,f0/0.20。

交换机有24台的快速以太网端口,主校共用 21个端口,分校共用21个端 口,因此设置满足要求。

12.5.3网络拓扑图

sO 21£. UJO.10.65/27

5(1:210.100.10.66/27

*r

flauter-P

主决將安 Z 10.100 1031/27"0 0.

主决將安 Z 10.100 1031/27

"0 0.101! 10.100.

\ ^20:210. DC.10.129

aJPUFT210,100.10.34/27-210.LCO 10.34/27

aJ

PUFT

210,100.10.34/27-210.LCO 10.34/27

■zianl

PC-PT

210.lDQ.ia9B/27

vteniO

PC-PT

210.130.;0.133/27

1:210,0.ia 95/272 2

1:210,0.ia 95/27

2 210.100.10.138/27

12.5.5主机、交换机、路由器的参数设置

PC 1:用作主校

ip: 210.100.10.34/27-210.100.10.53/27

默认网关:210.100.10.33/27

PC 2:用作分校1或分校2

ip : 210.100.10.98/27-210.100.10.107/27 和

210.100.10.130/27-210.100.10.139/27

默认网关:210.100.10.97 或 210.100.10.129

路由器1:用作主校

S0:210.100.10.65/27

F0:210.100.10.33/27

路由器1:用作分校

S0:210.100.10.66/27

F0/0.10:210.100.10.97/27

F0/0.20:210.100.10.129/27

ROUTER的路由表:

目的

子网掩码

经由

210.100.10.96

255.255.255.224

210.100.10.65

210.100.10.128

255.255.255.224

210.100.10.65

ROUTER2勺路由表:

目的

子网掩码

经由

210.100.10.32

255.255.255.224

210.100.10.66

12.5.6 实验步骤

(1)内容设计

(i)分校:

首先连线

配置电脑端的IP

进入特权模式配置分校交换机

进入特权模式

Switch>e nable 14

Password: star

switch #show vla n

Switch#con figure termi nal switch (con fig)#vla n 10 switch (con fig-vla n) #exit switch (config)#vlan 20进入全局配置模式

Switch#con figure termi nal switch (con fig)#vla n 10 switch (con fig-vla n) #exit switch (config)#vlan 20

进入全局配置模式

创建vlan 10

创建vlan 20

switch (config -vlan)#exit

将 20 个端口戈y分进两个 VLAN中******************/

switch (con fig)#i nterface range fastEthernet 0/1-10 switch (con fig-if-ra nge)#switch access vla n 10 !switch (con fig-if-ra nge)#e ndswitch (con fig)#i nterface range fastEthernet 0/11-20 switch (config-if-range)#switch access vlan 20 !switch (con fig-if-ra nge)#e ndswitch #show vla n/*****************

switch (con fig)#i nterface range fastEthernet 0/1-10 switch (con fig-if-ra nge)#switch access vla n 10 !

switch (con fig-if-ra nge)#e nd

switch (con fig)#i nterface range fastEthernet 0/11-20 switch (config-if-range)#switch access vlan 20 !

switch (con fig-if-ra nge)#e nd

switch #show vla n

/***************** 配置 24#端口为公共端口

Switch (config)#interface fastEthernetO/24

Switch (config-if)#switchport mode trunk

模式

switch #show vla n //

分校路由器

Router>e nable 14 !

进入接口组配置模式 将接口组加入 vlan 10 中

! 进入接口组配置模式

将接口组加入 vlan 10 中

!检查是否配置正确

***********************

!将 fastEthernetO/24 端口设置为 tag vlan

检查是否配置正确

进入特权模式

Password: star

RouterA#show ip int brief

Router #config terminal ! 进入全局配置模式

Router (config)# interface fastethernet 0/0

Router (config-if)# no ip address

Router (config-if)# no shutdown

Router (config-if)# exit

配置子网的 f0.10 和 f0.20**************

配置子网的 f0.10 和 f0.20

**************

Router (config)# interface fastethernet 0/0.10

Router (config)# interface fastethernet 0/0.10

Router (config-subif)# encapsulation dot1q 10

!进入子接口 F0.10 配置模式

!封装 802.1Q 并指定 Vlan 号 10

Router (config-subif)#地址ip address 210.100.10.97

Router (config-subif)#

地址

ip address 210.100.10.97

255.255.255.224

!配置子接口 F0/0.10IP

!进入子接口 F0.20 配置模式!封装 802.1Q 并指定 Vlan

!进入子接口 F0.20 配置模式!封装 802.1Q 并指定 Vlan 号 20

配置串行接口

s0 的 IP*

***************

Router (config-subif)# exit

Router (config)# interface fastethernet 0/0.20

Router (config-subif)# encapsulation dot1q 20

Router (config-subif)# ip address 210.100.10.129 255.255.255.224!配置子接口 F0/0.20IP 地址

Router (config-subif)# exit

进 入广 域 网 0

进 入广 域 网 0 口 配 置 状 态 为广域网 0 口配置地址

端需设置端口时钟频率

Router1(config)#interface serial 2/0

Router1(config-if)#ip address 210.100.10.66 255.255.255.0 !

Router1(config-if)#clock rate 64000 ! DCE

Router1(config-if)#no shutdown ! 打开广域网 0 口

RouterA#show ip int brief!检查配置是否正确

Router1(config)#ip route 210.100.10.32 255.255.255.224 210.100.10.65 ! 添加静态路

Router1(config)#end

Router1#show ip route

(2)主校:

首先连线

配置电脑端的 IP

配置主校交换机( 24 个端口默认在 VLAN1 下)

Switch>enable 14 ! 进入特权模式 Password: star switch #show vlan

Switch#configure terminal ! 进入全局配置模式 switch #show vlan

配置主校路由器

Router>enable 14 ! 进入特权模式

Password: star

RouterA#show ip int brief

进入全局配置模式Router #config terminal !

进入全局配置模式

Router (config)# interface fastethernet 0/0

Router (config-if)# ip address 210.100.10.33 255.255.255.224

Router (config-if)# no shutdown

Router1(config-if)#end

Router1(config)#interface serial 0/0

Router1(config-if)#ip address 210.100.10.65 255.255.255.224 ! 为广域网 0 口配置地址

Router1(config-if)#clock rate 64000 ! DCE 端需设置端口时钟频率

Router1(config-if)#no shutdown ! 打开广域网 0 口

Router1(config-if)#end

Router1#show ip interface brief

Router1(config)#ip route 210.100.10.96 255.255.255.224 210.100.10.66 ! 添加静态路由

Router1(config)#ip route 210.100.10.128 255.255.255.224 210.100.10.66 ! 添加静态路 由

Router1(config)#end

Router1#show ip route ! 显示路由表

(2)补充说明:在实验室做网络实验的时候,我做的是分校,分校代码同上, 主校由付双英同学负责,她的代码如下:

Switch0 的配置

在交换机 Switch0 上创建 VLan 2 ,并将 0/1 到 0/20 端口划分到 Vlan 2 中。

Switch> enable

Switch#configure terminal

Switch(config)#vlan 2 ! 创建 Vlan 2

Switch(config-vlan)#name zhuxiao

Switch(config-vlan)#exit

Switch(config)#interface range fastEthernet 0/1-21 ! 进入接口配置模式 ,21 号口用 于做路由器连接口

Switch(config-if-range)#switchport access vlan 2 ! 将接口组分配给 Vlan 2 Switch(config-if-range)#exit

Switch(config)#exit

Router0 的配置

在路由器 Router0 上配置快速以太网口 F0 地址:

Router>enable

Router#configure terminal

Router(config)#interface fastEthernet 0/0

Router(config-if)#no ip address

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#interface fastEthernet 0/0!进入接口 F0/0 配置模式

Router(config-subif)#ip address 210.100.10.33 255.255.255.224 !配置接口 F0/0

IP 地址

Router(config-subif)#exit

在路由器 Router0 上配置广域网口的 IP 地址和时钟频率(假设 Router0 为 DCE 端) Router#configure terminal

Router(config)#interface serial 2/0 ! 进入广域网 0 口配置状态

Router(config-if)#ip address 210.100.10.65 255.255.255.224 ! 为广域网 0 口配置

地址

Router(config-if)#clock rate 64000 ! DCE 端需设置端口时钟频率

Router(config-if)#no shutdown ! 打开广域网 0 口

Router(config-if)#end

验证测试:验证路由器接口配置状态:

Router#show ip interface brief

为 Router0 添加静态路由:

Router#configure terminal

Router(config)#ip route 210.100.10.96 255.255.255.224 210.100.10.66

Router(config)#ip route 210.100.10.128 255.255.255.224 210.100.10.66 Router(config)#end

显示路由表

Router #show ip route

Router #wr ! 保存

12.5.7 实验结果

对主校和分校配置完成后,进行测试:

主校 ping 分校:

Ping 210.100.10.98

来县quEMit t imted ciiilt .

JteqiAect 七 xned 0 ut:?

Jtcqusst 七 xnicd. o ut;?

Jlcqu£st 七 xncd. o ut:?

Fing ^taLlbftlcs for* 210.130.10.98 =

FcickeLs = SenC = 4, Received! - 0, LubfL - 4 <100^ loss>,

U= XDccuiiients and

C:SDccuments and

Se ttings Mldnin isti*a10 r>

Settings\Adnini3tt'aJtoi'Apingr 21tJ.lldld.lld.9K

Pinging 213^1 B8P18.98 with 32 bytes of data:

珈ply JleDlv Beplv Ttepl^i

fran 21CR10B.18.98 : bytes=32 fFom 21S.10B.10.98: fcytes=32 fran 21100^18.98:bytes=32

f Fum 21 I3.1 1 W.9R : bvtes=32

t ine =20ins IT L=62 tine=20ms TTL=62 tine=19ins T7L=62 tine=2Bms TIL=62

Ping etat i_citxc& f?i* 2189100s 10?.9S =

P9.c1cq1;^ " £gin如=4^ iv@dl = 4., LpbI; - & <8>£ lo&s ]>

"ppi*。冥iinidtu r<oumdl trip tiwi步往 i几 rnilli-^-ccoindlai "

Hiiii iRum — 1 宁m玉鼻 llaj<irauri - 2斷不.Avcra^re - 19ns

C; M>ocuRenCiSjan<L S ectirwsjsA^^ in 1st Fa 10 r>

Ping 210.100.10.130

cC C; XTIiroOIS\sy^te?32,c?(L> exe

Paekets 2 Semt - 4. Receiuedl = 0, Lost - 4 < 100>i loss>,

C: \Dociiinient & and xnvjfi \fidninietiL'atoi'>piing 210L±9@.IttHQ

ringriin^ 210.1@0 ?10?13;0 with 32 bytes of datoi-

丄 _y

f iroiii

216.100.

.L0.13B:

bj/LeiJ—32

tri fTlli -If IK

TTL-63

Kt? jjI^

fro hi

21S.100.

.18.136=

b^Les—32

tr lfTkt±<lfl|£>

T7L-63

Repl^

iron

210.100.

.10.£30:

bytes=32

t iniB< 丄 m 石

TTL=63

Kepl^

from

21M.1UU.

bytas=32

tine<lms

TTL=63

Ping st已t Is;tics f oi' 21@.1BQ.1O.13Q :

Packets : Sent = 4, Received = 4, Lost = 0 (0>i loss^,

App^oxiiiiate rvund trip times in milli-seconds: Nin imum = 0ns Naxiniium = 1ms, AueraAfe = Orts

C: SDccuinients and Settings\AdninistFatoir^incr 210^130.10^130

Pingrinig A .1 RCi -1 R 1 uitli 32 hytes nF dat-a :

Roply fI'nin 21Q. 10B.18.138; Jbyit£iB=32 € ioa 7TL~62

Jlcpl^ f 1'om 210.10B .. 18.13@ £ byt;5S"32 t inis —2Xr?S 7TL"S2

Repl^ f ryn 21BR100.10.136; Jtiytea—32 t inK s20ria TTL^62

Rtrpl^ fma 21S^1@Q<L0.136= b^t&s=32 Cine =2Ins TTL=62

技何猗存

分校ping主校:

Pin g210.100.10.34

BC* ^Dccumentc andEott^xnsfs Mldlnin iati*atoi*p£ngi218.108.10.34He jj 1 vf Jt'OHi216..100..18.34=hytes-32lllke-20ntsTTL=62Keplw

BC* ^Dccumentc and

Eott^xnsfs Mldlnin iati*atoi*p£ngi

218.108.10.34

He jj 1 v

f Jt'OHi

216.

.100.

.18.34=

hytes-32

lllke-20nts

TTL=62

Keplw

f iron

210.

.100.

.10.34:

bytes=32

t ine=20nts

TTL=62

He卩丄中

from

210.

.1BU.

.LO.34:

bytes=32

t ine=2Mins

TIL=6Z

Keplv

from

21U.

LB.34:

bytes=32

tine=2Wnts

TTL=62

Kl*j.iig219 .1B0 ?iBa. 3i4 wltli 32 byLes of licitci.±

Ping st已tistics foi* 2181.IBS.10.34:

Packets : Sent = 4, Received = 4, Lost = 0 (0^ loss^,

Appi^cxiiiiate rciundl trip times in milli-secands;

NlnImuni = 20mrs:? Naxinun = 2dns Average = 28ns

C: XDnciimenl:?; and Setti ngrs \fidni nist>'atov>—

C; ,\TIfnX)¥5Xsyste*32\cfcJ^ eie

blicrcsoft Uindovs NP S,1,26601

",版权所有 1915-2081 MicnxaFtr Carp.

C= \Dccuin)eint? an d Sstt;insfs Mldniri ioti^atoi*>plngi 21B.130 ■ 10.24

Be pls

fro iii

2ie.i0D.

.10.34:

hytes-32

t lne-21fiEi>

T7L-62

KeplS

iron

210.100.

.10.34:

bytes=32

t ifie=20ms

TTL=62

Bep Is

from

.LU.34:

bytes=32

tine=2Ums

TTL=&2

RepliJ

from

21U.1UU.

AU.34:

bytes=32

tine=21ms

TIL=62

Plug 210 .1S0.18.34 wltli 32 byLc^- of dlfiitci.-

Ping statjlsitics fini' 218.109.10-34:

Packets : Sent = 4, Received = 1 Lost = & <0K Idss^ Apppcxiiiiate mund trip times in rnilll-SBcands:

Minimunt = 20rts v Naxinun = 21ms P Average = 28ns

C: SDciciimentf; <nnd Settings\ftdmiraisti*atoir>

分校pi ng分校:

Pin g210.100.10.130

1 ■- - C; ■\TIfnx)T5\sysi?J2\c?(l+

Iriip^nFiAft Uinilnus; MP lf<4v H.1.2hMMT |<C> 版权所有 19e^-20Bl MlcH±<iFt Corp.

Packets - Semt - 4. Receiuedl = 4, Lost - 0 5乂 lass), A ppi'd m ima t e rcundl t i*ip t: lines in mill i—sec <an ds *Ninxpiurm ― 2Dm右-Naxinun - 21ms= 20neC: SDccuinicnts <nn <1 Cctt:insf5 \Adniri latfcoi*>pingi 21B. 1B0 . IB .138iPingIflijf 213.1S0U1B.130 忖丄

Packets - Semt - 4. Receiuedl = 4, Lost - 0 5乂 lass), A ppi'd m ima t e rcundl t i*ip t: lines in mill i—sec <an ds *

Ninxpiurm ― 2Dm右-Naxinun - 21ms= 20ne

C: SDccuinicnts <nn <1 Cctt:insf5 \Adniri latfcoi*>pingi 21B. 1B0 . IB .138

iPingIflijf 213.1S0U1B.130 忖丄th 32 bi/Les uf data-

Jtepl^ from 216.100.10.130:

KepJL号 iron 21U. 1UH.1I3.13B: 地pJL号 frovri 21U.lMHaU.13H:

BepJL号 fi*on 21B. 108.18.138:

bi?tes=3Z t ine<丄ms TTL=63 b^tes=32 timed ms TTL=63 b^tes=32 tLme<liTts TTL=63 b^tes=32 t inB<lins TIL=63

Ping stafor 218.1 BO.IB. 130:

Paclcets: Sent = 4, Received = 4审 Lost = 0 C0z loss>,

ADrki*cximate roiund trip times in milll-seconds:

Nin imuni = 0ns, Maximiun = Qins: P Aueranre = Orts

C: SDreuiFientTis and SebtinQS Mlrtnira is1?i'at7ni*i!—

Ping 210.100.10.98

p? C: XTHDOISXsyst ea32^cad. ?e

Keqis^ n t

t imied

a u t:.

Re qkie a t

七 i.mied

o ut?

Be qLic at

七 JLFIod.

o ut;?

Rc qticjst

七 xmed.

o ut:?

iPliiy fui* Zi0■丄BO.IB.98 =

FacW 占 ?

Sent = 4, Received! = 0# Lost 二 4 <190< 1qss>^

K ? \I)o u line 口 t 亍 Ic:XDccunents

刊nd Settings\Rdninisti'ator> and !>e ttings dnin istpato r>ping

Pinging 213^108^18.98 with 32 bytes of data:

HZ R-r I ■丿

K^rh.' f『I n

f Fan f ran f iron f iron!

21Q.109.18.98: bytes=32 21C.18B.18.9B:

216.18B.10.98:

21W.1CTH.1H.9R:

bytes=32 bytes=32

tine=20ms t ine=20ims t lne=19ims t ine=2Rm?j

TIL=62

TIL=62

T7L=62

TTL=62

Piney at F?i* 21S s 1 BO s 10^ 98 -

P^kclcolza" Eeint: = 4^. Rece ivod = 4# Lost = 0 <8z Iosq "ppirQ其i?)鼻七u F^utndl trip tiwi手吉 i磚 milli—^-ccoridls "

H in inuFii — 17m基鼻 Maxi.nun - 20nis Avcrd^e -

DC: SDocmnwrus 科几<1 SEtelrtHHPdwlriistFQtOFP

12.5.8思考题

i)要使总校局域网能够与分校两个局域网通信,如何配置静态路由?

分别为分校的两个网段配置静态路由,并且全部经过的连接分校交换机的路由器。

针对本实验 , 具体配置为

Router1#con

Router1(config)#ip route 210.100.10.96 255.255.255.224 210.100.10.66

Router1(config)#ip route 210.100.10.128 255.255.255.224 210.100.10.66

Router1(config)#end

2) 如果分校两个局域网分别有 20台主机, 交换机快速以太网口是否够用?如不够用, 则如何解 决该问题?

不够用,因为,交换机共有 24个 fastethernet ,其中一个作为 trunk 口,剩余 23个。若接两个

局域网,共 20*2=40 台主机, fastethernet 不够用。需要再加一个交换机或者更换一个有 41 个以

上 fastethernet 的交换机。

12.5.8实验总结与思考

在进行配置的时候, 我们各自设计了一套代码, 但是约定了接口这样在配置静态路由的时候虽 然代码不相同, 但是最终实现的效果相同, 从实验中深刻体会到了网络结构中各种层次的协议内 容的重要性

在调试的过程中, 我们配置的代码已经调通, 但是由于要用两台电脑模拟三台电脑, 因此会涉 及到换线的问题, 网线和网口接触不良也会造成实验的失败, 我们通过分段排查找到了问题所在, 其中我们也学会了要耐心细致排查错误。

在实验的过程中, 在配置电脑的IP和网关的时候,只在IP页面点了确定,但是没有在属性的那 个页面没有点确定,导致 IP 地址并没有保存上。

经过这一阶段的实验课的学习,对网络的内容了解更加深刻,也提升了自己动手实操的能力。

推荐访问:实验报告 计算机网络 东北大学 实验 东北大学计算机网络实验报告x