Re: Question on interface enumeration

Previous thread: Search Foreclosures Now !**HOT** by Pamela on Friday, September 21, 2007 - 12:35 am. (1 message)

Next thread: 2007-09-20 from sweden to south africa by bike by AfricaByBike Newsletter on Friday, September 21, 2007 - 3:10 am. (1 message)
From: Gregory Edigarov
Date: Friday, September 21, 2007 - 1:45 am

Hello Everybody,

Supposing I have several identical NIC's in my server, can I predict 
which become int0, which become int1, etc?

A link to document explaining (or man something) would absolutely suffice.
Thank you.
-- 

With best regards,
    Gregory Edigarov

From: Nick Holland
Date: Friday, September 21, 2007 - 4:12 am

Not Easily, at least if you are referring to a machine you know nothing
about and haven't powered up yet.  However, it is easy to make simple
tests to find out.

Assuming PCI, they go by order of the slots in the bus, which isn't
something OpenBSD controls.  Many machines have curious orders.
For example, I have a Dell GX1 which has five PCI slots; the order
is something like:  2 3 4 0 1.  (To add insult to injury, I had four
port NICs in every slot, took a while to find dc0! :)

Now, once I know (er.. knew.  The above sequence is from non-ECC and
proven faulty memory!) the pattern of slots in a GX1, I can know which
NIC will get which identifier.

If I put int(4) NICs in slots 3 and 1, the one in slot 1 will be int0,
the one in slot 3 will be int1.  Now, if I move the NIC from slot 1
into slot 4, they will switch IDs.  If I replace the NIC in slot 3
with a NIC of the same type (driver-wise, that is), nothing will
change.  If I remove int0 and replace it with a different driver, int1
will become int0.

How did I identify the slot order in the machine?  Stuck identical NICs
in all slots.  Why did I do that?  Because I stuck three NICs in the
thing and the ordering was not obvious, so I figured I better get to
know this machine better.

In all cases, the dmesg will link your MACs to physical IDs, so stick
the MAC addr on the spine of the card.

In most cases, ifconfig will show you which NICs have link in real time,
so an easy way to identify things is drop to shell, plug in one cable,
run ifconfig and see which has link.  Label.  Move cable, repeat until
done.

None of this is applicable to ISA or USB NICs.  It may be applicable
to other buses and platforms.

Moral:
  1) Know your HW
  2) Label the MAC address on your NICs
  3) Have identical replacement HW in case a non-OpenBSD expert has to
do a swap,
  4) Know how to reconfig your system if you have to change your NICs.
  5) Practice, Practice, Practice
  6) Drop to shell before install, look around.

Nick.

From: Gregory Edigarov
Date: Friday, September 21, 2007 - 8:07 am

I.e. they depend on the PCI slot they inserted, if I get you correct.
Well, thank you for so in-depth explanation, but what I meant really 
was: is it guaranteed that if one take a card from the server and then 
install the other card of the same make to the same slot, it will have 
the same id?
I will do more research about it , however.... :-)

The best thing however would be to have the ability to set the name of 
an intreface based on it's mac address, perhaps somebody is working on 
it/having it on the todo list?

-- 
With best regards,
    Gregory Edigarov

From: Marius ROMAN
Date: Friday, September 21, 2007 - 8:54 am

Something like iftab on debian.


From: Nick Guenther
Date: Sunday, September 23, 2007 - 5:11 pm

This won't happen. The developers value simplicity over error-prone complexity.

How many times do you need to move a card from machine to machine that
you wouldn't be configuring things by hand anyway?
If you need to keep the same config for each card handy, read
hostname.if(8) and use those; e.g. /etc/hostname.de0 contains the
config for your card on one machine; you move the card to another and
it becomes de3, so copy the file and rename it to /etc/hostname.de3 on
the new machine.

Always ask: what's the real issue?

-Nick

From: Ted Unangst
Date: Monday, September 24, 2007 - 2:05 pm

yes, if it's the same card, it will get the name number.

Previous thread: Search Foreclosures Now !**HOT** by Pamela on Friday, September 21, 2007 - 12:35 am. (1 message)

Next thread: 2007-09-20 from sweden to south africa by bike by AfricaByBike Newsletter on Friday, September 21, 2007 - 3:10 am. (1 message)