Design a simple campus network based on three-layer switching technology - computer network course design

1. Course Design Requirements

Design a simple campus network based on Layer 3 switching technology for the school (Hainan University). Specific requirements:

(1) Each department has a separate subnet, and the number of IP addresses required by the custom subnet has at least 4 different address scales ;

(2) Use private addresses to meet the access requirements of computers in the school, count how many C-class IP address segments are needed, and select consecutive addresses from 192.168.0.0/16 to use;

(3) Calculate the network address and mask of each department, and specify the gateway address;

(4) Each subnet has a separate VLAN, and each VLAN is interconnected using a layer-3 switch .

2. Contents of the course design report

(1) Calculate each VLAN information;

(2) Draw a network topology diagram, including nodes such as Layer 3 switches and Layer 2 switches, and label each VLAN information;

(3) Complete the switch configuration, including:

① Create a VLAN in the Layer 3 switch, assign an IP to the VLAN, and configure a Trunk link interconnected with the Layer 2 switch;

② Create a VLAN in the Layer 2 switch, configure the Trunk link interconnected with the Layer 3 switch, and experience the VLAN configuration across the Layer 2 switch.

(4) Realize the campus network prototype based on PacketTracer and test the availability of the network.

3. Campus network design

4. Theoretical analysis of design content

       The campus network designed this time adopts three-layer switching technology. The concept of three-layer exchange is proposed relative to the traditional exchange concept. As we all know, the traditional switching technology operates at the data link layer in the OSI network standard model, while the three-layer switching technology realizes high-speed forwarding of data packets in the network layer of the network model. Simply put, Layer 3 switching technology is a combination of Layer 2 switching technology and Layer 3 forwarding technology.

       The three-layer switching technology effectively solves the situation that after the network segment is divided in the LAN, the subnet in the network segment must rely on the router for management, thus solving the network bottleneck problem caused by the low speed and complexity of the traditional router.

5. Campus network design rules

5.1 Switch port connection

 Switches are connected using trunk mode interfaces, and switches are connected with hosts and servers using access mode interfaces. The Layer 3 switch connected to the intranet router needs to be changed to a routing access port.

name

interface

connected device

Layer 3 switch

FastEthernet0/1(access)

Intranet router

FastEthernet0/2(Trunk)

School of Computer Science Building Switchboard

FastEthernet0/3(Trunk)

Workplace Router

FastEthernet0/4(Trunk)

Siyuan school switch

FastEthernet0/5(Trunk)

Three Four Five Teaching Switch

FastEthernet0/6(Trunk)

R&D building switch

FastEthernet0/7(Trunk)

library switchboard

FastEthernet0/8(Trunk)

1-19 dormitory building switches

FastEthernet0/9(Trunk)

Bauhinia Zone 1-2 Exchange

External network switch

FastEthernet0/1(Trunk)

Internet router

FastEthernet0/2(access)

Extranet server

FastEthernet0/3(access)

External host

Siyuan school switch

FastEthernet0/1

FastEthernet0/2(Trunk)

School of Computer Science and Technology Switch

FastEthernet0/3(Trunk)

Three Four Five Teaching Switch

FastEthernet0/4(access)

Siyuan School Server

FastEthernet0/5(access)

Siyuan Academy Multimedia Classroom

FastEthernet0/6(access)

Siyuan Academy meeting room

Three Four Five Teaching Switch

FastEthernet0/2(Trunk)

Siyuan school switch

FastEthernet0/4(access)

Teaching building self-study room

FastEthernet0/5(access)

Teaching building server

FastEthernet0/6(access)

Teaching building computer room

R&D building switch

FastEthernet0/1(Trunk)

Layer 3 switch

FastEthernet0/2

FastEthernet0/3

FastEthernet0/4(access)

R&D Building Office

FastEthernet0/5(access)

R&D building server

FastEthernet0/6(access)

R&D building conference room

library switchboard

