What's new

Update mac vendor list? oui.txt

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

aris

Occasional Visitor
I'm on 380.70 on an n66u - yes, i know old old, out of support etc..

I was just wondering if there was a way to update the mac vendor list as shown in the client list. Normally one a *ix system you would update oui.txt - but I don't see a file like that on Merlin.

No biggie if it cannot be done (hard coded?) - but it would be nice :)

Thanks,
 
I'm on 380.70 on an n66u - yes, i know old old, out of support etc..

I was just wondering if there was a way to update the mac vendor list as shown in the client list. Normally one a *ix system you would update oui.txt - but I don't see a file like that on Merlin.

No biggie if it cannot be done (hard coded?) - but it would be nice :)

Thanks,
EDIT:
Not sure if The same applies to RT-N66U (I'll have to find mine to check; unless someone jumps in), uses '/www/ouiDB.js' but on RT-AC68U check contents of
Code:
/www/js/ouiDB.js
but you can write a small script to validate the entries...i.e. the following script could easily be adapted to modify the current 'ouiDB.js' can simply be recreated with a simple curl/awk one-liner!

e.g.
Code:
#!/bin/sh
VER="1.01"
###############################################################################################################################
#
# Online lookup of Vendor ID uses first 24-bits of MAC_address
#
#     OUI_MAC_lookup     {'MAC_address'} [short]
#
#     OUI_MAC_lookup     00:11:32:4A:81:C9
#
#                        Will produce results:
#
#                              OUI Results for '00:11:32' ('00:11:32:4A:81:C9')
#
#                           00-11-32
#                           00-11-32-00-00-00 - 00-11-32-FF-FF-FF
#                           Synology Incorporated
#
#
#     OUI_MAC_lookup     40:B0:76
#
#                        Will produce results:
#
#                              OUI Results for '40:B0:76' ('40:B0:76')
#
#                           40:B0:76
#                           40:B0:76-00-00-00 - 40:B0:76-FF-FF-FF
#                           ASUSTek COMPUTER INC.

Main() { true; }   # Syntax that is Atom Shellchecker compatible!

[ -n "$2" ] && RECS=1 || RECS=3

VENDOR_ID=${1:0:8}

THIS=$(echo "$VENDOR_ID" | sed 's/:/%3A/g')

if [ -z "$2" ];then
 Say $VER "OUI Vendor ID MAC lookup"
 echo -e "\n\t${cBCYA}OUI Results for '$VENDOR_ID' ('$1')\n"$cBYEL
fi

curl -s https://hwaddress.com/?q=$THIS | grep -E 'class="mac">|href=' | sed 's/<\/a><\/td>//;s/<\/span><\/td>//;s/<td><//;s/^.*>//'  | tail -n $RECS
 
Last edited:
That's the file - thanks!

Newb question - how do I make that FS read-write so I can update the file?
 
Newb question - how do I make that FS read-write so I can update the file?
Short answer: You don't.

Long answer:

Retrieve an updated '/jffs/configs/ouiDB.js' to include missing vendors etc.

e.g. quick'n'dirty lazy one-liner command hack (i.e. it can take between 5 and 7 seconds to process the downloaded text file)
Code:
NOW=$(date "+%s");curl --progress-bar http://standards-oui.ieee.org/oui.txt | grep "base 16" | sed -e 's/ \+(base 16)//g' -e 's/   \+/     /g' | sort -k2 | awk -v timestamp="$NOW" 'BEGIN{print "updateManufacturer(\{"} END{print "\"timestamp\":\""timestamp"\"\n\});"} {printf "\"%s\":\"",$1;for(i=2; i<=NF; ++i) printf "%s ",$i; print """\","}' | sed 's/ "/"/' > /jffs/configs/ouiDB.js
You can subsequently always perform a 'diff' between the two files (or simply compare the record counts) to see what has been added...27982 Vendor entries as of today 20th May 2020

To instruct the firmware to use your new OUI Database simply remap your new R/W version over the R/O firmware version. (NOTE: A reboot will revert to the ROM version unless you use a script such as services-start to auto-apply the remap during the boot process.

e.g. set the target as appropriate for your router.
Code:
mount -o bind /jffs/configs/ouiDB.js /www/ouiDB.js
 
Last edited:
There may be something else amiss...
If it hasn't been removed, the firmware would automatically try to go to the web if an entry wasn't found in the local oui db. Sometimes the format of the web version gets changed and breaks things.
 
@aris any reason you're not using the much more secure, and current/updated version for your router from john9527's RMerlin fork? :)
 
@aris any reason you're not using the much more secure, and current/updated version for your router from john9527's RMerlin fork? :)

If it supports the N66U - didn't know it existed :). I'll look into it, though I was going to upgrade my router soon-ish. Unsure if I will go for another Asus, or just go down the pfsense route and ubiquiti access points.
 
Had a quick look. Seems I have to do a full factory reset, and then upgrade via the restoration tool. Let me think about it - sounds like a complete drag :p Just curious - after the reset - will it load a config backup, or will I have to do that from scratch too?
 
From scratch, and without 'blindly' putting in old settings/configurations too. :)

See the M&M Config guide from the link in my signature below for a good set of defaults to start with.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top