Freebsd – Persistent naming for NICs in FreeBSD

freebsdudev

Is there anything equivalent to Debians udev rules on FreeBSD? I was hoping to set the name on devices according to the devices attributes such as PCI bus/MAC etc.

However, FreeBSD only seems to allow you rename the device after it's already set the device name. i.e. after the card is detected at boot and depending on the order, assigning names such as em0, em1 …

I know that configuring rc.local should allow you to rename the interface but I prefer naming a device by it's attribute rather device name.
e.g ifconfig_em0_name=eth0.

Best Answer

The closest thing to a direct answer to your question would be to look at devd.conf, but if you just want to rename the interface, adding

ifconfig_em0_name="eth0"

to your rc.conf should do the trick. But this is probably just going to make it harder for other FreeBSD users to help you.

Related Question