Wolter Kamphuis <(E-Mail Removed)> wrote:
>Juha Laiho wrote:
>> Wolter Kamphuis <(E-Mail Removed)> said:
>>
>>> I'm busy developing a client/server system which uses
>>> broadcast to communicate. I would like to use ip aliases to
>>> simulate a single network with many clients and one
>>> server.
That is *not* a good idea! What happens is that, despite your
best efforts to avoid it, your code will end up depending on the
synchronous nature of executing the client and the server on a
single system. When you move it to a real network the client
and server will by asynchronous, and timing problems that would
have been easy to spot in the early stages of development will
be much more difficult to track down.
>>> The clients would be listening to lo:* (127.0.0.*)
>>> and the server would be broadcasting to the lo network
>>> (127.0.0.255). However ip aliasing seems to be removed from
>>> the 2.4 kernels.
>> [root@ichaos linux]# ifconfig lo:0 127.0.0.2 up
>> [root@ichaos linux]# ifconfig -a
>> ...
>> lo Link encap:Local Loopback
>> inet addr:127.0.0.1 Mask:255.0.0.0
You've missed the significance of the Mask value. Any address
from 127.x.x.x will be sent to the lo device!
>> UP LOOPBACK RUNNING MTU:16436 Metric:1
>> RX packets:3708335 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:3708335 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:0
What the above means, is that the below isn't needed. It's already
done!
>> lo:0 Link encap:Local Loopback
>> inet addr:127.0.0.2 Mask:255.0.0.0
>> UP LOOPBACK RUNNING MTU:16436 Metric:1
Instead of doing that, just try to ping 127.0.0.2, or *any* valid
127.x.x.x address. Which also means you can put a name in your
/etc/hosts file associating the name to that IP address, as well
as others if you need them:
127.0.0.1 localhost
127.0.0.2 localhost.localdomain
127.5.0.1 test1 test1.localdomain
127.5.0.2 test2 test2.localdomain
127.5.0.3 test3 test3.localdomain
And that will make *all* of those names accessable as a loopback.
....
>mechanism.)". I assumed they had removed ip aliasing completely
>since I too couldn't find any references to ip aliasing. The
>"ifconfig lo:0 127.0.0.2 up" command works here too so it's
>still there, but a bit hidden.
But, totally unnecessary for what you are doing with it.
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)
(E-Mail Removed)