FastEthernet0/1(Trunk)

Layer 3 switch

FastEthernet0/7(access)

library office

FastEthernet0/3

FastEthernet0/4(access)

library server

FastEthernet0/5(access)

library study room

FastEthernet0/6(access)

Library multimedia classroom

1-19 dormitory building switches

FastEthernet0/1

FastEthernet0/2

FastEthernet0/3(Trunk)

Bauhinia Zone 1-2 Exchange

FastEthernet0/4(access)

1-19 building management room

FastEthernet0/5(access)

1-19 dormitory servers

FastEthernet0/6(access)

1-19 bedrooms

Bauhinia Zone 1-2 Exchange

FastEthernet0/1(Trunk)

Layer 3 switch

FastEthernet0/2(Trunk)

1-19 dormitory building switches

FastEthernet0/3(access)

Bauhinia bedroom

FastEthernet0/4(access)

Management Office of Bauhinia Building

FastEthernet0/5(access)

Bauhinia server

School of Computer Science and Technology Switch

FastEthernet0/1(Trunk)

Layer 3 switch

FastEthernet0/2(Trunk)

Siyuan school switch

FastEthernet0/3(access)

School of Computer Science Academic Affairs Office

FastEthernet0/4(access)

Experimental computer room of School of Computer Science

FastEthernet0/5(access)

School of Computer Science Study Room

FastEthernet0/6(access)

School of Computer Science Server

5.2   WLAN子网划分情况

        在三层交换机中创建出VLAN 1,VLAN 2,VLAN 3,VLAN 4,VLAN 5,VLAN 6,VLAN 7,VLA8这8个VLAN,并对各个VLAN的ip进行设置。而后在校园网内其余的二层交换机对各个主要建筑物中的各个部门进行子网的划分,将相同的部门划分为一个单独的VLAN。

VLAN名称

部门名称

相应的网络号

VLAN 1

办公室

192.168.1.0

VLAN 2

机房

192.168.2.0

VLAN 3

自习室

192.168.3.0

VLAN 4

楼管室

192.168.4.0

VLAN 5

寝室

192.168.5.0

VLAN 6

多媒体教室

192.168.6.0

VLAN 7

服务器

192.168.7.0

WLAN 8

会议室

192.168.8.0

5.3  IP地址的划分使用

1)C类地址简介

①C类地址第1字节、第2字节和第3个字节为网络地址,第4个个字节为主机地址。另外第1个字节的前三位固定为110。

②C类地址范围:192.0.0.0到223.255.255.255。

③C类私有地址:在C类地址中,192.168.0.0到192.168.255.255是私有地址。

(2)各部门所得C类地址如下表所示:

部门名称

IP范围

子网掩码

网关

办公室

192.168.1.2---192.168.1.4

255.255.255.0

192.168.1.1/24

机房

192.168.2.2---192.168.2.3

255.255.255.0

192.168.2.1/24

自习室

192.168.3.2---192.168.3.4

255.255.255.0

192.168.3.1/24

楼管室

192.168.4.2---192.168.4.3

255.255.255.0

192.168.4.1/24

寝室

192.168.5.2---192.168.5.3

255.255.255.0

192.168.5.1/24

多媒体教室

192.168.6.2---192.168.6.3

255.255.255.0

192.168.6.1/24

服务器

192.168.7.2---192.168.7.9

255.255.255.0

192.168.7.1/24

会议室

192.168.8.2---192.168.8.3

255.255.255.0

192.168.8.1/24

表3 各部门IP地址分配表

(3)IP地址的计算

在外网的配置上,采用210.37.40.1----210.37.40.3共3个公用C类IP地址,内网路由器和外网路由器的配置上采用193.1.1.1,193.1.1.2共2个公用C类IP地址。,192.168.100.1,192.168.100.2共2个私有C类IP地址。其中193.168.100.2配置给三层交换机的f0/1端口,在此之前需将其转换为路由端口。

