# On which principles FreeBSD giving the NICs ports identity?



## Sergei_Shablovsky (Mar 28, 2022)

Hi, all FreeBSD Gurus!

Could You be so please to explain:
On which principles FreeBSD giving the NICs ports identity?

From my knowledge, there are involved (from HIGHT IMPACT to LOW):
motherboard schematics,
BIOS subsystem,
NICs mechanical interface (PCI, PCI-e, etc...),
NICs order in motherboard slots,
FreeBSD drivers,
...
?

Thank You for help and opinions!


----------



## shkhln (Mar 28, 2022)

Enumeration order. It's not supposed to be stable with regard to the hardware changes.


----------



## Sergei_Shablovsky (Mar 28, 2022)

shkhln said:


> Enumeration order. It's not supposed to be stable with regard to the hardware changes.


I know that. I asking for details...


----------



## shkhln (Mar 28, 2022)

There is nothing more to it. If you want to (relatively) reliably identify individual ports, you can use MAC addresses for that.


----------



## Phishfry (Mar 29, 2022)

Two options come to mind.

Manually set interface names in /boot/device.hints

```
hint.igb.0.at="pci0:6:0:3"
hint.igb.1.at="pci0:6:0:2"
hint.igb.2.at="pci0:6:0:1"
hint.igb.3.at="pci0:6:0:0"
hint.igb.4.at="pci0:9:0:0"
```
Drawback here is any PCIe card install/removal could change pci bus address of your interfaces and need fixup.

Then Eric A. Borisch's port.
sysutils/ethname


----------

