Posted: Sun Sep 07, 2014 19:18 Post subject: Script to set a random MAC address for WAN when booting?
I would like to set my DD-WRT router to choose one of a handful of WAN MAC addresses when booting the router (or at another time of my choosing). Ideally, the script should run early enough in the boot that the cable modem sees only the newly chosen WAN mac address and not the one left over from the last time. This will enable a new IP address if the modem is booting at the same time, eg when I am turning my network equipment on after an absence.
My cable company uses a sticky address that only changes if the router's WAN MAC address is different than last time as the modem is booting, and I would like it be a little more dynamic that that.
I would like the WAN MAC address to be chosen from a list, rather than totally random so I can use addresses selected from devices I own to ensure I do not accidentally create a conflict on the network. The modem runs in bridge mode and exposes the WAN MAC address to the larger cable network.
I saw the above script, but I do not want totally random. I want to rotate between, say five specific MAC addresses (that are for devices I own so I don't step on anyone's MAC address).
MAC's are only an issue within your collision domain I.E. your network. Other than that it all take place at layer 3 (IP ADDRESSES) so MAC collisions are nearly impossible unless you do something very wrong on your network. You will never collide with your ISP. _________________ EA-6900
Asus 68U
In this case, the MAC address of the router is exposed to the cable provider, with the modem in bridge mode. In fact the WAN MAC address is used by the cable company for their DHCP leases, and changing it gets a new public IP address. I would like to choose a WAN MAC address from a small list that I set up.
as long as your Cable modem boots up after wards it will be fine. Some cable modems bind to a mac of the connected device on boot-up. So boot your router first and it will change the mac then boot the cable modem.
If you own your own cable modem then you can work some other magic to reset it form the router with a script. Let me know if you own it or rent it. _________________ EA-6900
Asus 68U
as long as your Cable modem boots up after wards it will be fine. Some cable modems bind to a mac of the connected device on boot-up. So boot your router first and it will change the mac then boot the cable modem.
If you own your own cable modem then you can work some other magic to reset it form the router with a script. Let me know if you own it or rent it.
I rent the modem (for no extra charge).
Some Arris modems can be rebooted from a web browser by requesting the below URL, but it don't work on this one (TM822). What does?
yeah then you may be out of luck when you change the MAC as most modems don't like it but ya never know till you try _________________ EA-6900
Asus 68U
yeah then you may be out of luck when you change the MAC as most modems don't like it but ya never know till you try
I have no issue changing MAC address of the router as long as I reboot the modem too. Ideally I would like to create a script in DD-WRT that changes the MAC address to one of several chosen randomly or sequentially, and then reboot the modem with an appropriate wget or something.
yeah then you may be out of luck when you change the MAC as most modems don't like it but ya never know till you try
I have no issue changing MAC address of the router as long as I reboot the modem too. Ideally I would like to create a script in DD-WRT that changes the MAC address to one of several chosen randomly or sequentially, and then reboot the modem with an appropriate wget or something.
wget with maybe a sleep after to reboot the router which would allow the modem to at least start rebooting before you reboot the router. I'm not a script expert, but it seems like this should be possible. _________________ R7000 Nighthawk - DD-WRT v3.0-r50308
R7000 Nighthawk - DD-WRT v3.0-r50308
~~~~~~~~~~Dismantled for learning opportunities~~~~~~~~~~
WRT54Gv2
WRT54Gv8.2
~~~~~~~~~~Other Settings~~~~~~~~~
https://nextdns.io/?from=2d3sq39x https://pi-hole.net/ https://github.com/DNSCrypt/dnscrypt-proxy
If you own the router it is possible at times. some will do it via a http request other do not really depends on the modem. _________________ EA-6900
Asus 68U