openwrt-wan-mac icon indicating copy to clipboard operation
openwrt-wan-mac copied to clipboard

Only randomly generate last 3 octets

Open phetzy opened this issue 2 years ago • 1 comments

im trying to wrap my head around how to change it myself but cant see to figure it out.

I want to configure this to keep the first 3 octets so have the device show up as a specific vendor.

is there a way to only randomly generate the last 3 octets?

phetzy avatar Oct 19 '22 19:10 phetzy

If you want to hardcode the first three octets as a string, try this instead of the original line in the script: NEWMAC=$(printf "%s" "22:11:00" && hexdump -n3 -e'/1 ":%02x"' /dev/urandom)

or if you want to keep the first three octects of your real MAC address automatically: NEWMAC=$(printf "%s" "${OLDMAC:0:8}" && hexdump -n3 -e'/1 ":%02x"' /dev/urandom)

DocSniper avatar Oct 26 '22 12:10 DocSniper