01-09-2006 06:43 AM - edited 03-03-2019 01:21 AM
I have seen on one of my routers, an ip route where half the subnet goes to one router and the the other to another router, this is done by applying a mask, it was something like ip route 172.19.54.0 255.255.255.0 x.x.x.x, and the other route was 172.19.54.0 255.255.128.0 x.x.x.x, Its something like that, Can anyone tell me how that works
thanks a million
Carlos
01-09-2006 06:55 AM
Hi
I feel you have got most specific routing entry for the half of the subnet and a entry for the whole /24 network.
The packets destined to first half of the network will take the path/host mentioned in the second route and the packet for the other ips/hosts belongs to the major /24 network will take the path via the ip mentioned in the first ip route command.
If both the routes are pointing towards the same host/ip better you can remove the second one and keep ur routing table neat & clean..
regds
01-09-2006 08:49 AM
how does this work though, how is it worked out ?
thanks a million
01-09-2006 08:55 AM
Hello,
You might wonder what a router does in case there is an "address overlap". Well a router will always take the longest match in the routing table. That means it will take the matching entry with the highest value for the netmask (f.e. /25 is better suited than /24).
By the way the "worst address overlap" is when you have a default route 0.0.0.0/0, which covers every IP address. It will however only be used in case there is no more specific routing entry for a packet´s destination IP.
Did this help? Please rate all posts.
Martin
01-10-2006 03:22 AM
Hi there
That didnt really answer my question, thanks anyway, I wanted to know how come the mask of 255.255.128.0 makes the upper half of the ip range to go to another route, I want to know why we use the .128 mask etc ?
thanks
Carlos
01-10-2006 03:42 AM
Hi Carlos,
Let's take a simpler example to illustrate this.
Suppose you have the network 10.1.1.0/24 and you wish to route the bottom half via one interface and the top half via another.
Now, you have a 255.255.255.0 mask to start off with. In order to create two halves of the network, you need to have a mask that is one bit longer than the original mask. In this case, this means that you need a /25 mask, which is 255.255.255.128.
With a mask of 255.255.255.128, what you are actually doing is dividing the last octet of the network into two pieces.
10.1.1.0/25 - Includes all addresses from 10.1.1.0 to 10.1.1.127. All of these address have the MSB of their last octet equal to 0 (convert to binary and see).
10.1.1.128/25 - Includes all addresses from 10.1.1.128 to 10.1.1.255. All of these address have the MSB of their last octet equal to 1 (convert to binary and see).
Therefore, using a mask of 255.255.255.128, you have succeeded in splitting this prefix.
Hope that helps.. pls rate the post if it does.
Paresh.
01-10-2006 06:27 AM
Hi thanks for that thats brilliant, Im not to good at subnetting, is there any docs you can point me to to help me ?
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: