目录
实验项目:
单臂路由的配置
实验器材:
router 2621XM一台、switch 2960-24TT两台、pc四台、直通线六根。
实验目的:
学习思科的单臂路由简单配置,学习VLAN的划分。
实验拓扑:
实验步骤:
一、PC的配置
- pc1
ip 192.168.7.2
网关 192.168.7.1
- PC2
Ip 192.168.8.2
网关 192.168.8.1
- PC3
IP 192.168.79.2
网关 192.168.79.1
- PC4
IP192.168.6.2
网关 192.168.6.1
二、左侧交换机的配置
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host S1
S1(config)#vlan 2
S1(config-vlan)#exit
S1(config)#vlan 3
S1(config-vlan)#exit
S1(config)#int f0/2
S1(config-if)#sw acc vlan 2
S1(config-if)#no shu
S1(config-if)#exit
S1(config)#int f0/3
S1(config-if)#sw acc vlan 3
S1(config-if)#no shu
S1(config-if)#exit
S1(config)#int f0/1
S1(config-if)#sw mo tr
S1(config-if)#no shu
S1(config-if)#exit
S1(config)#end
S1#
三、右侧交换机的配置
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host S2
S2(config)#vlan 4
S2(config-vlan)#exit
S2(config)#vlan 5
S2(config-vlan)#exit
S2(config)#int f0/2
S2(config-if)#sw acc vlan 4
S2(config-if)#no shu
S2(config-if)#exit
S2(config)#int f0/3
S2(config-if)#sw acc vlan 5
S2(config-if)#no shu
S2(config-if)#exit
S2(config)#int f0/1
S2(config-if)#sw mo tr
S2(config-if)#no shu
S2(config-if)#end
S2#
四、路由器的配置
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R
R(config)#int f0/0
R(config-if)#no ip add
R(config-if)#no shu
R(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
R(config-if)#int f0/0.2
R(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up
R(config-subif)#enc dot1q 2
R(config-subif)#ip add 192.168.7.1 255.255.255.0
R(config-subif)#no shu
R(config-subif)#exit
R(config)#int f0/0.3
R(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.3, changed state to up
R(config-subif)#enc dot1q 3
R(config-subif)#ip add 192.168.9.1 255.255.255.0
R(config-subif)#no shu
R(config-subif)#exit
R(config)#int f0/1
R(config-if)#no ip add
R(config-if)#no shu
R(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
R(config-if)#exit
R(config)#int f0/1.4
R(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/1.4, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1.4, changed state to up
R(config-subif)#enc dot1q 4
R(config-subif)#ip add 192.168.79.1 255.255.255.0
R(config-subif)#no shu
R(config-subif)#exit
R(config)#int f0/1.5
R(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/1.5, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1.5, changed state to up
R(config-subif)#enc dot1q 5
R(config-subif)#ip add 192.168.6.1 255.255.255.0
R(config-subif)#no shu
R(config-subif)#end
R#
%SYS-5-CONFIG_I: Configured from console by console
R#w
五、测试
六、查看路由表
实验结论:
思科单臂路由配置成功。