I have the following routing table:
Gateway of last resort is not set
R 192.168.12.0/24 [120/10] via 192.168.23.2, 00:00:08, Ethernet0
C 192.168.13.0/24 is directly connected, Serial0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D EX 2.2.2.2/32 [170/4729856] via 192.168.13.1, 00:37:59, Serial0
R 2.0.0.0/8 [120/10] via 192.168.23.2, 00:00:08, Ethernet0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.3/32 is directly connected, Loopback1
D 3.0.0.0/8 is a summary, 00:40:50, Null0
C 192.168.23.0/24 is directly connected, Ethernet0
As shown, I have two routes to network 2.0.0.0, one learned via RIP and External EIGRP. How come the route 'D EX 2.2.2.2' is used even though it has a higher administrative distance and a higher metric than the one RIP provided? Which takes precedence when placing routes in the routing table; Administraative distance or longest-match prefix?