Deterministic ethernet naming scheme?

Kernel development, writing drivers, coding, and questions regarding FreeBSD internals.

Deterministic ethernet naming scheme?

Postby billli » 26 Nov 2011, 05:07

Hi:
On FreeBSD 8.2 I was wondering is the naming of ethernet interfaces consistent in the event of reboot.
ie)The right most interface will be suffixed with 0, then the one next to it will be suffixed with 1, etc, and will stay the same regardless of rebooting.

As I recall with FreeBSD 4, it was the first interface that responded was suffixed with 0, and so on.

The reason is that I have a script that depends on the interfaces' name staying consistent.

With FreeBSD 8.2, what happens if say I have 3 physical interfaces, named em0, em1, and em2, ordered from left, middle, right, what if the middle interface physically gets damaged, would em0, and em1 show up, or would em0 and em2 show up?

Thanks
Bill
billli
Junior Member
 
Posts: 16
Joined: 19 Jan 2011, 15:25

Postby graudeejs » 26 Nov 2011, 10:14

lol, about network card placement :)

Number shouldn't change.... At least for me, they are always in same order :D (Unless you add new card, then numbers might change)
User avatar
graudeejs
Style(9) Addict
 
Posts: 4591
Joined: 16 Nov 2008, 23:23
Location: Riga, Latvia

Postby Crest » 26 Nov 2011, 11:06

You could use ifconfig $old name $new an search for $old by mac address.
Crest
Member
 
Posts: 114
Joined: 28 Jan 2009, 08:23
Location: ::1

Postby SirDice » 01 Dec 2011, 10:03

billli wrote:With FreeBSD 8.2, what happens if say I have 3 physical interfaces, named em0, em1, and em2, ordered from left, middle, right, what if the middle interface physically gets damaged, would em0, and em1 show up, or would em0 and em2 show up?

It depends on how damaged the card is. If it's not detected on PCI (or PCIe) then you'd end up with [file]em0[/file] (left card) and [file]em1[/file] (right card). If, more commonly, only the network side is broken but it's still detected there would be no change.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16196
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands


Return to FreeBSD Development

Who is online

Users browsing this forum: No registered users and 0 guests