Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have,

Class   Range      NetMask         Bits    Bits   hosts#
A        0-127         8      24     16777216   (i.e.

B      128-191      16      16        65536   (i.e.

C      192-254    24       8          256   (i.e.


$cat /proc/version 
Linux version 2.6.32-amd64 (gcc version 4.3.2 (Debian 4.3.2-1.1) ) #1 SMP Tue Jul 1 18:36:07 UTC 2011

$ip route show dev eth1  scope link dev eth1  scope link dev eth1  scope link dev eth1  scope link dev eth1  scope link 

default via dev eth0 

default via dev eth1 

default via dev eth1 

default via dev eth1 

default via dev eth1 

default via dev eth1 

Question1. As per the above display, using iproute 2009 version I am getting IPv4 class A address holding class C or B netamsk and vice-versa. is it a valid configuration ?

Question2. As per the above display, if iproute allow to add multiple default routes, then what would be the behavior of packet flow when packet need to be routed using only one default route (where many default routes exist) ? also how the iproute filter multiple default routes ? also, is it a valid feature that iproute should allow multiple default routes in a server setup ?

share|improve this question

migrated from Jul 27 '11 at 8:49

This question came from our site for professional programmers interested in conceptual questions about software development.

The IP classes you refer to have been obsoleted by CIDR in 1993. It is no longer relevant. It is not possible to determine the netmask based on only the IP address.

Multiple default routes are possible, but you'll need to either set different metrics or use policy based routing.

share|improve this answer
I think Linux will, by default, do round-robin load-balancing between default gateways with the same metric. In some situations, this is exactly what you want, in others it will break things horribly. Keeping to a single default gateway or having different metrics is definitely the safe bet. – Vatine Jul 27 '11 at 11:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.