网络互联实验报告
发布时间:2021-04-01 03:48:49
发布时间:2021-04-01 03:48:49
《网络互联技术》
实 验 报 告
姓 名 陈衍席
院 (系) 数学与计算机
专 业 网工二班
学 号 1205110125
指导教师 桂兵祥
1 跨交换机VLAN实现实验 一.实验目的 的特点。理解跨交换机之间VLAN 二.背景描述其中销售部门的个人计算机系统分散假设某企业有两个主要部门:销售部和技术部,销售部和技术部需要进行相互连接,他们之间需要相互进行通信,但为了数据安全起见, 隔离,现要在交换机上做适当配置来实现这一目标。 三.技术原理内是基于交换机端口的另外一种类型,主要用于实现跨交换机的相同VLANTag VlanIEEE802.1qVlan遵循了主机之间可以直接访问,同时对于不同VLAN的主机进行隔离。Tag
个4协议的标准。在利用配置了Tag vlan的接口进行数据传输时,需要在数据帧内添加,以便于对端交换机接收到数VLAN字节的802.1q标签信息,用于标识该数据帧属于哪个 据帧后进行准确的过滤。 四.实现功能里的计算机里的计算机系统能跨交换机进行相互通信,使在同一VLAN而在不同VLAN 系统不能进行相互通信。 五.实验设备 、直连线(4条)S2126G(两台)、主机(3台) 六.实验拓扑
实验时,按照拓扑图进行网络的连接,注意主机和交换机连接的端口。 七.实验步骤SwitchA#configure terminal
SwitchA(config)# vlan 10
SwitchA(config-vlan)# name sales
SwitchA(config-vlan)#exit
SwitchA(config)#interface fastethernet0/5
SwitchA(config-if)#switchport access vlan 10
Vlan 10中。,并将0/5端口已划分到验证测试:验证已创建了Vlan 10SwitchA#show vlan id 10 的信息 !查看某一个VLANVlan 20中。 0/15Vlan 20switchA 步骤1.在交换机上创建,并将端口划分到SwitchA(config)# vlan 20
SwitchA(config-vlan)# name technical
SwitchA(config-vlan)#exit
SwitchA(config)#interface fastethernet0/15
SwitchA(config-if)#switchport access vlan 20
Vlan 20中。验证已创建了Vlan 20,并将0/15端口已划分到验证测试:SwitchA#show vlan id 20
tag vlan定义为SwitchB相连的端口(假设为0/24端口)步骤2. 把交换机SwitchA与交换机 模式。SwitchA(config)#interface fastethernet0/24
SwitchA(config-if)#switchport mode trunk
tag vlan模式!将fastethernet 0/24端口设为 模式。tag vlan验证测试:验证fastethernet 0/24端口已被设置为SwitchA#show interfaces fastEthernet0/24 switchport
。交换机的Trunk接口默认情况下支持所有VLAN注: 中。0/5端口划分到Vlan 10上创建步骤3. 在交换机SwitchBVlan 10,并将SwitchB # configure terminal
SwitchB(config)# vlan 10
SwitchB(config-vlan)# name sales
SwitchB(config-vlan)#exit
SwitchB(config)#interface fastethernet0/5
SwitchB(config-if)#switchport access vlan 10
端口已划分到Vlan 10中。SwitchB验证测试:验证已在上创建了Vlan 10,并将0/5SwitchB#show vlan id 10
tag vlan端口)定义为SwitchASwitchB与交换机相连的端口(假设为0/24步骤4. 把交换机 模式。SwitchB(config)#interface fastethernet0/24
SwitchB(config-if)#switchport mode trunk
模式。端口已被设置为tag vlan验证测试:验证fastethernet 0/24SwitchB#show interfaces fastEthernet 0/24 switchport
PC3不能互相通信。能互相通信,但PC2与PC1步骤5. 验证与PC3C:\>ping 192.168.10.30 !在PC1的命令行方式下验证能Ping通PC3
C:\>ping 192.168.10.30 ! 在PC2的命令行方式下验证不能Ping通PC3
八.实验总结
首先,交换机配置之前必须要进行初始化,相连的端口应为tag vlan模式才能保证数据通畅,因为Trunk接口在默认情况下支持所有Vlan;实验配置好后用两台PC进行互相PING验证试验结果.
实验2 交换机冗余备份/端口聚合
一.实验目的
协议,理解链路聚合的配置及原理。802.3ad掌握交换机的特及二.背景描述
假设某企业采用2台交换机组成一个局域网,由于很多数据流量是跨过交换机进行传送的,因此需要提高交换机之间的传输带宽,并实现链路冗余备份,为此网络管理员在2台交换机之间采用2根网线互连,并将相应的2个端口聚合为一个逻辑端口,现要在交换机上做 适当配置来实现这一目标。三.实现功能
使网络管理员可通过Telnet管理交换机,增加交换机之间的传输带宽,并实现链路冗余 备份。四.实验拓扑图
五.实验设备
台)2S2126G(六.实验步骤
步骤1配置交换机管理接口的IP地址
1.进入交换机的全局配置模式
2.配置交换机的设备名,设备名分别为SwitchA;SwitchB
1.进入配置Vlan1 接口子模式,命令:
2.配置Vlan1 接口的IP地址为 192.168.1.1(SwitchA); 192.168.1.1(SwitchB)
4.启用Vlan1接口;
5.查看Vlan1接口的信息,并记录结果。
6.配置PC1机的IP地址为192.168.1.10;
7.在PC机上ping 192.168.1.1;是否ping 通?
步骤2在PC机上通过Telnet访问交换机
1. 配置远程登录密码 enable secret level 1 0 star (0表示明文1表示密文)
2. 从PC机telnet登录到交换机
步骤3在交换机SwitchA上创建Vlan 10,并将0/5端口划分到Vlan 10中。
SwitchA#configure terminal !进入全局配置模式
SwitchA(config)#vlan 10 !创建Vlan 10
SwitchA(config-vlan)#name sales !将Vlan 10命名为sales
SwitchA(config-vlan)#exit
SwitchA(config)#interface fastethernet 0/5 !进入接口配置模式
SwitchA(config-if)#switchport access vlan 10 !将0/5端口划分到Vlan10
中Vlan 10端口已划分到0/5,并将Vlan10验证测试:验证已创建了.
SwitchA#show vlan id 10
步骤3在交换机SwitchA上配置聚合端口。
SwitchA(config)#interface aggregateport 1 !创建聚合接口AGI
SwitchA(config-if)#switchport mode trunk !配置AG模式为trunk
SwitchA(config-if)#exit
SwitchA(config)#interface range fastethernet 0/1-2 !进入接口0/1和0/2
SwitchA(config-if)#port-group 1 !配置接口0/1和0/2属于AGI
验证测试:验证接口fastethernet 0/1和0/2属于AG1
SwitchA#show aggregatePort 1 summary
步骤4在交换机SwithcB上创建Vlan 10,并将0/5端口划分到Vlan 10中。
SwitchB#configure terminal !进入全局配置模式
SwitchB(config)#vlan 10 !创建Vlan 10
SwitchB(config-vlan)#name sales !将Vlan 10命名为sales
SwitchB(config)#interface fastethernet 0/5 !进入接口配置模式
SwitchB (config-if)#switchport access vlan 10 !将0/5端口划分到Vlan10
验证测试:验证已在SwitchB上创建了Vlan10,并将0/5端口已划分到Vlan 10中
SwitchB#show vlan id 10
步骤5在交换机SwitchB上配置聚合端口。
SwitchB(config)#interface aggregateport 1 !创建聚合接口AGI
SwitchB(config-if)#switchport mode trunk !配置AG模式为trunk
SwitchB(config-if)#exit
SwitchB(config)#interface range fastethernet 0/1-2 !进入接口0/1和0/2
SwitchB(config-if)#port-group 1 !配置接口0/1和0/2属于AGI
验证测试:验证接口fastethernet 0/1和0/2属于AG1
SwitchB#show aggregatePort 1 summary
步骤6验证当交换机之间的一条链路断开时,PC1与PC2仍能互相通信。
PC3通PC1的命令行方式下验证能PingC:\>ping 192.168.10.30 –t !在七.实验总结
在实验中练习了vlan的创建,trunk模式的配置等,最后顺利完成实验。在实践中我明白了只有同类型端口才能聚合为一个端口,实验要注意命令的输入正确与否.
实验3 路由器编号的标准访问列表
一.实验目的
掌握编号的标准IP访问列表规则及配置
二.背景描述
你是公司的网络管理员,公司的经理部,财务部和销售部门分属不同的三个网段,三部门之间用路由器进行信息传递,为了安全起见,公司的领导要求销售部门不能对财务部门进行访问,但经理部可以对财务部门进行访问。
实现功能:实现网段间互相访问的安全控制.
三.实验拓扑
四.实验设备
路由器(一台)或R2620R2624五.实验步骤
步骤1基本配置。
Red – Giant>
Red – Giant> enable
Red – Giant# configure terminal
Red – Giant(config)# hostname R1
R1(config)# interface fastEthernet 0
R1(config – if)# ip add 192.168.1.1 255.255.255.0
R1(config – if)# no sh
R1(config – if)# interface fastEthernet 1
R1(config – if)# ip add 192.168.2.1 255.255.255.0
R1(config – if)# no sh
R1(config – if)# interface fastEthernet 3
R1(config – if)# ip add 192.168.3.1 255.255.255.0
R1(config – if)# no sh
R1(config – if)# end
测试命令:show ip interface brief !观察接口状态
R1# sh ip int brief
步骤2配置标准IP访问控制列表。
R1(config)# access – list 1 deny 192.168.1.0 0.0.0.255 !拒绝来自192.168.1.0网段的流量通过。
R1(config)# access – list 1 permit 192.168.3.0 0.0.0.255 !允许来自192.168.3.0网段的流量通过。
验证测试:
show access – lists 1
R1# sh access – lists 1
把访问控制列表在接口下应用。3步骤.
R1(config)# interface fastEthernet 1
R1(config – if)# ip access – group 1 out !在接口下访问控制列表出栈流量调用
验证测试:
show ip access – lists 1
ping(192.168.1.0网段的主机不能ping通192.168.2.0网段的主机;192.168.3.0网段的主 。网段的主机)ping通192.168.2.0机能六.实验总结
实验中标准控制列表的编号是从1~99,在访问控制列表的网络掩码是反掩码,我也了解了反掩码的知识。从实验中了解了标准访问控制列表应该尽量靠近目的地址的接口,以尽可能扩大源网络访问的范围。
实验4 路由器编号的扩展IP访问列表
一.实验目的
访问列表规则及配置。IP掌握编号的扩展二.背景描述
你是学校的网络管理员,学校规定每年新入学的学生时所在的网段不能通过学校的FTP服务器上网,学校规定新生所在网段是172.16.10.0/24,学校服务器所在网段是 。172.16.20.0/24三.实现功能
实现对网络服务访问的安全控制。四.实验拓扑图
五.实验设备
。1台)R2624或R2620路由器(六.实验步骤
步骤1基本配置。
Red – Giant# configure terminal
Red – Giant(config)# interface fastEthernet 0
Red – Giant(config – if)# ip address172.16.10.1 255.255.255.0
if)# no shutdown
– Giant(config –Red
Red – Giant(config – if)# exit
Red – Giant(config)# interface fastEthernet 1
Red – Giant(config – if)# ip address127.16.20.1 255.255.255.0
Red – Giant(config – if)# no shutdown
Red – Giant(config – if)# end
验证测试
Red – Giant# sh ip interface brief !观察接口状态
步骤2配置扩展IP访问控制列表。
Red – Giant(config)# access – list 101 deny tcp 172 . 16 . 10 . 0 0 . 0 . 0 . 255 172.16.20.0
0.0.0.255 eq ftp
!禁止规定网段对服务器进行www访问
Ged – Giant#show access – lists 101
步骤3把访问控制列表在接口下应用。
Red – Giant(config)# interface fastEthernet 0
Red – Giant(config – if)# ip access – group 101 in !访问控制列表在接口下in 方向应用
Red – Giant(config – if)# end
验证测试
show ip interface f 0七.实验总结
对于标准的访问控制列表,扩展的ACL应用规则应尽量把数据流限制在离发源网络近的地点,尽可能减少从源网络流出的无效数据流占用的网络带宽。值得注意的是deny某个网段后要permit其他网段。
实验5 路由器命名的访问列表
一.实验目的
访问列表规则及配置掌握命名的标准IP二.背景描述
你是学校的网络管理员,在3550 – 24交换机上连着学校的提供学习资料的服务器,另外还连接着学生宿舍楼和教工宿舍楼,学校规定学生只能访问学习资料存放的服务器,学生 宿舍楼不能访问教工宿舍楼三.实现功能
实现网段间互相访问的安全控制。四.实验设备
台)(1–S3550 24
五.实验步骤
步骤1基本配置。
3550 – 48 (config) # vlan 10
3550 – 48(config – vlan)# name server
# vlan 20
)config( 48–3550
3550 – 48(config – vlan)# name teachers
3550 – 48(config)# vlan 30
3550 – 48(config – vlan)# name students
3550 – 48(config)# interface f 0/10
3550 – 48(config – if)# switchport mode access
3550 – 48(config – if)#switchport access vlan 10
3550 – 48(config)# interface f 0/20
3550 – 48(config – if)# switchport mode access
3550 – 48(config – if)#switchport access vlan 20
3550 – 48(config)# interface f 0/30
3550 – 48(config – if)# switchport mode access
3550 – 48(config – if)#switchport access vlan 30
3550 – 48 (config) #interface vlan10
3550 – 48 (config – if) # ip address192.168.10.1 255.255.255.0
3550 – 48 (config – if) # no shutdown
3550 – 48 (config – if) #interface vlan20
3550 – 48 (config – if) # ip address192.168.20.1 255.255.255.0
3550 – 48 (config – if) # no shutdown
3550 – 48 (config – if) #interface vlan30
3550 – 48 (config – if) # ip address 192.168.30.1 255.255.255.0
3550 – 48 (config – if) # no shutdown
步骤2配置命名标准IP访问控制列表。
3550 – 48(config)# ip access – list standard denystudent !定义命名访问控制列表
3550 – 48(config – std – nacl)#deny 192.168.30.0 0.0.0.255 !定义列表匹配的条件
3550 –48(config – std – nacl)#permit any !允许其他流量通过
验证命令
3550 – 48# show ip access – lists denystudent
步骤3把访问控制列表在接口下应用。
3550 – 48(config)# interface vlan 20
在接口出方向应用 group denystudent out !– if) #ip access –3550 – 48 (config
六.实验总结
实验中了解到交换机的端口只支持in方向的数据流控制,命名ACL不使用编号而使用字符串来定义规则,但是deny某个网段后也要permit其他网段。