结合子网划分所使用的所有C类IP地址,经计算,总共使用31个C类地址,其中26个C类私有地址,5个C类公有地址

6、网络拓扑图

        在模拟仿真软件Cisco Packet Tracer中,根据上述的设计方案,并且使用相应的配置命令,对各个主机,服务器,路由器,交换机进行配置。该网络拓扑图中使用了1台三层交换机,7台二层交换机,8台服务器,17台计算机设备,交换机与主机和服务器之间使用直通线相连,交换机与交换机之间使用交叉线相连。

        由于空间的限制,该网络拓扑图无法完全模拟出校园网的实际情况,只能表示出海南大学校园网的大致分配情况。在该图中,用一台主机表示由若干台主机组成的集合体,一台服务器表示若干台服务器的集合体。

7、各设备IP配置详情

7.1   对各主机的IP配置

名称

详细设备

IP地址

子网掩码

默认网关

办公室

计科学院教务办公室

192.168.1.2

255.255.255.0

192.168.1.1

研发楼办公室

192.168.1.3

255.255.255.0

图书馆办公室

192.168.1.4

255.255.255.0

机房

计科学院实验机房

192.168.2.2

255.255.255.0

192.168.2.1

教学楼机房

192.168.2.3

255.255.255.0

楼管室

1-19栋楼管室

192.168.4.2

255.255.255.0

192.168.4.1

紫荆1-2区楼管室

192.168.4.3

255.255.255.0

寝室

1-19栋寝室

192.168.5.2

255.255.255.0

192.168.5.1

紫荆1-2区寝室

192.168.5.3

255.255.255.0

多媒体教室

思源学堂多媒体教室

192.168.6.2

255.255.255.0

192.168.6.1

图书馆多媒体教室

192.168.6.3

255.255.255.0

自习室

计科学院楼自习室

192.168.3.2

255.255.255.0

192.168.3.1

教学楼自习室

192.168.3.3

255.255.255.0

图书馆自习室

192.168.3.4

255.255.255.0

会议室

思源学堂会议室

192.168.8.2

255.255.255.0

192.168.8.1

研发楼会议室

192.168.8.3

255.255.255.0

表4 各主机配置表

7.2  对各服务器的IP配置

名称

IP地址

子网掩码

默认网关

计科学院服务器

192.168.7.2

255.255.255.0

192.168.7.1

思源学堂服务器

192.168.7.3

255.255.255.0

教学楼服务器

192.168.7.4

255.255.255.0

研发楼服务器

192.168.7.5

255.255.255.0

图书馆服务器

192.168.7.6

255.255.255.0

1-19栋寝室服务器

192.168.7.7

255.255.255.0

紫荆服务器

192.168.7.8

255.255.255.0

海南大学总服务器

192.168.7.9

255.255.255.0

表5 各服务器的IP配置

7.3  对路由器的配置

路由器配置信息表格如下:

名称

接口

IP地址

外网路由器R1

FastEthernet0/0

210.37.40.1

Serial 0/0

193.1.1.1

内网路由器R2

Serial 0/0

193.1.1.2

FastEthernet0/0

192.168.100.1

表6 路由器的IP配置

7.3.1 内网路由器配置命令

