Catalyst 2948G-L3交换机上行重定向功能( 二 )


 no ip route-cache cef
!
router rip
 network 10.0.0.0
!
bridge 21 protocol ieee
!-- 该命令在此交换路由上激活桥接 。
 bridge 21 route ip
!-- 该命令在接口21上激活路由 。

检验
IP上行链路重定向功能尚未启动,如下所示:
Cat2948G-L3#show ip uplink
IP Uplink Redirect Configuration:
Running Configuration : no ip uplink-redirect
!-- 未激活IP上行链路重新定向功能 。
Configuration on next reload : no ip uplink-redirect
该结构中对配置IP上行链路重定向的处理如下所示:
Cat2948G-L3#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Cat2948G-L3(config)#ip uplink-redirect
!-- 此全局配置命令激活IP上行链路重新定向功能,
!-- 但必须在重新加载后才能生效 。
Please save configuration and reload for this command to take effect
Cat2948G-L3#show ip uplink
IP Uplink Redirect Configuration:
Running Configuration : no ip uplink-redirect
Configuration on next reload : ip uplink-redirect
!-- 该功能被激活,但在重新后加载才能生效 。
Cat2948G-L3#reload
System configuration has been modified. Save? [yes/no]: y
Building configuration...
[OK]
Proceed with reload? [confirm]
After reload:
Cat2948G-L3#show ip uplink
IP Uplink Redirect Configuration:
Running Configuration : ip uplink-redirect
!-- T激活IP上行链路重新定向功能.
Configuration on next reload : ip uplink-redirect
为了在Cat2948G - L3上完成IP上行链路重定向配置,您必须配置一静态默认路由并指向上流路由器的接口IP地址 。
在本例中,路由器的接口gig 49为上流路由器接口 。接口gig 49的IP地址为10.1.22.1 。您无法在ip route命令中指定一个出口接口,您必须指定下一个跳IP地址 。
Cat2948G-L3(config)#ip route 0.0.0.0 0.0.0.0 10.1.22.1
路由器中的基本路由配置如下:
路由器配置
router#show run
...
interface GigabitEthernet49
 ip address 10.1.22.1 255.255.255.0
 no ip directed-broadcast
...
router rip
 network 10.0.0.0
路由器中的路由表如下:
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, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
 10.0.0.0/24 is subnetted, 3 subnets
R10.1.20.0 [120/1] via 10.1.22.2, 00:00:21, GigabitEthernet49
R10.1.21.0 [120/1] via 10.1.22.2, 00:00:21, GigabitEthernet49
C10.1.22.0 is directly connected, GigabitEthernet49
router#
警告:假如上流路由器有一更好的可选路径通过Catalyst 2948G - L3高速以太网接口返回IP网络,将使用该路径,这可能导致路由环路 。
通过BVI21/路由器/gig来确保station_A和station_B之间的连通性,如下所示 。
station_A#traceroute 10.1.21.1
Type escape sequence to abort.
Tracing the route to 10.1.21.1
1 10.1.20.2 0 msec 0 msec 3 msec
2 10.1.22.1 0 msec 0 msec 3 msec
3 10.1.22.2 2 msec 0 msec 2 msec
4 10.1.21.1 3 msec 3 msec *
station_A#
在本例中,通过Catalyst 2948G - L3接口fast 20(10.1.20.2 0)的轨迹重定向至上流路由器的接口gig 49(10.1.22.1),路由返回至Catalyst 2948G - L3的接口gig 49(10.1.22.2),然后再到station_B(10.1.21.1) 。
假如有需要,您可以在Cat2948G - L3的接口gig 49上应用ACL来控制站之间的接入 。在下例中,对接口gig 49上应用一个输入接入表来阻止两个站的通讯:

推荐阅读