码迷,mamicode.com
首页 > 其他好文 > 详细

交换机、路由器综合实验

时间:2016-06-11 17:28:22      阅读:359      评论:0      收藏:0      [点我收藏+]

标签:

二、实验拓扑图

技术分享 

即:

技术分享 

三、实验器材

拓扑图挑选实验器材如下:

1、 2台路由器2621XM

2、 1台交换机

3、 2台PC机

4、 一些相关连接线

 

四、实验过程

1、按拓扑图连接网络中所有接点设备,写出连接过程。

先将路由器R1的s0/0接口连接到路由器R2的s0/0接口,将路由器R1的f0/0接口连接到交换机的f0/1接口,将路由器R2的f0/0接口连接到交换机的f0/2,将交换机的f0/3端口连接到PC0,将交换机的f0/4端口连接到PC1

2、 配置路由器R1,写出完整的配置命令。

Router>en

Router>config t

Router(config)#hostname R1

R1 (config)#

Router(config)#int s0/0

Router(config-if)#ip address 192.168.150.100 255.255.255.0

Router(config-if)#no shut

Router(config-if)#exit

Router(config)#int f0/0

Router(config-if)#ip address 192.168.100.100 255.255.255.0

Router(config-if)#no shut

Router(config-if)#exit

Router(config)#

Router(config)#

Router(config)#ip route 192.168.110.0 255.255.255.0 192.168.150.150

Router(config)#exit

Router#

%SYS-5-CONFIG_I: Configured from console by console

 

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, 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, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

C    192.168.100.0/24 is directly connected, FastEthernet0/0

S    192.168.110.0/24 [1/0] via 192.168.150.2

                      [1/0] via 192.168.150.150

C    192.168.150.0/24 is directly connected, Serial0/0

Router#

 

 

3、 配置路由器R2503-2,写出完整的配置命令。

Router>en

Router>config t

Router(config)#hostname R2

R1 (config)#

Router(config)#int s0/0

Router(config-if)#ip address 192.168.150.150 255.255.255.0

Router(config-if)#no shut

Router(config-if)#exit

Router(config)#int f0/0

Router(config-if)#ip address 192.168.110.110 255.255.255.0

Router(config-if)#no shut

Router(config-if)#

Router(config-if)#ip route 192.168.100.0 255.255.255.0 192.168.150.100

Router(config)#exit

Router#

%SYS-5-CONFIG_I: Configured from console by console

 

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, 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, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

S    192.168.100.0/24 [1/0] via 192.168.150.1

                      [1/0] via 192.168.150.100

C    192.168.110.0/24 is directly connected, FastEthernet0/0

C    192.168.150.0/24 is directly connected, Serial0/0

Router#

 

4、 配置交换机S2950,写出完整的配置命令。

Switch>

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 110

Switch(config-vlan)#vlan 150

Switch(config-vlan)#exit

Switch(config)#int vlan 110

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan110, changed state to up

 

Switch(config-if)#ip address 192.168.100.0 255.255.255.0

Bad mask /24 for address 192.168.100.0

Switch(config-if)#ip address 192.168.100.1 255.255.255.0

Switch(config-if)#no shut

Switch(config-if)#exit

Switch(config)#int vlan 150

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan150, changed state to up

 

Switch(config-if)#ip address 192.168.150.1 255.255.255.0

Switch(config-if)#no shut

Switch(config-if)#exit

Switch(config)#

Switch(config)#

Switch(config)#int f0/1

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 110

Switch(config-if)#exit

Switch(config)#int f0/2

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 150

Switch(config-if)#exit

Switch(config)#int f0/3

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 110

Switch(config-if)#exit

Switch(config)#int f0/4

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 150

Switch(config-if)#exit

Switch(config)#

 

 

五、实验测试

1、 Windows_pc1能否ping到192.168.100.100

 

2.pc1192.168.110.16能否ping通192.168.110.100

 

3.因为Windows_pc1与Windows_pc2是在不同的vlan里,要想使得Windows_pc1与Windows_pc2能连通,必须在R2503-1、R2503-2路由器中做路由。

路由命令如下:

Router1(config)#ip route 192.168.110.0 255.255.255.0 192.168.150.150

Router2(config-if)#ip route 192.168.100.0 255.255.255.0 192.168.150.100

 

怎样查看路由?写出命令。

 

 

 

 

六、实验结论

两台PC机可以跨网段ping

 

交换机、路由器综合实验

标签:

原文地址:http://www.cnblogs.com/wangyuqi/p/5575545.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!