[plug] ip address and interface question

Matt Kemner zombie at penguincare.com.au
Fri Jun 23 09:52:53 WST 2006


Hi Jason, welcome to the list!

On Fri, 23 Jun 2006, quoth Jason:

> This is an annoyance that I've had since first installing linux on my laptop a couple of years ago and finally thought I'd try to find out how to fix
> it :)

That's because it's a feature, not a bug! ;)

Well, not really, but it's been a known "feature" for as long as I can
remember.  I remember seeing a question on linux-kernel about it years
ago, and the reasoning behind it, is that the code that checks incoming
packets to see if "it's one of our IP addresses" does not check which
interface the packet was received on, and if you only do "ifconfig down"
on an interface it does not remove the associated IP address from the
"this is one of ours" list.

> I have two interfaces, eth0 (wired) and eth1 (wireless ipw2200
> drivers).  eth0 is configured with the ip address of 192.168.0.4 and
> eth1 192.168.0.5.

You really should not have two interfaces in the same machine on the same
physical network - although I guess you are bringing one interface up as
you bring the other interface down so you can switch between wired &
wireless.

The way I do that is to ensure I do "ifconfig ath0 0.0.0.0 down" to both
remove the IP address and bring down the interface, before I bring the
other interface up.

I'm toying with the idea of adding both my interfaces (ath0 and eth0) to a
bridge (br0) and enabling spanning tree on my switch, which means I should
be able to use the same IP address no matter which interface is connected.

The problem is, that will only work on stp-capable networks, otherwise
it will lead to nastyness (broadcast storms etc)

Kind Regards,

 - Matt Kemner
  Penguin Care		Tel: Perth 08 9322 3444	Brisbane 07 3337 9988
  Mob: 04 1175 6910	Fax: Perth 08 9221 3444	Brisbane 07 3337 9977




More information about the plug mailing list