Any way to read serial number from Alix2d3 via software?



  • I have a number of Alix 2d3 units with pfSense (various versions) installed in remote locations.  The Alix 2d3 boards have serial numbers printed on them, and I try to keep track of which serial number is installed at which location.  It would be useful to be able to verify my records remotely.  Does anyone know if it's possible to read this serial number via software somehow?  I'm not seeing it in the output of dmesg or sysctl -a.


  • Rebel Alliance Developer Netgate

    Normally one would use a tool such as dmidecode to fetch BIOS information but that doesn't work on an ALIX.

    I'm not sure there is any correlation between the serial and other details you can see (e.g. MAC address) either, some quick number/math comparisons didn't find any but there could be some deeper connection I'm not seeing.



  • @jimp:

    Normally one would use a tool such as dmidecode to fetch BIOS information but that doesn't work on an ALIX.

    I'm not sure there is any correlation between the serial and other details you can see (e.g. MAC address) either, some quick number/math comparisons didn't find any but there could be some deeper connection I'm not seeing.

    There is, according to this http://pcengines.info/forums/?page=post&id=3C0FCCCF-6907-40A3-9DB6-9043CB3FC6A1

    The linux tool called flashrom can read and write the BIOS. Feel free to modify it, but an LPC module is recommended doing so to recover bricked boards.

    There is a tool called setid.exe which lets you set any MAC address, please contact us for it. Probably also available as source code.

    MAC ID = 00:0d:b9 (our OUI) : (serial + 64) * 4

    Serial number is WN xxxxxx (ignore the _yyww date code).


  • Netgate Administrator

    Presumably that would be for the lowest MAC (vr0 ?) and +1 for the others?

    Steve


  • Rebel Alliance Developer Netgate

    aha, I didn't try multiples… figures.

    Here's a one-liner that will calculate it:

    ifconfig vr0 | awk '/ether 00:0d:b9/ { split($2,mac,":"); print sprintf("%d", "0x"mac[4]mac[5]mac[6])/4-64; }'
    

  • Rebel Alliance Developer Netgate

    @stephenw10:

    Presumably that would be for the lowest MAC (vr0 ?) and +1 for the others?

    At least for mine, it is the first mac (vr0)



  • @jimp:

    Here's a one-liner that will calculate it:

    ifconfig vr0 | awk '/ether 00:0d:b9/ { split($2,mac,":"); print sprintf("%d", "0x"mac[4]mac[5]mac[6])/4-64; }'
    

    Just wanted to confirm that this worked perfectly for me.  Thanks a lot Jim and Charlie!


Log in to reply