配置三层交换机实现不同区域网连通

2025-01-05 19:04:58

1、1:配置R1三层交换机端口的地址信息Switch>enSwitch#configterEnterconfiguration commands, one per line.End with CNTL/Z.Switch(config)#hostnameR1R1(config)#interface fa0/1R1(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/1, changed state to upR1(config-if)#ip add 172.16.1.1 255.255.255.0R1(config-if)#no shutR1(config-if)#exitR1(config)#interface fa0/24R1(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/24, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/24, changed state to upR1(config-if)#ip add 172.16.2.1 255.255.255.0R1(config-if)#no shutR1(config-if)#endR1#%SYS-5-CONFIG_I:Configured from console by console配置R2三层交换机端口的地址信息Switch#config terEnterconfiguration commands, one per line.End with CNTL/Z.Switch(config)#hostnameR2R2(config)#interface fa0/1R2(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/1, changed state to upR2(config-if)#ip add 172.16.1.2 255.255.255.0R2(config-if)#no shutR2(config-if)#exitR2(config)#interface fa0/24R2(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/24, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/24, changed state to upR2(config-if)#ip add 172.16.3.1 255.255.255.0R2(config-if)#no shutR2(config-if)#endR2#%SYS-5-CONFIG_I:Configured from console by console

2、2:配置三层交换机设备RIPv2动态技术。配置R1三层交换机R1#configterEnterconfiguration commands, one per line.End with CNTL/Z.R1(config)#routerripR1(config-router)#version2R1(config-router)#network172.16.1.0R1(config-router)#network172.16.2.0R1(config-router)#endR1#配置R1三层交换机R2#configterEnterconfiguration commands, one per line.End with CNTL/Z.R2(config)#routerripR2(config-router)#version2R2(config-router)#network172.16.1.0R2(config-router)#network172.16.3.0R2(config-router)#endR2#%SYS-5-CONFIG_I:Configured from console by console测试R2,其信息如下:R2#showip routeCodes: 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 - OSPFexternal 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-userstatic route, o - ODR P - periodic downloaded static routeGatewayof last resort is not set 172.16.0.0/24 is subnetted, 3 subnetsC 172.16.1.0 is directly connected,FastEthernet0/1R 172.16.2.0 [120/1] via 172.16.1.1, 00:00:24,FastEthernet0/1C 172.16.3.0 is directly connected,FastEthernet0/24R2#

3、3:测试网络连通性PC1向PC2发送信息如下,发现仍然ping不通,经请教别人,发现以上设置,还没有开启三层交换机的路由功能

4、R2(config)#?不停的按空格键,来获取三层交换机的各种信息,得知没有路由信息。

5、ip routing 启用IP路由功能后,便能实验成功。

猜你喜欢