Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Finding the current network devices

"D'Arcy J.M. Cain" <> writes:

>>   read eth0 eth1 _ <<< `ifconfig -l`
> In any case, this doesn't work.  It's a bash operator and rc.conf is
> run by sh.  I will have to do something else to get the values.
> However, I still don't know if I can depend on the order.  Can anyone
> tell me that?

I suspect ifconfig prints out interfaces in order of ifindex, and that
it will depend on what attaches first.

But if you are trying to switch between wm0/1 and bge0/1, the ordering
will probably be ok.

Another hacky trick is to create both ifconfig.wm0 and ifconfig.bge0 and
just leave both there, if you are pretty sure you'll have one or the
other.  That might create annoying or problematic errors though.

> Maybe Linux has the right idea.  The ethernet cards are always eth# no
> matter what the actual hardware.

But how is the ordering determined?  The basic issue is that you have
cables plugged into ports and then interfaces appearing, and ordering is
based on some probe order, somehow.

Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index