实验十二小型校园网的设计与组建
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台主机,交换机快速以太网口是否够用?如不够用,
则如何解决该问题?
一、实验设计
IP 地址分配表
网段
总校
网络号
子网掩码
子网号 起始 IP 地址
结束 IP 地址
210.100.10.32
路由器之间 210.100.10.64
210.100.10.96
分校网段 1
分校网段 2
210.100.10.128
255.255.255.224
255.255.255.224
255.255.255.224
255.255.255.224
001
010
011
100
210.100.10.33
210.100.10.65
210.100.10.97
210.100.10.129
210.100.10.62
210.100.10.94
210.100.10.126
210.100.10.158
各主机 IP 地址、子网掩码、网关设置:
255.255.255.224
主校主机: 210.100.10.33
分校主机 1:210.100.10.97
255.255.255.224
分校主机 2:210.100.10.129 255.255.255.224
210.100.10.53
210.100.10.107
210.100.10.139
网络拓扑图:
S0
210.100.10.66
F 0/24
S0
F0
210.100.10.65
210.100.10.53
F 0/24
分校局域网
总校局域网
VLAN10= 210.100.10.107
VLAN20=210.100.10.139
IP
210.100.10.97~106
子网掩码 255.255.255.224
210.100.10.129~138
IP
子网掩码 255.255.255.224
IP
210.100.10.33~52
子网掩码 255.255.255.224
二、实验配置
(一)分校的交换机和路由器配置
分校交换机配置
//进入特权模式
SwitchA>enable 14
Password:star
SwitchA#configure terminal //进入全局配置模式
SwitchA(config)#vlan 10
SwitchA(config-vlan)#exit
SwitchA(config)#vlan 20
SwitchA(config-vlan)#exit
switchA(config)#interface range fastEthernet 0/1-10
switchA(config-if-range)#switchport access vlan 10
SwitchA(config-if)#exit
SwitchA(config)#interface range fastethernet 0/11-20
SwitchA(config-if-range)#switchport access vlan 20
SwitchA(config-if)#exit
SwitchA(config)#interface fastethernet 0/24
SwitchA(config-if)#switchport mode trunk
SwitchA(config-if)#end
SwitchA#show vlan
//对 switchA 的配置进行验证
VLAN Name
---- -------------------------------- --------- -------------------------------
1
10
static
static
dd
sales
Status
Ports
Fa0/21,Fa0/22,Fa0/23,Fa0/24
Fa0/1 ,Fa0/2 ,Fa0/3 ,Fa0/4
Fa0/5 ,Fa0/6 ,Fa0/7 ,Fa0/8
Fa0/9 ,Fa0/10,Fa0/24
Fa0/11,Fa0/12,Fa0/13,Fa0/14
Fa0/15,Fa0/16,Fa0/17,Fa0/18
Fa0/19,Fa0/20,Fa0/24
20
technical
static
分校路由器配置
//显示路由端口
R2632>enable 14
Password:star
RSR20#show ip interface brief
RSR20#configure terminal
RSR20(config)#interface serial 2/0
RSR20(config-if)#ip address 210.100.10.66 255.255.255.224
RSR20(config-if)#clock rate 64000
RSR20(config-if)#no shutdown
RSR20(config-if)#exit
//为广域网0口配置地址
RSR20(config)#interface fastEthernet 0/0
RSR20 (config-if)#no ip address
RSR20 (config-if)#no shutdown
RSR20 (config-if)#exit
RSR20 (config)#interface fastEthernet 0/0.10
//进入子接口,以太网 0 口配置地址,即配置虚拟接口 vlan 10 的地址为
RSR20 (config-subif)#encapsulation dot1Q 10//封装 802.1Q 并制定 VLAN 号 10
RSR20 (config-subif)#ip address 210.100.10.107 255.255.255.224//配置子接口 IP 地址
RSR20 (config-subif)#exit
RSR20 (config)#interface fastEthernet 0/0.20//进入子接口 F20 配置模式
RSR20 (config-subif)#encapsulation dot1Q 20
RSR20 (config-subif)#ip address 210.100.10.139 255.255.255.224
RSR20 (config-subif)#end
Configured from console by console
RSR20#show ip interface brief
//对分校路由器配置验证
IP-Address(Pri)
210.100.10.66/27
no address
210.100.10.139/27
210.100.10.107/27
no address
no address
Interface
serial 2/0
serial 3/0
FastEthernet 0/0.20
FastEthernet 0/0.10
FastEthernet 0/0
FastEthernet 0/1
为 Router1 添加静态路由
R2632# configure terminal
R2632(config)#ip route 210.100.10.32 255.255.255.224 210.100.10.65
R2632(config)#end
R2632#show ip route
OK?
YES
YES
YES
YES
YES
YES
Status
UP
DOWN
UP
UP
DOWN
DOWN
Codes: C - connected, S - static, R - RIP
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
* - candidate default
Gateway of last resort is no set
S
C
C
C
C
C
C
R2632 CON0 is now available
Press RETURN to get started
210.100.10.32/27 [1/0] via 210.100.10.65
210.100.10.64/27 is directly connected, serial 4/0
210.100.10.66/32 is local host.
210.100.10.96/27 is directly connected, FastEthernet 3/0.10
210.100.10.97/32 is local host.
210.100.10.128/27 is directly connected, FastEthernet 3/0.20
210.100.10.129/32 is local host.
(二)主校交换机和路由器配置
主校交换机配置
switch>enable 14
Password:star
switch#show vlan
VLAN Name
---- -------------------------------- --------- -------------------------------
1
default
Status
active
Ports
Fa0/1 ,Fa0/2 ,Fa0/3 ,Fa0/4
Fa0/5 ,Fa0/6 ,Fa0/7 ,Fa0/8
Fa0/9 ,Fa0/10,Fa0/11,Fa0/12
Fa0/13,Fa0/14,Fa0/15,Fa0/16
Fa0/17,Fa0/18,Fa0/19,Fa0/20
Fa0/21,Fa0/22,Fa0/23,Fa0/24
//创建 vlan
switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)#vlan 30
switch(config-vlan)#exit
switch(config)#exit
switch#configure
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)#interface range fastEthernet 0/1-20
switch(config-if-range)#switchport access vlan 30
switch(config-if-range)#exit
Switch (config)# interface fastethernet 0/24
Switch (config-if)# switchport mode trunk //配置 trunk 端口
Switch (config-if)# end
//将 1-20 端口划入 vlan30 中
//对 switchA 的配置进行验证
switch#show vlan
VLAN Name
---- -------------------------------- --------- -------------------------------
1
default
Status
active
Ports
Fa0/21,Fa0/22,Fa0/23,Fa0/24,
30
VLAN0030
active
Fa0/1 ,Fa0/2 ,Fa0/3 ,Fa0/4
Fa0/5 ,Fa0/6 ,Fa0/7 ,Fa0/8
Fa0/9 ,Fa0/10,Fa0/11,Fa0/12
Fa0/13,Fa0/14,Fa0/15,Fa0/16
Fa0/17,Fa0/18,Fa0/19,Fa0/20
Fa0/24
主校路由器配置
IP-Address(Pri)
no address
no address
no address
no address
//查看路由器的端口
OK?
YES
YES
YES
YES
RSR20>enable 14
Password:star
RSR20#show ip interface brief
Interface
serial 2/0
serial 3/0
FastEthernet 0/0
FastEthernet 0/1
RSR20#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RSR20(config)#interface fastEthernet 0/0
RSR20(config-if)#no ip address
RSR20(config-if)#no shutdown
RSR20(config-if)#exit
RSR20(config)#interface fastEthernet 0/0.30
RSR20(config-subif)#encapsulation dot1Q 30
RSR20(config-subif)#ip address 210.100.10.53 255.255.255.224
RSR20(config-subif)#end
RSR20#show ip interface brief
Interface
serial 2/0
serial 3/0
FastEthernet 0/0.30
FastEthernet 0/0
FastEthernet 0/1
RSR20# configure terminal
RSR20(config)#interface serial 2/0
RSR20(config-if)#ip address 210.100.10.65 255.255.255.224
RSR20(config-if)#no shutdown
RSR20 (config-if)#end
RSR20#show ip interface brief
Interface
serial 2/0
serial 3/0
FastEthernet 0/0.30
FastEthernet 0/0
FastEthernet 0/1
RSR20#configure terminal
RSR20(config)#ip route 210.100.10.96
表
RSR20(config)#ip route 210.100.10.128 255.255.255.224 210.100.10.66
RSR20(config)#end
IP-Address(Pri)
no address
no address
210.100.10.53/27
no address
no address
OK?
YES
YES
YES
YES
YES
IP-Address(Pri)
210.100.10.65/27
no address
210.100.10.53/27
no address
no address
OK?
YES
YES
YES
YES
YES
Status
UP
DOWN
UP
DOWN
DOWN
Status
DOWN
DOWN
DOWN
DOWN
Status
DOWN
DOWN
UP
DOWN
DOWN
255.255.255.224
210.100.10.66 //写入静态路由
RSR20#
Configured from console by console
RSR20#show ip route
Codes: C - connected, S - static, R - RIP
//对主校路由器配置验证
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
* - candidate default
Gateway of last resort is no set
C
C
C
C
S
S
210.100.10.32/27 is directly connected, FastEthernet 3/0.30
210.100.10.53/32 is local host.
210.100.10.64/27 is directly connected, serial 4/0
210.100.10.65/32 is local host.
210.100.10.96/27 [1/0] via 210.100.10.66
210.100.10.128/27 [1/0] via 210.100.10.66
分校主机 1 配置情况:
分校主机 2 配置情况:
主校主机配置情况: