Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have,

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

B      128-191    255.255.0.0      16      16        65536   (i.e. 150.0.0.0)

C      192-254    255.255.255.0    24       8          256   (i.e. 199.0.0.0)

Also,

$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
114.0.0.0/24 dev eth1  scope link 

114.0.0.0/16 dev eth1  scope link 

114.0.0.0/8 dev eth1  scope link 

199.0.0.0/8 dev eth1  scope link 

122.0.0.0/8 dev eth1  scope link 



default via 16.107.200.1 dev eth0 

default via 16.107.200.1 dev eth1 

default via 16.107.200.20 dev eth1 

default via 16.107.200.21 dev eth1 

default via 16.107.200.22 dev eth1 

default via 16.107.200.23 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 programmers.stackexchange.com Jul 27 '11 at 8:49

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

1 Answer 1

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

 
discard

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.