Router>enable		//进入特权模式
Router#conf terminal	//进入全局模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2				//将校内网的路由器重命名为R2
R2(config)#int f0/0					//配置路由器的FastEthernet0/0接口
R2(config-if)#ip address 192.168.100.1 255.255.255.0	//设置该接口的ip
R2(config-if)#no shut
R2(config-if)#int serial 0/0			//配置路由器的Serial0/0接口
R2(config-if)#ip address 193.1.1.2 255.255.255.0	//设置该接口的ip
R2(config-if)#bandwidth 128			//设置链路带宽为128kbit/s
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#ip route 210.37.40.0 255.255.255.0 s0/0		//在路由器上添加一个针对子网210.37.40.0的静态路由
R2(config)#ip route 192.168.1.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.1.0的静态路由
R2(config)#ip route 192.168.2.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.2.0的静态路由
R2(config)#ip route 192.168.3.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.3.0的静态路由
R2(config)#ip route 192.168.4.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.4.0的静态路由
R2(config)#ip route 192.168.4.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.5.0的静态路由
R2(config)#ip route 192.168.5.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.6.0的静态路由
R2(config)#ip route 192.168.6.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.7.0的静态路由
R2(config)#ip route 192.168.7.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.7.0的静态路由
R2(config)#ip route 192.168.8.0 255.255.255.0 f0/0		//在路由器上添加一个针对子网192.168.8.0的静态路由
R2(config)#ip route 210.37.40.0 255.255.255.0 193.1.1.1  //在路由器上添加一条静态路由,当存在目标网络为210.37.40.0/24的数据包时,通过静态路由将该数据包转发到路由器R1的s0/0端口
R2(config)#router rip  //设置R2的RIP协议
R2(config)#network 192.168.100.0  
R2(config)#network 193.1.1.0   
R2(config)#int f0/0          //进行动态NAT配置
R2(config-if)#ip nat inside  //设置f0/0为内部端口
R2(config-if)#int s0/0       //设置f0/0为外部端口
R2(config-if)#ip nat outside 
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#access-list 5 permit any //设置访问列表允许内网对外网的所有访问
R2(config)#ip nat inside source list 5 interface f0/0 overload //设置网络地址转换,将内网地址转换成路由器f0/0地址端口加端口号出去
R2(config)#ip route 0.0.0.0 0.0.0.0 193.1.1.1 //设置路由器指向外网的默认路由
R2(config)#router ospf 400     //配置动态路由协议OSPF
R2(config-router)#network 193.1.1.0 0.0.0.3 area 0
R2(config-router)#default-information originate//向内网宣告默认路由信息
R2(config-router)#end

7.3.2 外网路由器配置命令

Router>enable		//进入特权模式
Router#conf terminal	//进入全局模式
Router(config)#hostname R1			//将校外网的路由器重命名为R1
R1(config-if)#int serial 0/0		//配置路由器的Serial0/0接口
R1(config-if)#ip address 193.1.1.1 255.255.255.0		//设置该接口的ip
R1(config-if)#bandwidth 128		//设置链路带宽为128kbit/s
R1(config-if)#clock rate 64000	//设置DCE设备的时钟速率
R1(config-if)#no shut
R1(config-if)#int f 0/0		//配置路由器的Serial0/0接口
R1(config-if)#ip address 210.37.40.1 255.255.255.0	//设置该接口的ip
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0		//在路由器上添加一个针对Serial0/0接口导向的默认路由
R1(config)#ip route 0.0.0.0 0.0.0.0 193.1.1.2 //在路由器上添加添加一条默认路由,当网络210.37.40.0/24中的主机向外网发送数据包时,无论目标网络为何地址,R4缺省将数据包转发到R2的S0端口
R1(config)#router rip  //设置R1的RIP协议
R1(config)#network 210.37.40.0  
R1(config)#network 193.1.1.0 
R1(config)#end

7.4 对各个交换机的配置

7.4.1 交换机配置说明

   (1)VLAN可以把同一个物理网络划分为多个逻辑网段,因此,Vlan可以抑制网络风暴,增强网络的安全性。在VLAN中,不同VLAN之间的主机通信时需要实现中继协议,即建立TRUNK(中继)。中继实现将一个数据包从PC机发出经过ACCESS端口->TRUNK端口->TRUNK->ACCESS->PC数据包,每个数据包都会打上VLAN标记,每一个VLAN标记帧包含指明自身所属VLAN的字段。802.1Q是IEEE的标准格式。802.1Q 标准允许VLAN 标记帧可以在不同厂家的交换机之间传递。如果要在CISCO(思科)交换机和其他品牌的交换机之间建立trunk链接,必须使用802.1q来使trunk正常工作。

