Multiple Interfaces with the same IP

Giorgos Keramidas keramida at linux.gr
Sun May 8 15:47:44 PDT 2005


On 2005-05-08 19:22, Michael Bretterklieber <mbretter at inode.at> wrote:
>Max Laier wrote:
>>On Sunday 08 May 2005 18:54, Michael Bretterklieber wrote:
>>> it looks like that under 5-stable it's allowed to have different
>>> interfaces with the same IP, bug or feature?
>>
>> Feature and required for CARP to function.  You need to change your
>> routeing
>
> ok, this make sense.
>
>> table to make sure the right one is used for outgoing traffic (or you
>> just don't set the same IP on more than one interface).
>
> sure, but in my case the Iface is configured with Mpd. I'm trying to
> catch that case, where a user with a static-IP (provided by the RADIUS
> server) was logged in twice. I tried to catch the return value from
> ifconfig, but since it's allowed to have multiple ifaces with the same
> ip, ifconfig succeeds.
>
> ... so, it looks like I have to find another way :-(

Does the following help?

gothmog:/home/giorgos$ ifconfig -a | grep -q 127.0.0.1 ; echo $?
0
gothmog:/home/giorgos$ ifconfig -a | grep -q 127.0.0.2 ; echo $?
1



More information about the freebsd-net mailing list