实验报告-利用单臂路由实现VLAN间的路由

更新时间:2023-06-02 21:16:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

简要介绍资料的主要内容,以获得更多的关注

课程实训报告

课程名称: 实训题目: 专 业: 学生姓名: 组 号:

部 门:学 期: 《局域网组建与维护》

利用单臂路由实现VLAN间路由 计算机网络技术 班 级: 10网络2班

罗 涛 张祖豪

任课教师: 黄 斌

信息技术系 2011-2012学年第一学期

计算机网络技术教研室 制

简要介绍资料的主要内容,以获得更多的关注

目 录

一、实验分工 ............................................. 3 二、项目目的 ............................................. 3 三、背景描述 ............................................. 3 四、需求分析 ............................................. 3 五、项目拓扑 ............................................. 4 六、实验设备 ............................ 错误!未定义书签。 七、实验步骤 ............................................. 4 八、测试文档 ............................................. 8 九、注意事项 ............................................. 9

简要介绍资料的主要内容,以获得更多的关注

一、实验分工

二层交换机:罗涛 工程文档: 张祖豪 设备连线测试: 张祖豪

二、项目目的

掌握如何在路由器端口上划分子端口、封装Dot1q(IEE 802.1q)协议、实现VLAN间的路由。

三、背景描述

假设某企业有两个主要部门:销售部和技术部,员工都连接在1台二层交换机上,网络内有1台路由器用于连接Internet。现在发现网络内的广播流量太多,需要对广播进行限制但不能影响2部门进行相互通信,要再路由器上做适当配置来实现这一目标。

四、需求分析

需要在交换机上配置VLAN,然后在路由器连接交换机的端口上划分子接口,给相应的VLAN设置IP地址,以实现VLAN间

-1

的路由。

简要介绍资料的主要内容,以获得更多的关注

五、项目拓扑

六、实验设备

七、实验步骤

步骤1:配置交换机的主机名,划分VLAN和添加端口、设置Trunk。

Switch>en Switch#conf ter

Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname l2-sw l2-sw (config)#vlan 10 l2-sw (config-vlan)#exit l2-sw (config)#vlan 20 l2-sw (config-vlan)#exit l2-sw (config)#int f0/6

l2-sw (config-if)#swit access vlan 10

简要介绍资料的主要内容,以获得更多的关注

l2-sw (config-if)#exit l2-sw (config)#int f0/11

l2-sw (config-if)#swit acc vlan 20 l2-sw (config-if)#exit l2-sw (config)#int f0/1

l2-sw (config-if)#swit mode trunk l2-sw (config-if)#end

步骤2: 在路由器上删除IP记录、划分子接口、配置IP地址。

Router>en Router#conf ter

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int f0/0 Router(config-if)#no ip addr Router(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#exit Router(config)#int f0/0.10 Router(config-subif)#

%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up

Router(config-subif)#encapsu dot1q 10

Router(config-subif)#ip addr 192.168.10.1 255.255.255.0 Router(config-subif)#exit

简要介绍资料的主要内容,以获得更多的关注

Router(config)#int f0/0.20

%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to up

Router(config-subif)#encapsu dot1q 20

Router(config-subif)#ip addr 192.168.20.1 255.255.255.0 Router(config-subif)#end

步骤3:查看交换机的VLAN和Trunk配置。

l2-sw#show vlan

VLAN Name Status Ports

------------------------------------------------------- 1 default active Fa0/2,Fa0/3,Fa0/4,Fa0/5 Fa0/7,Fa0/8,Fa0/9,Fa0/10 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 10 VLAN0010 active Fa0/6 20 VLAN0020 active Fa0/11 l2-sw#show int f 0/1 switchport Name: Fa0/1

Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk

Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On

简要介绍资料的主要内容,以获得更多的关注

Access Mode VLAN: 1 (default)

Trunking Native Mode VLAN: 1 (default) Voice VLAN: none

Administrative private-vlan host-association: none Administrative private-vlan mapping: none

Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Appliance trust: none

步骤4:查看路由器的路由表

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, 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, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set

C 192.168.10.0/24 is directly connected, FastEthernet0/0.10

简要介绍资料的主要内容,以获得更多的关注

C 192.168.20.0/24 is directly connected, FastEthernet0/0.20

八、测试文档

1、本机配置查看

给PC1和PC2分配配置192.168.10.0/24 和 192.168.20.0/24网段内的IP地址,分别以192.168.10.1和192.168.20.1作为网关。如图:

PC1:

PC2:

2、连接状态测试

从PC1上ping所属的VLAN的网关、VLAN 20的网关和PC2的结果,如下图所示、说明配置单臂路由以后,网络已经全部实现互联互通。

简要介绍资料的主要内容,以获得更多的关注

九、注意事项

(1)在给路由器的子接口设置IP地址前,一定要先封装dot1q协议。 (2)各个VLAN内的主机,要以相应VLAN子接口的IP地址作为网关。

本文来源:https://www.bwwdw.com/article/ab01.html

Top