OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: nitish.patel on November 11, 2023, 10:24:14 AM

Title: RJ45 ports
Post by: nitish.patel on November 11, 2023, 10:24:14 AM
After installing the ISO, the ethernet ports in my ngfw the ports are assigned randomly, e.g., port 6 -> igb0, port5 -> igb1 and so on, and also I had checked this issue in couple of devices. How to overcome this issue.
Title: Re: RJ45 ports
Post by: Stormscape on November 11, 2023, 11:11:24 AM
You can't. It's based on the order FreeBSD detects the devices during boot.
Title: Re: RJ45 ports
Post by: sja1440 on November 11, 2023, 04:37:04 PM
But you can reassign the ports during installation as described here: https://docs.opnsense.org/manual/install.html
Title: Re: RJ45 ports
Post by: doktornotor on November 11, 2023, 04:41:04 PM
You can even do things like this (https://forum.opnsense.org/index.php?topic=27023.msg132002#msg132002) with ethname and syshooks (https://docs.opnsense.org/development/backend/autorun.html#syshook). (Complete overkill here, simply assign and label the ports and move on.)
Title: Re: RJ45 ports
Post by: nitish.patel on November 15, 2023, 10:09:12 AM
As OPNsense uses ports from software ports (not harware or physical ports) from both freebsd as well as openbsd. Which repository in OPNsense or which part of the build process is responsible for assigning physical ports and mapping them with respective physical ports number.
Title: Re: RJ45 ports
Post by: Patrick M. Hausen on November 15, 2023, 10:16:29 AM
Quote from: nitish.patel on November 11, 2023, 10:24:14 AM
After installing the ISO, the ethernet ports in my ngfw the ports are assigned randomly, e.g., port 6 -> igb0, port5 -> igb1 and so on, and also I had checked this issue in couple of devices. How to overcome this issue.
They are not assigned randomly but in order of the devices on the PCI bus.

The fact that somebody printed some numbers on the case of some appliance bears no resemblance to the way FreeBSD sees those interfaces. If it bothers you I suggest you use a label printer.
Title: Re: RJ45 ports
Post by: Stormscape on November 15, 2023, 12:40:02 PM
Quote from: nitish.patel on November 15, 2023, 10:09:12 AM
As OPNsense uses ports from software ports (not harware or physical ports) from both freebsd as well as openbsd. Which repository in OPNsense or which part of the build process is responsible for assigning physical ports and mapping them with respective physical ports number.
It's the order they're presented on the PCI bus, nothing else. You'd have to contact the hardware manufacturer and have them rearrange the ports on the bus to change this behaviour.