How to change order of NICs in FreeBSD?

Erik Trulsson ertr1013 at student.uu.se
Mon Apr 24 13:50:40 UTC 2006


On Mon, Apr 24, 2006 at 03:29:52PM +0200, Ferdinand Goldmann wrote:
> Hi there,
> 
> this might be an easy one, but I seem to be unable to come up with a google'd
> solution. :(
> 
> I have a machine with four network cards using the em driver:
> 
> em0 at pci2:12:0:  class=0x020000 card=0x10028086 chip=0x10268086 rev=0x04 hdr=0x00
> em1 at pci3:11:0:  class=0x020000 card=0x10028086 chip=0x10268086 rev=0x04 hdr=0x00
> em2 at pci6:7:0:   class=0x020000 card=0x016d1028 chip=0x10768086 rev=0x05 hdr=0x00
> em3 at pci7:8:0:   class=0x020000 card=0x016d1028 chip=0x10768086 rev=0x05 hdr=0x00
> 
> Two of the cards are onboard, namely em2 and em3, and the other two (em0, em1)
> are sitting in expansion slots. I would like to change the order of the cards,
> so that the onboard cards are recognized as em0 and em1.
> 
> I tried using the device.hints file, but without much success. Is there any
> way how to do this?
> 

I don't think there is any way to change in what order the kernel detects
and configures them, but it is possible to rename the interfaces
somewhat later in the boot process.


You could try using the 'name' option to ifconfig(8).
I believe the syntax is:

ifconfig [oldifname] name [newifname]

This can also be done via /etc/rc.conf.
Read the the section on network_interfaces in the manpage for rc.conf(5) for
syntax.



You will probably have a minor problem if you wish to rename {em2, em3} to
{em0, em1} while at the same time renaming the original {em0,em1} to
{em2,em3} but that should be easily resolved using temporary names.



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se


More information about the freebsd-net mailing list