Hi,
This is a load balancing specific question. We configure load balancer IP addresses (which are regular
addresses like 10.1.1.1) on the loopback interface with 0.0.0.0 netmask. The purpose is to receive
clients requests with those address, and for routing to ignore them when sending the replies.
o Does addresses with 0.0.0.0 netmask have scope RT_SCOPE_NOWHERE?
o and does it imply that routing would never route to them?
We also configure load balancer IP address with 255.255.255.255 netmask which should not match any
route entry except the host entry itself within the box.
o Are there subtle differences between 0.0.0.0 and 255.255.255.255 netmasks?
The inet_ifa_match function seems to be wrong with 0.0.0.0 netmask. Who uses it?
extern __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa)
{
return !((addr^ifa->ifa_address)&ifa->ifa_mask);
}
The 0.0.0.0 netmask matches everything! For example:
addr=9.9.9.9 ifa_address=10.1.1.1 ifa_mask=0.0.0.0 inet_ifa_match=1
addr=9.9.9.9 ifa_address=10.1.1.1 ifa_mask=255.255.255.255 inet_ifa_match=0
Will there be any routing problems if we use the 0.0.0.0 netmask?
Thanks for any info.
Allen Lau
Hello!
> o Does addresses with 0.0.0.0 netmask have scope RT_SCOPE_NOWHERE?
Why?
> o and does it imply that routing would never route to them?
Even if you set this, it does not imply anything, but that address
will not be used on any packet while automaitc source address selection.
> o Are there subtle differences between 0.0.0.0 and 255.255.255.255 netmasks?
Subtle? :-) They are on exactly opposite poles.
> The inet_ifa_match function seems to be wrong with 0.0.0.0 netmask.
...
> The 0.0.0.0 netmask matches everything!
Of course. Zero mask matches everything.
> Will there be any routing problems if we use the 0.0.0.0 netmask?
No problems provided you wanted this.
F.e. default route is route with netmask zero, it matches all,
so that all the addresses are routed there.
It is exactly which happens in your setup, but all the addresses
fall to loopback.
Looking at your original purpose, you wanted mask 255.255.255.255.
Alexey
Alexey,
>> The inet_ifa_match function seems to be wrong with 0.0.0.0 netmask.
>...
>> The 0.0.0.0 netmask matches everything!
>
>Of course. Zero mask matches everything.
I agree that 0.0.0.0 netmask in a route entry (dest 0.0.0.0 mask 0.0.0.0)
matches everything.
However, it is intuitively different with an interface address.
Can an IP address be on every subnet (i.e. is 10.1.1.1 prefix 0 on every
subnet)?
I believe it is not right for inet_ifa_match to answer "yes" in the context of :
is 9.9.9.9 on the same subnet as interface address 10.1.1.1 prefix 0?
>> Will there be any routing problems if we use the 0.0.0.0 netmask?
>
>No problems provided you wanted this.
>F.e. default route is route with netmask zero, it matches all,
>so that all the addresses are routed there.
>It is exactly which happens in your setup, but all the addresses
>fall to loopback.
>Looking at your original purpose, you wanted mask 255.255.255.255.
>Alexey
Allen Lau
Hello!
> Can an IP address be on every subnet (i.e. is 10.1.1.1 prefix 0 on every
> subnet)?
Of course. Why not? This means that 10.1.1.1 is address of this
interface and all the rest of internet is attached to this interface directly.
The thing which you want is 255.255.255.255.
Alexey
On Fri, 27 Jul 2001 [email protected] wrote:
> Hello!
>
> > Can an IP address be on every subnet (i.e. is 10.1.1.1 prefix 0 on every
> > subnet)?
>
> Of course. Why not? This means that 10.1.1.1 is address of this
> interface and all the rest of internet is attached to this interface directly.
Which is actually used by some routing hardware. Ascend Pipelines have a
mode ("Proxy Mode=Always") in which the router answers any ARP request for
off-net IPs with its own MAC address. The idea then is to configure all
your machines to assume the entire Internet is on your local subnet and
the router will pick up the packets destined for the outside world
automatically. Kinda silly really but it does happen.
--
Head Developer | "...and we have C(n) = (n (n + 1))/ 2. Easy as pie.
Big Net, Inc. | Actually easier, Pi = Sum 8 / ((4n + 1)(4n + 3))."
| - Donald E. KNUTH