样本配置 Cat2948G-L3#show run ... bridge irb !-- 该命令激活完整的路由和桥接接口 (IRB)。 ... interface Fast Ethernet20 ip address 10.1.20.2 255.255.255.0 no ip directed-broadcast duplex full speed 100 ! interface Fast Ethernet21 no ip address no ip directed-broadcast duplex full speed 100 bridge-group 21 !-- 该命令将路由接口转换成桥接接口。 ... interface GigabitEthernet49 ip address 10.1.22.2 255.255.255.0 no ip directed-broadcast ... interface BVI21 !-- 该逻辑接口用于路由桥接接口所接受到的流量 ip address 10.1.21.2 255.255.255.0 no ip directed-broadcast 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
路由器配置 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 R 10.1.20.0 [120/1] via 10.1.22.2, 00:00:21, GigabitEthernet49 R 10.1.21.0 [120/1] via 10.1.22.2, 00:00:21, GigabitEthernet49 C 10.1.22.0 is directly connected, GigabitEthernet49 router#
Cat2948G-L3#show run ... interface GigabitEthernet49 ip address 10.1.22.2 255.255.255.0 ip access-group 1 in no ip directed-broadcast ... access-list 1 deny 10.1.20.1 access-list 1 permit any
station_A#traceroute 10.1.21.1
Type escape sequence to abort. Tracing the route to 10.1.21.1
样本配置 Cat2948G-L3#show run ... ip uplink-redirect !-- 该命令激活IP上行链路重新定向功能, !-- 并在重新加载后生效。 bridge irb !-- 该命令激活IRB。 ... interface Fast Ethernet20 no ip address no ip directed-broadcast duplex full speed 100 bridge-group 20 !-- 该命令将路由的接口转换 !-- 成桥接组20中的桥接接口。 ! interface Fast Ethernet21 no ip address no ip directed-broadcast duplex full speed 100 bridge-group 21 !-- 该命令将路由的接口转换 !-- 成桥接组21中的桥接接口。 ... interface GigabitEthernet49 ip address 10.1.22.2 255.255.255.0 no ip directed-broadcast ... interface BVI20 !-- 该逻辑接口用于路由桥接组20中的桥接接口所 !-- 接受到的流量 ip address 10.1.20.2 255.255.255.0 no ip directed-broadcast no ip route-cache cef ! interface BVI21 !-- 该逻辑接口用于路由桥接组21中的桥接接口所 !-- 接受到的流量 ip address 10.1.21.2 255.255.255.0 no ip directed-broadcast no ip route-cache cef ! router rip network 10.0.0.0 ! ip route 0.0.0.0 0.0.0.0 10.1.22.1 ! access-list 1 deny 10.1.20.1 access-list 1 permit any ... bridge 20 protocol ieee bridge 20 route ip !-- 该命令激活接口BVI 20上的IP路由。 bridge 21 protocol ieee bridge 21 route ip !-- 该命令激活接口BVI 21上的IP路由。