您的位置:首页 > 其它

单臂路由实验

2016-12-14 15:39 162 查看
单边路由实验
解决了用一个路由器完成两个VLAN之间的通信。
实验器材:一台交换机 一台录由器 两台电脑。还有些双胶线。
实验过程:
1:连线 ,把PC1,PC2 分别连到交换机的0/1,0/2号端口。把交换机的0/10号端口和路由器的0/1号端口相连。
2:进行交换机和路由器的一些配置。

switch(config)#enab
switch(config)#enable pass
switch(config)#enable password 123
switch(config)#vlan 10
switch(config-vlan)#exit
switch(config)#vlan 20
switch(config-vlan)#exit
switch(config-vlan)#int fa0/1
switch(config-if)#sw acc vlan 10
switch(config-if)#exit
switch(config)#int fa0/2
switch(config-if)#sw acc vlan 20
switch(config-if)#exit
switch(config)#int fa0/10
switch(config-if)#sw mode trunk
switch(config-if)#end
录由器的配置:
router(config-if)#
router(config-if)#exit
router(config)#int fa0/1.1
router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/1.1, changed state to up

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

router(config-subif)#ip add 1.1.1.254 255.255.255.0

% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.

router(config-subif)#
router(config-subif)#encpa
router(config-subif)#encap
router(config-subif)#encapsulation dot1
router(config-subif)#encapsulation dot1Q
router(config-subif)#encapsulation dot1Q 1
router(config-subif)#encap
router(config-subif)#encapsulation dot
router(config-subif)#encapsulation dot1Q 10
router(config-subif)#ip add 1.1.1.254 255.255.255.0
router(config-subif)#no shut
router(config-subif)#exit
router(config)#int fa0/1.2

%LINK-5-CHANGED: Interface FastEthernet0/1.2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1.2, changed state to up
router(config-subif)#encap
router(config-subif)#encapsulation dot
router(config-subif)#encapsulation dot1Q 20
router(config-subif)#ip add 2
^
% Invalid input detected at '^' marker.
router(config-subif)#ip add 2.2.2.254 255.255.255.0
3;给两台电脑分别设置 IP分别为1.1.1.1 255.255.255.0 和 2.2.2.2 255.255.255.0
4:测试两台电脑间能否PING通。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息