chris at the-brannons.com
Sun Dec 18 22:29:42 UTC 2016
"Martin McCormick" <martin.m at suddenlink.net> writes:
> I assigned static IP addresses for both the wired and
> wireless interfaces on both Pi's and kept losing the newer board
> which seemed to keep changing IP addresses almost randomly.
Oh interesting. If the static addresses come from your router via dhcp,
then something is wrong, because a reserved lease should pull the same
IP for the same MAC *every* time, even if your onboard wireless is flaky
and the connection somehow manages to go down regularly.
> ifconfig -a reports wln0 so I think the new adapter is
> either doing nothing or occasionally becoming wln0.
You cannot rely on network interface names
like wlan0, eth0, or whatever, unless there's only one device of the
given type in the box. They're nondeterministic. I think they depend
on the order in which hardware is probed. There are a couple
solutions. By default on most desktop distros today, udev takes care of
this and assigns "persistent network names". They're clumsy. For
instance, I think the wifi card on my netbook is named wlp3s0 or
something funky like that.
If you don't like those names,
you can tell udev not to create them for you and use the old wlan0 and
eth0-style kernel interface names, or you can write your own udev rules
to give your interfaces sensible names. I do the latter for my desktop
machine, which has multiple ethernet cards. The one connected to the
Internet has the interface name of "wan".
Most Raspberry Pi distros don't seem to be using the default udev rules
that create persistent network names. I'm not sure why not. Maybe
because most Raspberry Pis just have one ethernet and one wireless
interface, in which case, the clumsy persistent names are just an
annoyance. But in cases like yours, they're useful.
So to make a long story short, never use kernel names like eth0 or wlan0
if you have multiple network devices of the same class. I can't
emphasize this strongly enough, because it's really a routing or
security disaster just waiting to happen. And because of Murphy, it'll
happen when you least expect it.
More information about the Blinux-list