网络互连实验报告(思科模拟器)

  • 格式:docx
  • 大小:870.84 KB
  • 文档页数:12

《网络互联设计课程实验报告》 16 / 17 学年第二学期姓名:_学号:_班级:指导教师:计算机科学与工程学院2017【实验目的】熟练应用所学知识来实现三种状态:全网连通状态、远程登录状态和流量控制状态。

【背景描述】某校园网中,接入层设备采用二层交换机,汇聚层设备采用三层交换机,在接入交换机上划分了办公子网 VLAN20 和学生子网 VLAN30,在汇聚交换机上划分了服务器子网 VLAN10,为了保证网络的稳定性,接入层和汇聚层通过两条链路相连。

汇聚层交换机与 RouterA 相连,RouterA 与 RouterB 相连,RouterB 连接到 ISP,通过 ISP 连接到 Internet,另外在 RouterB 上连有一台主机 PC4,禁止 VLAN30 网段的主机访问 PC4,其他通过路由协议,实现全网互通。

另外,为了网管人员管理设备方便,要求在任意主机上都能远程登录任意一台交换机或路由器。

【实验器材】1)思科模拟器【实验过程】A:实现全网连通状态二层交换机的配置spanning-tree mode pvst 生成树协议interface FastEthernet0/1 0/1接口划分到vlan20 switchport access vlan 20interface FastEthernet0/2 0/2接口划分到vlan30 switchport access vlan 30!interface FastEthernet0/3 0/3接口和0/4接口开启trunk switchport mode trunk 模式作为冗余接口interface FastEthernet0/4switchport mode trunk三层交换机的配置ip routing 开启路由功能!spanning-tree mode pvst 生成树协议interface FastEthernet0/1 0/1接口划分到vlan10 switchport access vlan 10!interface FastEthernet0/2 0/2 0/3 0/4接口开启trunk switchport mode trunk 模式!interface FastEthernet0/3switchport trunk encapsulation dot1qswitchport mode trunk!interface FastEthernet0/4switchport trunk encapsulation dot1qswitchport mode trunk!interface Vlan10 为三个vlan分配IP地址(不ip address 192.168.1.190 255.255.255.192 同网段)!interface Vlan20ip address 192.168.1.62 255.255.255.192!interface Vlan30ip address 192.168.1.126 255.255.255.192在二层交换机中配置VLANSwitch#conf terEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 20Switch(config-vlan)#name teacherSwitch(config-vlan)#exitSwitch(config)#interface fast 0/1Switch(config-if)#switchport access vlan 20Switch(config-if)#exitSwitch(config)#vlan 30Switch(config-vlan)#name studentSwitch(config-vlan)#interface fast 0/2Switch(config-if)#switchport access vlan 30Switch(config-if)#exitSwitch(config)#int vlan20Switch(config-if)#Switch(config-if)#ip address 192.168.1.62 255.255.255.192 Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#int vlan30Switch(config-if)#ip address 192.168.1.127 255.255.255.192 Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#在三层交换机中配置VLANSwitch(config)#vlan 10Switch(config-vlan)#name serverSwitch(config-vlan)#exitSwitch(config)#vlan 20Switch(config-vlan)#name teacherSwitch(config-vlan)#exitSwitch(config)#vlan 30Switch(config-vlan)#name sutdentSwitch(config-vlan)#exitSwitch(config)#interface fast 0/1Switch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#int vlan 10Switch(config-if)#%LINK-5-CHANGED: Interface Vlan10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upSwitch(config-if)#ip add 192.168.1.190 255.255.255.192Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#int vlan 20Switch(config-if)#%LINK-5-CHANGED: Interface Vlan20, changed state to upSwitch(config-if)#ip add 192.168.1.62 255.255.255.192Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#int vlan 30Switch(config-if)#%LINK-5-CHANGED: Interface Vlan30, changed state to upSwitch(config-if)#ip add 192.168.1.126 255.255.255.192Switch(config-if)#no shutdownSwitch(config-if)#exit(将连接到路由器的端口改为trunk模式)Switch(config)#interface fast 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport mode trunk在三(二)层交换机中配置svi和生成树协议Switch(config)#interface fast 0/3Switch(config-if)#switchport mode trunkCommand rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.(不能直接转换为trunk,所以先转换为access)Switch(config-if)#switchport mode accessSwitch(config-if)#switchport mode trunkSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to upSwitch(config-if)#interface fast 0/4Switch(config-if)#switchport mode accessSwitch(config-if)#switchport mode trunkSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to upSwitch(config-if)#exit在router0上实现单臂路由配置Router#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#int f 0/0Router(config-if)#no ip addRouter(config-if)#duplex autoRouter(config-if)#speed autoRouter(config-if)#exitRouter(config)#int fast 0/0.1Router(config-subif)#%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to upRouter(config-subif)#enc dot1q 20Router(config-subif)#ip add 192.168.1.62 255.255.255.192Router(config-subif)#int f 0/0.2Router(config-subif)#%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to upRouter(config-subif)#enc dot1q 30Router(config-subif)#ip add 192.168.1.126 255.255.255.192Router(config-subif)#int f 0/0.3Router(config-subif)#%LINK-5-CHANGED: Interface FastEthernet0/0.3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.3, changed state to upRouter(config-subif)#enc dot1q 10Router(config-subif)#ip add 192.168.1.190 255.255.255.192Router(config-subif)#int f 0/0Router(config-if)#no shutdownRouter(config-if)#分别配置两台路由器的静态路由Router0Router1A:全网通测试结果(以测试机PC0【192.168.1.1】为例)Server0:192.168.1.129Pc1:192.168.1.65Pc2:192.168.4.1B: 远程登录状态开启两台路由器的远程登录Router#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#line vty 0 4Router(config-line)#password 123456Router(config-line)#loginRouter(config-line)#exitRouter(config)#enable password 123456Router(config)#endRouter#两台交换机分配网段(192.168.1.192.0)为VLAN1分配地址1.二层交换机switch1(config)#int vlan1switch1(config-if)#ip address 192.168.1.193 255.255.255.192switch1(config)#line vty 0 4switch1(config-line)#password 123456switch1(config-line)#loginswitch1(config-line)#exitswitch1(config)#enable password 123456switch1(config)#end2.三层交换机switch1(config)#int vlan1switch1(config-if)#ip address 192.168.1.194 255.255.255.192switch1(config)#line vty 0 4switch1(config-line)#password 123456switch1(config-line)#loginswitch1(config-line)#exitswitch1(config)#enable password 123456switch1(config)#end3.Route0分配一个子端口Router(config)#int fast 0/0.4Router(config-subif)#enc dot1q 1Router(config-subif)#ip add 192.168.1.254 255.255.255.192Router(config-subif)#exitRouter(config)#B:远程登录测试结果(以测试机PC2【192.168.4.1】为例)Router1:192.168.4.254Router0:192.168.3.1switch2:192.168.1.194switch1:192.168.1.193C: 流量控制状态在route1中配置访问控制列表router1#conf tEnter configuration commands, one per line. End with CNTL/Z. router1(config)#access-list 1 deny 192.168.1.64 0.0.0.63 router1(config)#access-list 1 permit anyrouter1(config)#int fast 0/0router1(config-if)#ip access-group 1 outrouter1(config-if)#exitrouter1(config)#C:远程登录测试结果(教师子网通,学生子网不通)【实验总结】在本次实验中,比较困难的地方在于全网通信,其中重点是三层交换机和二层交换机之间的svi虚拟接口技术,三层交换机和路由器之间的单臂路由配置,还有三层路由器上的192.168.1.0要划分成为四个字网,分别配置给学生子网、教师子网、服务器和交换机远程管理。