1. コース設計の要件
学校 (海南大学) 向けに、レイヤー 3 スイッチング テクノロジーに基づいたシンプルなキャンパス ネットワークを設計します。特定の要件:
(1) 各部門には個別のサブネットがあり、カスタム サブネットに必要な IP アドレスの数には少なくとも4 つの異なるアドレス スケールがあります。
(2)学校内のコンピュータのアクセス要件を満たすためにプライベート アドレスを使用し、必要な C クラス IP アドレス セグメントの数を数え、 192.168.0.0/16から連続したアドレスを選択して使用します。
(3) 各部門のネットワークアドレスとマスクを計算し、ゲートウェイアドレスを指定します。
(4) 各サブネットには個別の VLAN があり、各 VLAN はレイヤー 3 スイッチを使用して相互接続されます。
2. コースデザインレポートの内容
(1) 各 VLAN 情報を計算します。
(2) レイヤ 3 スイッチやレイヤ 2 スイッチなどのノードを含むネットワーク トポロジ図を作成し、各 VLAN 情報にラベルを付けます。
(3) 以下を含むスイッチ構成を完了します。
① レイヤ 3 スイッチに VLAN を作成し、その VLAN に IP を割り当て、レイヤ 2 スイッチと相互接続するトランク リンクを構成します。
② レイヤ 2 スイッチに VLAN を作成し、レイヤ 3 スイッチと相互接続するトランクリンクを設定し、レイヤ 2 スイッチ全体の VLAN 構成を体験します。
(4) PacketTracer に基づいたキャンパスネットワークのプロトタイプを実現し、ネットワークの可用性をテストします。
3. キャンパスネットワーク設計
4. 設計内容の理論的分析
今回設計したキャンパスネットワークは3層スイッチング技術を採用。3 層交換の概念は、従来の交換の概念に対して提案されています。ご存知のとおり、従来のスイッチング技術はOSIネットワーク標準モデルのデータリンク層で動作しますが、3層スイッチング技術はネットワークモデルのネットワーク層でデータパケットの高速転送を実現します。簡単に言えば、レイヤー 3 スイッチング テクノロジーは、レイヤー 2 スイッチング テクノロジーとレイヤー 3 転送テクノロジーを組み合わせたものです。
3 層スイッチング技術は、LAN 内でネットワーク セグメントが分割された後、ネットワーク セグメント内のサブネットの管理をルータに依存しなければならないという状況を効果的に解決し、ネットワークの低速性と複雑さによって引き起こされるネットワークのボトルネック問題を解決します。従来のルーター。
5. キャンパスネットワーク設計ルール
5.1 スイッチポートの接続
スイッチはトランク モード インターフェイスを使用して接続され、スイッチはアクセス モード インターフェイスを使用してホストおよびサーバーに接続されます。イントラネット ルータに接続されているレイヤ 3 スイッチをルーティング アクセス ポートに変更する必要があります。
名前 |
インターフェース |
接続されたデバイス |
|
レイヤ3スイッチ |
FastEthernet0/1(アクセス) |
イントラネットルーター |
|
FastEthernet0/2(トランク) |
コンピュータサイエンス学部棟配電盤 |
||
FastEthernet0/3(トランク) |
職場ルーター |
||
FastEthernet0/4(トランク) |
思源学校スイッチ |
||
FastEthernet0/5(トランク) |
三四五ティーチングスイッチ |
||
FastEthernet0/6(トランク) |
研究開発棟スイッチ |
||
FastEthernet0/7(トランク) |
図書館配電盤 |
||
FastEthernet0/8(トランク) |
1-19 寮棟スイッチ |
||
FastEthernet0/9(トランク) |
バウヒニア ゾーン 1-2 交換 |
||
外部ネットワークスイッチ |
FastEthernet0/1(トランク) |
インターネットルーター |
|
FastEthernet0/2(アクセス) |
エクストラネットサーバー |
||
FastEthernet0/3(アクセス) |
外部ホスト |
||
思源学校スイッチ |
ファストイーサネット0/1 |
||
FastEthernet0/2(トランク) |
情報理工学部スイッチ |
||
FastEthernet0/3(トランク) |
三四五ティーチングスイッチ |
||
FastEthernet0/4(アクセス) |
思源学校サーバー |
||
FastEthernet0/5(アクセス) |
思源学院マルチメディア教室 |
||
FastEthernet0/6(アクセス) |
思源学院会議室 |
||
三四五ティーチングスイッチ |
FastEthernet0/2(トランク) |
思源学校スイッチ |
|
FastEthernet0/4(アクセス) |
教棟自習室 |
||
FastEthernet0/5(アクセス) |
教務棟サーバー |
||
FastEthernet0/6(アクセス) |
教棟コンピュータ室 |
||
研究開発棟スイッチ |
FastEthernet0/1(トランク) |
レイヤ3スイッチ |
|
ファストイーサネット0/2 |
|||
ファストイーサネット0/3 |
|||
FastEthernet0/4(アクセス) |
研究開発棟事務室 |
||
FastEthernet0/5(アクセス) |
研究開発棟サーバー |
||
FastEthernet0/6(アクセス) |
研究開発棟 会議室 |
||
図書館配電盤 |
FastEthernet0/1(トランク) |
レイヤ3スイッチ |
|
FastEthernet0/7(アクセス) |
図書館事務室 |
||
ファストイーサネット0/3 |
|||
FastEthernet0/4(アクセス) |
ライブラリサーバー |
||
FastEthernet0/5(アクセス) |
図書館自習室 |
||
FastEthernet0/6(アクセス) |
図書館マルチメディア教室 |
||
1-19 寮棟スイッチ |
ファストイーサネット0/1 |
||
ファストイーサネット0/2 |
|||
FastEthernet0/3(トランク) |
バウヒニア ゾーン 1-2 交換 |
||
FastEthernet0/4(アクセス) |
1-19ビル管理室 |
||
FastEthernet0/5(アクセス) |
1-19 寮サーバー |
||
FastEthernet0/6(アクセス) |
1~19ベッドルーム |
||
バウヒニア ゾーン 1-2 交換 |
FastEthernet0/1(トランク) |
レイヤ3スイッチ |
|
FastEthernet0/2(トランク) |
1-19 寮棟スイッチ |
||
FastEthernet0/3(アクセス) |
バウヒニアの寝室 |
||
FastEthernet0/4(アクセス) |
バウヒニアビル管理事務所 |
||
FastEthernet0/5(アクセス) |
バウヒニアサーバー |
||
情報理工学部スイッチ |
FastEthernet0/1(トランク) |
レイヤ3スイッチ |
|
FastEthernet0/2(トランク) |
思源学校スイッチ |
||
FastEthernet0/3(アクセス) |
情報科学部教務室 |
||
FastEthernet0/4(アクセス) |
情報科学部実験計算機室 |
||
FastEthernet0/5(アクセス) |
情報科学部自習室 |
||
FastEthernet0/6(アクセス) |
コンピュータサイエンス学部サーバー |
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的
- 在思科软件中透明网桥和交换机使用生成树算法,避免产生转发的帧在网络中不停的转圈。因此在连接交换机线路时,尽量避免回路,否则产生拥堵,交换机端口变成橙色
生成树算法:在连通网站中不存在回路,即在任何两个站之间只有一条路径。避免产生的帧在网络中兜圈子,生成树的根每隔一段时间对生成树拓扑进行更新。
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文件)