操作语句:Switch(config)#interface fastethernet 0/1

Switch(config-if)#switchport trunk encapsulation dot1q

Switch(config-if)#switchport mode trunk

在配置Trunk链路时候应该switchport trunk encapsulation dot1q将trunk协议封装为dot1q,再用switchport mode trunk将端口模式设置为trunk。目的是在将数据送出这个互联接口前,给数据做上相应的标记(Tag)来标记这个数据是从哪一个VLAN跑出来的,这样,对端交换机在收到这个数据之后,就能够根据前者对数据所做的标记来识别数据究竟是属于哪一个VLAN的

  1. 在思科软件中透明网桥和交换机使用生成树算法,避免产生转发的帧在网络中不停的转圈。因此在连接交换机线路时,尽量避免回路,否则产生拥堵,交换机端口变成橙色

生成树算法:在连通网站中不存在回路,即在任何两个站之间只有一条路径。避免产生的帧在网络中兜圈子,生成树的根每隔一段时间对生成树拓扑进行更新。

7.4.2 对三层交换机的配置

Switch>en			//进入特权模式
Switch#conf terminal		//进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname center			//将三层交换机重命名为center
center(config)#ip routing					//启动ip路由功能
center(config)#vtp mode server			//配置vtp运行模式(此时的三层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)
Device mode already VTP SERVER.
center(config)#vtp domain test			//配置vtp域名
Domain name already set to test.
center(config-if)#exit
center(config)#vlan 1			//创建VLAN 1
center(config-vlan)#exit
center(config)#vlan 2			//创建VLAN 2
center(config-vlan)#exit
center(config)#vlan 3			//创建VLAN 3
center(config-vlan)#exit
center(config)#vlan 4			//创建VLAN 4
center(config-vlan)#exit
center(config)#vlan 5			//创建VLAN 5
center(config-vlan)#exit
center(config)#vlan 6			//创建VLAN 6
center(config-vlan)#exit
center(config)#vlan 7			//创建VLAN 7
center(config-vlan)#exit
center(config)#vlan 8			//创建VLAN 8
center(config-vlan)#exit
center(config)#int vlan 1		//配置VLAN 1
center(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
center(config-if)#ip add 192.168.1.1 255.255.255.0	//配置VLAN 1的ip
center(config-if)#no shut
center(config)#int vlan 2		//配置VLAN 2
center(config-if)#
%LINK-5-CHANGED: Interface Vlan2, changed state to up
center(config-if)#ip add 192.168.2.1 255.255.255.0	//配置VLAN 2的ip
center(config-if)#no shut
center(config)#int vlan 3		//配置VLAN 3
center(config-if)#
%LINK-5-CHANGED: Interface Vlan3, changed state to up
center(config-if)#ip add 192.168.3.1 255.255.255.0	//配置VLAN 3的ip
center(config-if)#no shut
center(config)#int vlan 4		//配置VLAN 4
center(config-if)#
%LINK-5-CHANGED: Interface Vlan4, changed state to up
center(config-if)#ip add 192.168.4.1 255.255.255.0	//配置VLAN 4的ip
center(config-if)#no shut
center(config)#int vlan 5		//配置VLAN 5
center(config-if)#
%LINK-5-CHANGED: Interface Vlan5, changed state to up
center(config-if)#ip add 192.168.5.1 255.255.255.0	//配置VLAN 5的ip
center(config-if)#no shut
center(config)#int vlan 6		//配置VLAN 6
center(config-if)#
%LINK-5-CHANGED: Interface Vlan6, changed state to up
center(config-if)#ip add 192.168.6.1 255.255.255.0	//配置VLAN 6的ip
center(config-if)#no shut
center(config)#int vlan 7		//配置VLAN 7
center(config-if)#
%LINK-5-CHANGED: Interface Vlan7, changed state to up
center(config-if)#ip add 192.168.7.1 255.255.255.0	//配置VLAN 7的ip
center(config-if)#no shut
center(config)#int vlan 8		//配置VLAN 8
center(config-if)#
%LINK-5-CHANGED: Interface Vlan8, changed state to up
center(config-if)#ip add 192.168.8.1 255.255.255.0	//配置VLAN 8的ip
center(config-if)#no shut
center(config-if)#int f0/1
center(config-if)#switchport trunk encapsulation dot1q//将trunk协议封装为dot1q
center(config-if)#switchport mode trunk//将端口模式设置为trunk
center(config-if)#int f0/2
center(config-if)#switchport trunk encapsulation dot1q//将trunk协议封装为dot1q
center(config-if)#switchport mode trunk//将端口模式设置为trunk
center(config-if)#int f0/6
center(config-if)#switchport trunk encapsulation dot1q//将trunk协议封装为dot1q
center(config-if)#switchport mode trunk//将端口模式设置为trunk
center(config-if)#int f0/7
center(config-if)#switchport trunk encapsulation dot1q//将trunk协议封装为dot1q
center(config-if)#switchport mode trunk//将端口模式设置为trunk
center(config-if)#int f0/9
center(config-if)#switchport trunk encapsulation dot1q//将trunk协议封装为dot1q
center(config-if)#switchport mode trunk//将端口模式设置为trunk
center(config-if)#int f0/3
center(config-if)#switchport mode access//将端口模式设置为access
center(config-if)#/switchport access vlan 7//将交换机的F0/3接口的划分为VLAN 7
center(config-if)#no shut					//启动该接口
center(config-if)#exit
center(config)#ip route 0.0.0.0 0.0.0.0 193.168.100.1	//在三层交换机上加入一个默认路由,使整个校园网数据报发送到R2的f0/0端口
center(config-if)#int f0/1
center(config-if)#no switchport //是f0/1成为路由端口
center(config-if)#ip add 192.168.100.2 255.255.255.0//为其配置IP地址
center(config-if)#exit
center(config)#end
center(config)#end

7.4.3 对计算机科学与技术学院交换机的配置

Switch>enable		//进入特权模式
Switch#conf terminal	//进入全局模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname academy		//将学院的交换机重命名为academy
academy(config)#vtp mode client				//配置vtp运行模式(此时的二层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)	
Setting device to VTP CLIENT mode.
academy(config)#vtp domain test				//配置vtp域名
Domain name already set to test.
academy(config)#int f0/2				//配置交换机的FastEthernet0/2接口
academy(config-if)#switchport mode trunk		//将端口模式设置为trunk
academy(config-if)#int f0/1			//配置交换机的FastEthernet0/1接口
academy(config-if)#switchport mode trunk		//将端口模式设置为trunk
academy(config-if)#int f0/3			//配置交换机的FastEthernet0/3接口
academy(config-if)#switchport access vlan 1	//将交换机的FastEthernet0/3接口的模式设为access模式,并且划分为VLAN 1
academy(config-if)#int f0/4			//配置交换机的FastEthernet0/4接口
academy(config-if)#switchport access vlan 2	//将交换机的FastEthernet0/4接口的模式设为access模式,并且划分为VLAN 2
academy(config-if)#int f0/5					//配置交换机的FastEthernet0/5接口
academy(config-if)#switchport access vlan 3	//将交换机的FastEthernet0/5接口的模式设为access模式,并且划分为VLAN 3
academy(config-if)#int f0/6					//配置交换机的FastEthernet0/6接口
academy(config-if)#switchport access vlan 7	//将交换机的FastEthernet0/6接口的模式设为access模式,并且划分为VLAN 7
academy(config-if)#exit
academy(config)#end

7.4.4 对思源学堂交换机的配置

Switch>enable        //进入特权模式
Switch#conf terminal  //进入全局模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname hall   //将思源学堂的交换机重命名为hall
hall(config)#vtp mode client  //配置vtp运行模式(此时的二层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)
Setting device to VTP CLIENT mode.
hall(config)#vtp domain test   //配置vtp域名
Domain name already set to test.
hall(config-if)#int f0/3    //配置交换机的FastEthernet0/3接口
hall(config-if)#switchport mode Trunk
hall(config-if)#int f0/4   //配置交换机的FastEthernet0/4接口
hall(config-if)#switchport access vlan 7
hall(config-if)#int f0/2   //配置交换机的FastEthernet0/2接口
hall(config-if)#switchport mode Trunk
hall(config-if)#int f0/5  //配置交换机的FastEthernet0/5接口
hall(config-if)#switchport access vlan 6
hall(config-if)#int f0/6  //配置交换机的FastEthernet0/6接口
hall(config-if)#switchport access vlan 8
hall(config-if)#exit
hall(config)#end

7.4.5 对三四五教学交换机配置

Switch>enable
Switch#conf terminal
Switch(config)#hostname classroom	//将三四五教学交换机重命名为classroom

classroom(config)#vtp mode client  //配置vtp运行模式(此时的二层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)
Setting device to VTP CLIENT mode.
classroom(config)#vtp domain test	//配置vtp域名
Domain name already set to test.
classroom(config-if)#int f0/2	//配置交换机的FastEthernet0/2接口

classroom(config-if)#switchport mode Trunk
classroom(config-if)#int f0/4	//配置交换机的FastEthernet0/4接口

classroom(config-if)#switchport access vlan 3 //将交换机的FastEthernet0/4接口的模式设为access模式,并且划分为VLAN 3
classroom(config-if)#int f0/5	//配置交换机的FastEthernet0/5接口
	
classroom(config-if)#switchport access vlan 7//将交换机的FastEthernet0/5接口的模式设为access模式,并且划分为VLAN 7
classroom(config-if)#int f0/6	//配置交换机的FastEthernet0/6接口

classroom(config-if)#switchport access vlan 2//将交换机的FastEthernet0/6接口的模式设为access模式,并且划分为VLAN 2
classroom(config-if)#exit
classroom(config)#end

7.4.6 对研发楼交换机配置

Switch>enable
Switch#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname research	//将研发楼交换机重命名为research

research(config)#vtp mode client	//配置vtp运行模式(此时的二层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)
Setting device to VTP CLIENT mode.
research(config)#vtp domain test	//配置vtp域名
Domain name already set to test.
research(config)#int f0/1	//配置交换机的FastEthernet0/1接口
research(config-if)#switchport mode Trunk
research(config-if)#int f0/4	//配置交换机的FastEthernet0/4接口
research(config-if)#switchport access vlan 1/将交换机的FastEthernet0/4接口的模式设为access模式,并且划分为VLAN 1
research(config-if)#int f0/6	//配置交换机的FastEthernet0/6接口
research(config-if)#switchport access vlan 8/将交换机的FastEthernet0/6接口的模式设为access模式,并且划分为VLAN 8
research(config-if)#int f0/5	//配置交换机的FastEthernet0/5接口
research(config-if)#switchport access vlan 7/将交换机的FastEthernet0/5接口的模式设为access模式,并且划分为VLAN 7
research(config-if)#exit 
research(config)#end

7.4.7 对图书馆交换机配置

Switch>enable
Switch#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname library		//将图书馆交换机重命名为 library
library(config)#vtp mode client		//配置vtp运行模式(此时的二层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)
Setting device to VTP CLIENT mode.
library(config)#vtp domain test			//配置vtp域名
Domain name already set to test.
library(config)#int f0/1		//配置交换机的FastEthernet0/1接口
library(config-if)#switchport mode Trunk	//将端口模式设置为trunk
library(config-if)#int f0/4		//配置交换机的FastEthernet0/4接口
library(config-if)#switchport access vlan 7		/将交换机的FastEthernet0/4接口的模式设为access模式,并且划分为VLAN 7
research(config-if)#exit 

library(config-if)#int f0/5		//配置交换机的FastEthernet0/5接口
library(config-if)#switchport access vlan 3		/将交换机的FastEthernet0/5接口的模式设为access模式,并且划分为VLAN 3
research(config-if)#exit 

library(config-if)#int f0/7		//配置交换机的FastEthernet0/7接口
library(config-if)#switchport access vlan 1			/将交换机的FastEthernet0/7接口的模式设为access模式,并且划分为VLAN 1
research(config-if)#exit 

library(config-if)#int f0/6		//配置交换机的FastEthernet0/6接口
library(config-if)#switchport access vlan 6		/将交换机的FastEthernet0/6接口的模式设为access模式,并且划分为VLAN 6
research(config-if)#exit 

library(config-if)#exit
library(config)#end

7.4.8 对1-19栋宿舍楼交换机配置

Switch>enable
Switch#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vtp mode client	//配置vtp运行模式(此时的二层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)
Switch(config)#vtp domain test		//配置vtp域名
Switch(config-if)#int f0/3		//配置交换机的FastEthernet0/1接口
Switch(config-if)#switchport mode Trunk
Switch(config-if)#int f0/4		//配置交换机的FastEthernet0/4接口
Switch(config-if)#switchport access vlan 4
Switch(config-if)#int f0/6		//配置交换机的FastEthernet0/6接口
Switch(config-if)#switchport access vlan 5
Switch(config-if)#int f0/5		//配置交换机的FastEthernet0/5接口
Switch(config-if)#switchport access vlan 7
Switch(config-if)#exit
Switch(config)#end

7.4.9 对紫荆1-2区宿舍楼交换机配置

Switch>enable
Switch#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vtp mode client		//配置vtp运行模式(此时的二层交换机既可以学习VLAN也可以让其他的二层交换机学习它的VLAN)
Setting device to VTP CLIENT mode.
Switch(config)#vtp domain test		//配置vtp域名
Domain name already set to test.
Switch(config)#int f0/1	//配置交换机的FastEthernet0/1接口

Switch(config-if)#switchport mode Trunk	//将端口模式设置为trunk
Switch(config-if)#int f0/2	//配置交换机的FastEthernet0/2接口

Switch(config-if)#switchport mode Trunk	//将端口模式设置为trunk
Switch(config-if)#int f0/3	//配置交换机的FastEthernet0/3接口

Switch(config-if)#switchport access vlan 5		/将交换机的FastEthernet0/3接口的模式设为access模式,并且划分为VLAN 5
research(config-if)#exit 

Switch(config-if)#int f0/4		//配置交换机的FastEthernet0/4接口

Switch(config-if)#switchport access vlan 4		/将交换机的FastEthernet0/4接口的模式设为access模式,并且划分为VLAN 4
research(config-if)#exit 

Switch(config-if)#int f0/5	//配置交换机的FastEthernet0/5接口

Switch(config-if)#switchport access vlan 7		/将交换机的FastEthernet0/5接口的模式设为access模式,并且划分为VLAN 7
research(config-if)#exit 

Switch(config-if)#exit
Switch(config)#end

7.4.10 对外网交换机的配置

Switch>enable
Switch#conf terminal
Switch#hostname outline
outsideline(config-if)#int f0/1//配置交换机的FastEthernet0/1接口
outsideline(config-if)#switchport mode Trunk		//将端口模式设置为trunk
outsideline(config-if)#end

8、测试

测试部分可以参考以下网址(包含完整报告文档和pkt文件)

设计一个简单的基于三层交换技术的校园网络——计算机网络课程设计-网络基础文档类资源-CSDN下载

Guess you like

Origin blog.csdn.net/weixin_54082335/article/details/126579939