实验7 用路由器实现不同VLAN间路由
更新时间:2023-09-29 08:20:01 阅读量: 综合文库 文档下载
- 实验班提优训练推荐度:
- 相关推荐
实验7 用路由器实现不同VLAN间路由
【实验名称】 通过路由器的以太口实现VLAN间路由
【实验目的】 掌握如何通过路由器的以太口实现VLAN间路由。
【背景描述】 假设某企业有2个主要部门:销售部和技术部,已经实现了把他们划分到了不同的局域网上,但他们之间需要相互进行通信,进行相互通讯,现要使用路由器对不同vlan的流量进行路由来实现这一目标。
【实现功能】 每个vlan里接一根线出来接到路由器的以太网口上,在路由器上配置合适的IP地址,利用路由器的路由功能来实现不同网段vlan流量的通讯。
【实验设备】 S2126G(1台)、R1762或RSR10路由器(1台)
【实验拓扑】
F0/0
192.168.10.1
router
F0/1
192.168.20.1
PC1
F0/5
F0/6 F0/16
PC2
switch
F0/15
192.168.10.1xx 255.255.255.0 192.168.10.1
Vlan10 Vlan20
192.168.20.1xx 255.255.255.0 192.168.20.1
【实验步骤】
第一步:在交换机SwitchA上创建Vlan 10,并将0/1-8端口划分到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 range fastethernet 0/1-8 !进入接口配置模式。 SwitchA(config-if)#switchport access vlan 10 !将0/1-8端口划分到Vlan 10。
验证测试:验证已创建了Vlan 10,并将0/1-8端口已划分到Vlan 10中。 SwitchA#show vlan id 10
VLAN Name Status Ports ---- -------------------------------- --------- -------------------------------
10 sales active Fa0/1, Fa0/2,Fa0/3, Fa0/4, Fa0/5, Fa0/6,Fa0/7, Fa0/8,
第二步:在交换机SwitchA上创建Vlan 20,并将0/9-16端口划分到Vlan 20中。 SwitchA(config)# vlan 20 !创建Vlan 20。
SwitchA(config-vlan)# name technical !将Vlan 20命名为technical。 SwitchA(config-vlan)#exit
SwitchA(config)#interface range fastethernet 0/9-16 !进入接口配置模式。 SwitchA(config-if)#switchport access vlan 20 !将0/15端口划分到Vlan 20。
验证测试:验证已创建了Vlan 20,并将0/9-16端口已划分到Vlan 20中。 SwitchA#show vlan id 20
VLAN Name Status Ports ---- -------------------------------- --------- -------------------------------
20 technical active Fa0/9, Fa0/10,Fa0/11, Fa0/12, Fa0/13 Fa0/14,Fa0/15, Fa0/16,
第三步:在路由器router上配置端口IP地址: Router >en 14 !进入特权模式。 Password: (打上star,此处不显示,照打就是) !输入特权密码 Router #configure ter !进入全局配置模式。 Router(config)#interface fastethernet 1/0 !进入接口配置模式。 Router(config-if) #ip address 192.168.10.1 255.255.255.0 !配置IP地址及子网掩码。 Router(config-if)#no shutdown !开启端口。 Router(config-if)#exit !退出端口配置模式 Router(config)#interface fastethernet 1/1 !进入端口配置模式 Router(config-if) #ip address 192.168.20.1 255.255.255.0 !配置IP地址及子网掩码。 Router(config-if)#no shutdown !开启端口。 Router(config-if)#exit !退出端口配置模式 Router(config)#
验证测试:验证路由器接口IP地址配置及路由表。 R1#show ip interface brief
Interface IP-Address(Pri) OK? Status FastEthernet 0/0 192.168.10.1/24 YES UP FastEthernet 0/1 192.168.20.1/24 YES UP
R1#show ip route
Codes: C - connected, S - static, R - RIP B - BGP 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
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default
Gateway of last resort is no set
C 192.168.10.0/24 is directly connected, FastEthernet 0/0 C 192.168.10.1/32 is local host.
C 192.168.20.0/24 is directly connected, FastEthernet 0/1 C 192.168.20.1/32 is local host.
第四步:配置两台PC机 PC1的测试网卡配置如下:
PC2的测试网卡配置如下:
第五步:验证PC1与PC2能互相通信。
C:\\Documents and Settings\\Administrator>ping 192.168.20.100 !在PC1的命令行方式下验证能Ping通PC2 。 Pinging 192.168.20.100 with 32 bytes of data:
Reply from 192.168.20.100: bytes=32 time<1ms TTL=128 Reply from 192.168.20.100: bytes=32 time<1ms TTL=128 Reply from 192.168.20.100: bytes=32 time<1ms TTL=128 Reply from 192.168.20.100: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.20.100:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\\Documents and Settings\\Administrator>ping 192.168.10.100 !在PC2的命令行方式下验证能Ping通PC1 。 Pinging 192.168.20.100 with 32 bytes of data:
Reply from 192.168.10.100: bytes=32 time<1ms TTL=128 Reply from 192.168.10.100: bytes=32 time<1ms TTL=128 Reply from 192.168.10.100: bytes=32 time<1ms TTL=128 Reply from 192.168.10.100: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.10.100:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
第六步:测试结果
通过路由器的路由,使得不同vlan的主机可以相互通讯。
【注意事项】
? 需要设置PC的网关(即为上游路由器接口的IP地址)
正在阅读:
实验7 用路由器实现不同VLAN间路由09-29
微机原理习题集以及答案第二版06-13
八年级语文下册 第12课《我们的知识是有限的》教案(新版)苏教05-31
6.产品成本计算的基本方法--成品法 - 题及答案03-13
SS4改与SS7E型电力机车受电弓的特性比较 - 图文01-25
小学教师师德师风学习心得体会04-22
老年糖尿病的死因分析及康复护理防治措施07-23
HPLC方法验证03-15
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 路由
- 路由器
- 不同
- 实验
- 实现
- VLAN
- 输电线路三段式电流保护的构成及动作过程
- 水土保持生态建设工程监理常用表格
- 数据结构实验二叉树
- 卢新宁:我唯一的害怕 - 在北大中文系毕业典礼上的致辞
- 肿瘤标志物的应用及其筛选技术研究进展 - 李策 pdf
- 利乐UHT故障情况描述与解决措施汇总
- 营改增纳税人纳税申报指引(八):小规模纳税人 doc
- 黄骅港自然条件
- 神福港中学乡村学校少年宫建设工作自查报告
- 2010-2011学年度第二学期四年级班主任工作计划
- 英语语法之动词
- 高考化学考点解析全程复习考点: 硫酸工业 环境保护
- 2016年高三英语红桥一模试卷
- 商业银行整理最新版
- 一年级的小朵朵阅读题
- 单层门式轻钢结构工程施工组织设计施工方案
- 六年级语文下册 第14课诺曼底号遇难记同步练习 上海版五四制
- 文言句式练习
- 机械设计制造及其自动化专业就业前景分析
- 中考数学知识点 三角函数专题专练 三角函数精选练习题