实验50:
单臂路由实现VLAN 间路由
1.
实验目的
通过本实验,读者可以掌握如下技能:
(1)
路由器以太网接口上的子接口
(2)
单臂路由实现VLAN 间路由的配置
2.
实验拓扑
拓扑图
3.
实验步骤
Switch#vlan da
% 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.
Switch(vlan)#vlan 2 name cisco
VLAN 2 added:
Name: cisco
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/1
Switch(config-if)#switch mode trunk//
把
f0/1
配置成
TRUNK
模式
Switch(config-if)#exit
Switch(config)#int f0/2
Switch(config-if)#switch mode access
Switch(config-if)#switch access vlan 2//
把
f0/2
划分到
VLAN2
Switch(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config)#int f0/0
Router(config-if)#ip add 172.16.2.1 255.255.255.0
Router(config-if)#no sh
%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.1
创建子接口
%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)#enca dot1q 2
封装
DOT1Q,2
代表
VLAN2
Router(config-subif)#ip add 172.16.1.1 255.255.255.0
Router(config-subif)#no sh
Router(config-subif)#
PC1:
PC>ping 172.16.2.1
Pinging 172.16.2.1 with 32 bytes of data:
Reply from 172.16.2.1: bytes=32 time=110ms TTL=255
Reply from 172.16.2.1: bytes=32 time=63ms TTL=255
Reply from 172.16.2.1: bytes=32 time=63ms TTL=255
Reply from 172.16.2.1: bytes=32 time=63ms TTL=255
Ping statistics for 172.16.2.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 63ms, Maximum = 110ms, Average = 74ms
PC>ping 172.16.2.2
Pinging 172.16.2.2 with 32 bytes of data:
Reply from 172.16.2.2: bytes=32 time=78ms TTL=127
Reply from 172.16.2.2: bytes=32 time=125ms TTL=127
Reply from 172.16.2.2: bytes=32 time=125ms TTL=127
Reply from 172.16.2.2: bytes=32 time=125ms TTL=127
Ping statistics for 172.16.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 78ms, Maximum = 125ms, Average = 113ms
PC>
PC0:
PC>ping 172.16.1.2
Pinging 172.16.1.2 with 32 bytes of data:
Reply from 172.16.1.2: bytes=32 time=172ms TTL=127
Reply from 172.16.1.2: bytes=32 time=110ms TTL=127
Reply from 172.16.1.2: bytes=32 time=125ms TTL=127
Reply from 172.16.1.2: bytes=32 time=125ms TTL=127
Ping statistics for 172.16.1.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 110ms, Maximum = 172ms, Average = 133ms
PC>
本文出自 “柯浩坚” 博客,转载请与作者联系!