【网络设备配置与管理实验十】VLAN 间路由配置

一、实验目的

通过本实验,可以掌握以下技能:

  • VLAN间路由

二、设备需求

  • Cisco路由器1台, 交换机1台
  • 2台PC机,以及Console电缆及转接器

三、拓扑结构及配置说明

实验的拓扑结构

各路由器使用的接口及其编号见图所示的标注,各接口IP地址分配如下:

  • PC0-sjt:192.168.1.2 默认网关192.168.1.1
  • PC1-sjt:192.168.0.2 默认网关192.168.0.1
  • Router1-sjt:Fa0/0.14 192.168.0.1 Fa0/0.15 192.168.1.1
  • SW1:Fa2/1 VLAN14 Fa1/1 VLAN15

四、实验配置文档

1.PC配置

PC0-sjt:

PC0-sjt

PC1-sjt:

PC1-sjt

2.交换机SW1配置

Switch>enable 
Switch#conf
Switch#configure ter
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostn
Switch(config)#hostname SW1-sjt
SW1-sjt(config)#exit
SW1-sjt#
%SYS-5-CONFIG_I: Configured from console by console
SW1-sjt#vl
SW1-sjt#vlan da
SW1-sjt#vlan database 
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.
SW1-sjt(vlan)#vlan 14
VLAN 14 added:
    Name: VLAN0014
SW1-sjt(vlan)#vlan 15
VLAN 15 added:
    Name: VLAN0015
SW1-sjt(vlan)#exit
APPLY completed.
Exiting....
SW1-sjt#
SW1-sjt#conf
SW1-sjt#configure ter
SW1-sjt#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
SW1-sjt(config)#in
SW1-sjt(config)#interface F
SW1-sjt(config)#interface FastEthernet 1/1
SW1-sjt(config-if)#sw
SW1-sjt(config-if)#switchport ac
SW1-sjt(config-if)#switchport access v
SW1-sjt(config-if)#switchport access vlan 14
SW1-sjt(config-if)#exit
SW1-sjt(config)#int
SW1-sjt(config)#interface F
SW1-sjt(config)#interface FastEthernet 2/1
SW1-sjt(config-if)#sw
SW1-sjt(config-if)#switchport ac
SW1-sjt(config-if)#switchport access vl
SW1-sjt(config-if)#switchport access vlan 15
SW1-sjt(config-if)#exit
SW1-sjt(config)#in
SW1-sjt(config)#interface F
SW1-sjt(config)#interface FastEthernet 0/1
SW1-sjt(config-if)#sw
SW1-sjt(config-if)#switchport mo
SW1-sjt(config-if)#switchport mode tr
SW1-sjt(config-if)#switchport mode trunk 
SW1-sjt(config-if)#end
SW1-sjt#
%SYS-5-CONFIG_I: Configured from console by console
SW1-sjt#

3.配置路由器Router

Router>en
Router>enable 
Router#conf
Router#configure ter
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int
Router(config)#interface F
Router(config)#interface FastEthernet 0/0
Router(config-if)#no shut
Router(config-if)#no shutdown 
Router(config-if)#
%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
Router(config)#interface F
Router(config)#interface FastEthernet 0/0.14
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.14, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.14, changed state to up
Router(config-subif)#en
Router(config-subif)#encapsulation do
Router(config-subif)#encapsulation dot1Q 14
Router(config-subif)#ip address 192.168.0.1 255.255.255.0
Router(config-subif)#exit
Router(config)#int
Router(config)#interface F
Router(config)#interface FastEthernet 0/0.15
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.15, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.15, changed state to up
en
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 15
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router(config-subif)#exit
Router(config)#

五、验证实验结果

1.show ip route

该命令显示路由器的IP路由选择表,详细指出了路由器是如何获悉网络和发现路由的,该命令如下:

show ip route

2.show vlan

show vlan

3.ping 指令的使用

PC0-sjt去pingPC1-sjt,成功ping通

ping 192.168.0.2

PC1-sjt去pingPC0-sjt,成功ping通

ping 192.168.1.2

六、实验总结

  1. 学习了VLAN以及如何配置VLAN
  2. 了解了单臂路由器VLAN间路由,并学会了如何配置单臂路由器VLAN间路由
  3. 单臂路由器路由器最重要的就是Trunk链路,所以一定要在指定接口设置中继

七、附件

下面给出该实验的文件

链接:https://pan.baidu.com/s/1ouJDZgqMEfU8bnseV57w8g 密码:5ls6

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值