On Tue, May 28, 2002 at 02:44:28PM +0100, Antony Stone wrote: > I disagree. They are valid (on most modern O/Ss, anyway). Whether or not > they make sense depends on what you try and do with them. > > Linux routing can certainly handle arbitrary netmasks, and so can netfilter. > > I've never seen a good example of why someone would want to use them, though. One of posible uses: route add 0.0.0.0 netmask 0.0.0.1 gw gateway1 route add 0.0.0.1 netmask 0.0.0.1 gw gateway2
This will make simple load balancing (odd IP addresses via one gateway, even via the other). Unforunately this cannot be done with iproute2 tool, which is much more modern than ifconfig/route from net-tools. Another use is not for routing but for access control. I have serveral networks (/24) connected to my router. Bottom half of each network's address space have full access to internet, the other half has only access to local services. It would be great if I could block forwarding by using simple: iptables -A FORWARD -s 10.0.0.128/255.255.0.128 -j DROP But AFAIR it didn't work. And most other software using access control (tcpd, squid, etc.) won't accept such netmask neither :-( > You could choose to specify your private network as > 192.168.0.27/255.255.0.255 for example, instead of the more usual Using such netmask just to addres network doesn't make any sense IMHO. Greets, Jacek