实验要求:要求R3学到R1上的路由是用过e0/1接口学到的
R1
en
conf t
int e0/0
ip add 192.168.12.1 255.255.255.0
no shu
exi
int e0/2
ip add 192.168.13.1 255.255.255.0
no shu
exi
int lo 0
ip add 1.1.1.1 255.255.255.0
exi
router rip
ver 2
no au
net 192.168.12.0
net 192.168.13.0
net 1.1.1.0
exi
R2
en
conf t
int e0/0
ip add 192.168.12.2 255.255.255.0
no shu
exi
int e0/1
ip add 192.168.23.2 255.255.255.0
no shu
exi
router rip
ver 2
no au
net 192.168.12.0
net 192.168.23.0
exi
R3
en
conf t
int e0/1
ip add 192.168.23.3 255.255.255.0
no shu
exi
int e0/2
ip add 192.168.13.3 255.255.255.0
no shu
exi
router rip
ver 2
no au
net 192.168.23.0
net 192.168.13.0
exi
access-list 1 permit 1.1.1.0 0.0.0.255
router rip
offset-list 1 in 5 e0/2
// 通过偏移将acl 1的管理距离加5
或者distance 80 192.168.23.2 0.0.0.0 1
exi
实验结果:
r3#sho ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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
R
192.168.12.0/24 [120/1] via 192.168.23.2, 00:00:03, Ethernet0/1
[120/1] via 192.168.13.1, 00:00:19, Ethernet0/2
1.0.0.0/24 is subnetted, 1 subnets
R
1.1.1.0 [80/2] via 192.168.23.2, 00:00:03, Ethernet0/1
C
192.168.13.0/24 is directly connected, Ethernet0/2
C
192.168.23.0/24 is directly connected, Ethernet0/1