tripping on ip routes question
pinkiaiii
Member Posts: 216
in CCNA & CCENT
So this practice question keeps popping up for me and ive no idea how to solve it,even thou it seems not to complicated:
routing is configure on router with these 3 routes:
ip route 0.0.0.0 0.0.0.0 192.168.1.1
ip route 10.1.0.0 255.255.0.0 192.168.2.2
ip route 10.1.0.0 255.255.255.0 192.168.3.3
then im given 6 ips to sort which ip will use which route:
10.1.1.10
10.1.4.6
10.1.0.14
10.1.0.123
10.2.1.3
10.6.8.4
Now i sort of grasp that last two ips would go trough 0.0.0.0 ip route since they dont match 10.1 but how do i know what route the other ips will take since looking at masks 255 for class b and class c my mind goes blank
routing is configure on router with these 3 routes:
ip route 0.0.0.0 0.0.0.0 192.168.1.1
ip route 10.1.0.0 255.255.0.0 192.168.2.2
ip route 10.1.0.0 255.255.255.0 192.168.3.3
then im given 6 ips to sort which ip will use which route:
10.1.1.10
10.1.4.6
10.1.0.14
10.1.0.123
10.2.1.3
10.6.8.4
Now i sort of grasp that last two ips would go trough 0.0.0.0 ip route since they dont match 10.1 but how do i know what route the other ips will take since looking at masks 255 for class b and class c my mind goes blank
Comments
-
clarson Member Posts: 903 ■■■■□□□□□□Well, it does seem like something is left out.
But, 10.1.0.14 and 10.1.0.123 with a 255.255.255.0 subnet mask does match the 10.1.0.0 route to 192.168.3.3 and 10.1.1.10 and 10.1.4.6 would not.
And, 10.1.1.10 and 10.1.4.6 with a 255.255.0.0 subnet mask does match the 10.1.0.0 route to 192.168.2.2. But, 10.1.0.14 and 10.1.0.123 also matches this route.
So, how does the router decide which to send where? I'm going with route summarization. and say all of the 10.1.x.x ips are going to go to 192.168.2.2 -
volfkhat Member Posts: 1,072 ■■■■■■■■□□So, how does the router decide which to send where?
The route that is "most specific" is the Winner.
So,
for the address --> 10.1.0.14
it matches two routes:
route #2) 10.1.0.0
and
route #3) 10.1.0.0
Based on teh sumbnet mask, route3 is the higher match. -
pinkiaiii Member Posts: 216well the idea is theres 3 routes and 6 ips and one needs to drag 2 IPs to each route,thus getting two ip per each route for answer,but i held of of writing out answer since what trips me how should i break the given addresses to get right answer.
since looking at ip again as i wrote them out in order
10.1.1.10
10.1.4.6
10.1.0.14
10.1.0.123
10.2.1.3
10.6.8.4
Thats how i would break them down,but know that its not correct since .14 and .123 for some reason are on different ip routes ? -
networker050184 Mod Posts: 11,962 ModWrite it out in binary and I think it will be clear. Learn that way first before you start using short cuts.An expert is a man who has made all the mistakes which can be made.
-
clarson Member Posts: 903 ■■■■□□□□□□well my guess was wrong. and volfkhat answer does make sense.
But, i don't see how .14 and .123 could be on different networks. Because with 2 ip's for each route, that means 1.10 and 4.6 are on different routes also. That leaves me really confused also. -
clarson Member Posts: 903 ■■■■□□□□□□volfkhat is right.
Suppose a router receives a packet destined for the IP address 192.0.2.73. The router has in its routing table the following three routes:
Protocol AD Metric Prefix Next Hop
OSPF 110 240 192.0.2.0/25 172.16.1.1
EIGRP 90 33789 192.0.2.0/24 172.16.2.1
RIP 120 6 192.0.2.64/26 172.16.3.1
To which next hop address will the packet be routed?
If you picked 172.16.3.1, you're correct. Why? A router evaluates routes in the following order.
Prefix Length - The longest-matching route is preferred first. Prefix length trumps all other route attributes.
Administrative Distance - In the event there are multiple routes to a destination with the same prefix length, the route learned by the protocol with the lowest administrative distance is preferred.
Metric - In the event there are multiple routes learned by the same protocol with same prefix length, the route with the lowest metric is preferred. (If two or more of these routes have equal metrics, load balancing across them may occur.)
Following these rules, we can see that our RIP-learned route is preferred because it is the most specific route: it has the longest matching prefix (26 bits in length compared to 25 and 24). These rules hold true even when evaluating directly connected routes, which have an AD of zero: -
pinkiaiii Member Posts: 2161.0000.1010.0000.0001.0000.0001.0000.1010 10.1.1.10
2.0000.1010.0000.0001.0000.0100.0000.0110 10.1.4.6
3.0000.1010.0000.0001.0000.0000.0000.1110 10.1.0.14
4.0000.1010.0000.0001.0000.0000.0111.1011 10.1.0.123
5.0000.1010.0000.0010.0000.0001.0000.0011 10.2.1.3
6.0000.1010.0000.0110.0000.1000.0000.0100 10.6.8.4
well i can see that in binary first variations occur on 5-6 thus these addresses would go trough 0.0.0.0 route,then if following same rule 1-2 would go trough 255.255 since change occurs in 3rd octet ,and 3-4 has changes in 4th octet thus that would be 255.255.255.0 route ,now writing it out isn't fun at all,but if im correct since i took all given ips from row without looking how they were numbered.thus it looks easy to understand where difference occurs if im correct just looking at bold parts ?
edit managed to find the question and answer to it seems all correct.5-6 go trough 0.0.0.0 ,1-2 go trough /16 and 3-4 /24
looks easy once numbers fall in place,but not when you see it first time. -
volfkhat Member Posts: 1,072 ■■■■■■■■□□Prefix Length - The longest-matching route is preferred first. Prefix length trumps all other route attributes.
Administrative Distance - In the event there are multiple routes to a destination with the same prefix length, the route learned by the protocol with the lowest administrative distance is preferred.
Metric - In the event there are multiple routes learned by the same protocol with same prefix length, the route with the lowest metric is preferred. (If two or more of these routes have equal metrics, load balancing across them may occur.)
Following these rules, we can see that our RIP-learned route is preferred because it is the most specific route: it has the longest matching prefix (26 bits in length compared to 25 and 24). These rules hold true even when evaluating directly connected routes, which have an AD of zero:
My answer was lazy.
This is a Much Better explanation :] -
GDaines Member Posts: 273 ■■■□□□□□□□Prefix Length - The longest-matching route is preferred first. Prefix length trumps all other route attributes.
Administrative Distance - In the event there are multiple routes to a destination with the same prefix length, the route learned by the protocol with the lowest administrative distance is preferred.
Metric - In the event there are multiple routes learned by the same protocol with same prefix length, the route with the lowest metric is preferred. (If two or more of these routes have equal metrics, load balancing across them may occur.)
So using two addresses from the original example,
1> 10.1.0.14
2> 10.1.0.123
And replacing the original longest match route with two new routes,
ip route 10.1.0.0 255.255.255.0 FA0/1 20
ip route 10.1.0.0 255.255.255.0 S0/0/0 30
Am I right in presuming that using the given rules, the prefix length is the same for both routes, and let’s say in this example the administrative distance is 2 hops for each route, so in my modified example we now compare the metrics? And as FA0/1 has a lower metric than S0/0/0 (20 and 30 respectively), FA0/1 will be the selected route? -
pinkiaiii Member Posts: 216@Gdainees your correct i think term for that is floating route or smth like that where if you have two same routes or prefer one over another you set AD to lower to make it more desirable,and if that route fails then 30 takes over.
BTW thanks all for replies and explanation,while it seemed hard to understand but even taking steps like writing them all out in binary and whole description of longest matching route then looking back at IPs thus not memorized but actually understood what way it works.