Route selection issue

in CCNA & CCENT
I everybody,
I have the following issue about route selection. This is an extract from our router...
I have the following table:
172.16.0.0 /16 is variable subnetted, 5 subnets, 4 masks
R 172.16.1.1 /32 (120/1) via 172.16.25.2 serial 0/1/1
R 172.16.1.0 /24 (120/2) via 172.16.25.129 serial 0/1/0
R 172.16.0.0 /22 (120/1) via 172.16.25.2 serial 0/1/1
R 172.16.0.0 /17 (120/2) via 172.16.25.129 serial 0/1/0
R 0.0.0.0 /0 (120/3) via 172.16.25.2 serial 0/1/1
When I write show ip route x.x.x.x command for the IPs, it responses with routes that are confused to me....
For ip 172.16.10.1 it says that matches route 172.16.0.0 /17, but the theory says that it must match the route with the longest prefix lenght and I think it has to be 172.16.0.0 /22.
For ip 172.16.130.1 it says that matches route 0.0.0.0, what about route 172.16.0.0 /22, can it fit there ? I think so.
For ip 172.16.125.1 it says that matches the route 172.16.0.0 /17, the same think, what about 172.16.0.0 /22 ?
Please a little help because i´m confusing..
I have the following issue about route selection. This is an extract from our router...
I have the following table:
172.16.0.0 /16 is variable subnetted, 5 subnets, 4 masks
R 172.16.1.1 /32 (120/1) via 172.16.25.2 serial 0/1/1
R 172.16.1.0 /24 (120/2) via 172.16.25.129 serial 0/1/0
R 172.16.0.0 /22 (120/1) via 172.16.25.2 serial 0/1/1
R 172.16.0.0 /17 (120/2) via 172.16.25.129 serial 0/1/0
R 0.0.0.0 /0 (120/3) via 172.16.25.2 serial 0/1/1
When I write show ip route x.x.x.x command for the IPs, it responses with routes that are confused to me....
For ip 172.16.10.1 it says that matches route 172.16.0.0 /17, but the theory says that it must match the route with the longest prefix lenght and I think it has to be 172.16.0.0 /22.
For ip 172.16.130.1 it says that matches route 0.0.0.0, what about route 172.16.0.0 /22, can it fit there ? I think so.
For ip 172.16.125.1 it says that matches the route 172.16.0.0 /17, the same think, what about 172.16.0.0 /22 ?
Please a little help because i´m confusing..
Comments
-
chmorin Member Posts: 1,446 ■■■■■□□□□□
The router is correct.
172.16.0.0/22 has the range 172.16.0.1 - 172.16.3.254, of which 172.16.10.1 does NOT fall in. Making the next in line to be the 172.16.0.0/17, which has a range of 172.16.0.1 - 172.16.127.254.
172.16.0.0/22 has a range of 172.16.0.1 - 172.16.3.254, of which 172.16.130 does NOT fall into. Leaving the default rout the only one for it.
172.16.125.1 does fall into the /17 range, which is 172.16.0.1 - 172.16.127.254.
Check your subnets. Prefix length is measure from the left to right, counting the 1's. So a /16 subnet mask is 255.255.0.0, and so on. When a router matches routes, it has to pick the route with the highest prefix length that is VALID for the address.Currently PursuingWGU (BS in IT Network Administration) - 52%| CCIE:Voice Written - 0% (0/200 Hours)mikej412 wrote:Cisco Networking isn't just a job, it's a Lifestyle. -
samuel.lao85 Member Posts: 19 ■□□□□□□□□□
Thanks bro...
Noooww it´s clear to me...I thought that subnets on routing tables included all ranges just having 172.16.0.0 /22, for example 172.16.4.0 /22, 172.16.8.0 /22 and so on...
hahahaha
thank you.... -
chmorin Member Posts: 1,446 ■■■■■□□□□□
samuel.lao85 wrote: »Thanks bro...
Noooww it´s clear to me...I thought that subnets on routing tables included all ranges just having 172.16.0.0 /22, for example 172.16.4.0 /22, 172.16.8.0 /22 and so on...
hahahaha
thank you....
Trust me, everyone here thought the exact same thing at one point or anotherCurrently PursuingWGU (BS in IT Network Administration) - 52%| CCIE:Voice Written - 0% (0/200 Hours)mikej412 wrote:Cisco Networking isn't just a job, it's a Lifestyle. -
jmc012 Member Posts: 134
samuel.lao85 wrote: »Thanks bro...
Noooww it´s clear to me...I thought that subnets on routing tables included all ranges just having 172.16.0.0 /22, for example 172.16.4.0 /22, 172.16.8.0 /22 and so on...
hahahaha
thank you....
It is confusing at first, check out this document at Cisco's website, it does a good of explaining it. I re-read it every once in awhile to refresh my memory.
Route Selection in Cisco Routers - Cisco Systems