Change Hardware MACS for wan/lan on WHR-G300N - How-To

Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware
Goto page 1, 2, 3  Next
Author Message
DoesItMatter
DD-WRT Guru


Joined: 10 May 2008
Posts: 1380
Location: Pacific North West, USA

PostPosted: Tue Jan 12, 2010 5:27    Post subject: Change Hardware MACS for wan/lan on WHR-G300N - How-To Reply with quote
OK...

I'm gonna post some steps but you MUST follow the requirements.

Requirement 1) Build 13525 or 13637 from Brainslayer loaded.
Requirement 2) Reset to defaults!
Requirement 3) No other settings yet, these first.
Requirement 4) Wireless MAC - note for below.


OK...

Now that those requirements are out of the way, on to the fun!

I was examining the NVRAM table and found these values:

et0macaddr=00:00:00:00:00:00

et0macaddr_safe=00:00:00:00:00:00

lan_hwaddr=00:00:00:00:00:00

wan_hwaddr=00:00:00:00:00:00

def_whwaddr=00:00:00:00:00:00

def_hwaddr=00:00:00:00:00:00

--------------------------------------

We are going to change these right in the nvram portion via startup script.

These values will be based off your Wireless MAC values.

Load up a fresh session of your internet browser and goto DD-WRT GUI.

Log in, and goto the Administation tab, Commands sub-tab.

OK, at this point, if you are lost, STOP. Get more help first.

If you know whats going on and can see what's coming next, continue ;)

-----------------------

OK - this is based off example WL0 MAC address of 00:11:22:33:44:55

We'll cut/paste the following commands into the command portion.

EDIT the values based off YOUR WL0 MAC address!
Do NOT cut and paste these without editing!

(start cut/paste below the line)
------------------------

nvram set wan_hwaddr=00:11:22:33:43:54
nvram set lan_hwaddr=00:11:22:33:42:53
nvram set et0macaddr=00:11:22:33:42:53
nvram set et0macaddr_safe=00:11:22:33:42:53

nvram commit

gpio disable 14

-------------------------
(end cut/paste above the line)

The "gpio disable 14" is purely cosmetic, it turns on the wireless security LED.

Once you apply those, check the sys-info page.
The MACS should all be different than the standard of:

lan_hwaddr=00:1D:73:11:11:12
wan_hwaddr=00:1D:73:11:11:13

---------------------------

Do a router reboot, and you'll see the settings will keep the MAC's.

Now go and change other settings to whatever you want.

-----------------------------

I have ONLY tried this on 13525 & 13637. This MAY NOT work with earlier builds.

There is supposed to be a MAC fix in the newer builds,
and I had no problems changing the MAC addresses on my router.

As always - this is not my responsibility.
It may work great for you, or it may brick your router.

_________________
Evil or Very Mad Soylent Green Is People ! Evil or Very Mad
Twisted Evil =-=-=-=-=-=-=-=-=-=-= Twisted Evil
Netgear Nighthawk R7000 - DD-WRT Build R46220
Linksys EA8500 - OpenWRT IPQ806x Trunk R16375 5.4 Kernel

TP-Link Archer C7 V3 - OpenWRT Build R16290 5.4 Kernel
Linksys E3000 - FreshTomato Build MIPSR2 2021.2


Last edited by DoesItMatter on Sun Jan 17, 2010 22:04; edited 7 times in total
Sponsor
DoesItMatter
DD-WRT Guru


Joined: 10 May 2008
Posts: 1380
Location: Pacific North West, USA

PostPosted: Tue Jan 12, 2010 5:35    Post subject: Reply with quote
READ THIS SECTION ALSO!

The steps above do not always work on all WHR-G300N's

There is another way to fix this.

Goto the Main Setup tab, then the MAC Address Clone sub-tab.

Click the Enable radio button.

Fill in the Wireless MAC info as the SAME info from the Sys-Info page.

Don't change the Wireless MAC to a different value than what is shown on the Sys-Info page - its un-necessary!

You SHOULD change the WAN MAC address.

You should only have to change the last 3 hex values.

They can be whatever you want, leave the first 3 values alone.

Apply Settings and reboot.

This DOES work on 13525 and 136387!

_________________
Evil or Very Mad Soylent Green Is People ! Evil or Very Mad
Twisted Evil =-=-=-=-=-=-=-=-=-=-= Twisted Evil
Netgear Nighthawk R7000 - DD-WRT Build R46220
Linksys EA8500 - OpenWRT IPQ806x Trunk R16375 5.4 Kernel

TP-Link Archer C7 V3 - OpenWRT Build R16290 5.4 Kernel
Linksys E3000 - FreshTomato Build MIPSR2 2021.2


Last edited by DoesItMatter on Fri Jan 22, 2010 8:05; edited 4 times in total
csplinter
DD-WRT Novice


Joined: 15 May 2009
Posts: 17

PostPosted: Tue Jan 12, 2010 15:23    Post subject: Reply with quote
This is fantastic. Thanks for your efforts.
mrg666
DD-WRT User


Joined: 22 Oct 2009
Posts: 157
Location: North East - USA

PostPosted: Wed Jan 13, 2010 15:40    Post subject: Reply with quote
This is great, thanks for posting! I will try on my WHR-G300N routers and post the results here. It will be great to delete the startup scripts I am using right now to fix those MACs.
_________________
WNR3500L DD-WRT-18730-Kong Gateway/Firewall/NAS
WRT54G-TM DD-WRT-14929 Mega (heatsink + 250MHz oc)
WHR-G300N DD-WRT-20548(external antennas)
2x E2000 Tomato-Toastman 0501.2 AP (external antennas)
TEW-652BRP Gargoyle 1.5.9 Client Bridge (antenna upgrade + heatsinks + ventilation)
DerUltrazauberer
DD-WRT User


Joined: 11 Jun 2008
Posts: 131

PostPosted: Wed Jan 13, 2010 19:37    Post subject: Reply with quote
Why I should change the MACs of the router? Are there any advantages?
DoesItMatter
DD-WRT Guru


Joined: 10 May 2008
Posts: 1380
Location: Pacific North West, USA

PostPosted: Thu Jan 14, 2010 0:45    Post subject: Reply with quote
The advantages are if you have multiple WHR-G300N's and need to network them.

There has been a MAC address conflict with multiple WHR-G300N's going on for a while.

This should help resolve it by changing the MAC's so that you can use more than one on the network.

_________________
Evil or Very Mad Soylent Green Is People ! Evil or Very Mad
Twisted Evil =-=-=-=-=-=-=-=-=-=-= Twisted Evil
Netgear Nighthawk R7000 - DD-WRT Build R46220
Linksys EA8500 - OpenWRT IPQ806x Trunk R16375 5.4 Kernel

TP-Link Archer C7 V3 - OpenWRT Build R16290 5.4 Kernel
Linksys E3000 - FreshTomato Build MIPSR2 2021.2
mrg666
DD-WRT User


Joined: 22 Oct 2009
Posts: 157
Location: North East - USA

PostPosted: Thu Jan 14, 2010 15:56    Post subject: Reply with quote
mrg666 wrote:
This is great, thanks for posting! I will try on my WHR-G300N routers and post the results here. It will be great to delete the startup scripts I am using right now to fix those MACs.


I thought initially that this script was setting the MAC addresses permanently until the next hard reset. But I realized that it is also a startup script. Anyway, I tried the script and they work great for setting the MAC addresses. However, after using the scripts on both routers (AP-RB), of course with respective MAC addresses. I was not able to open the AP GUI from the PC connected to the repeater bridge via Ethernet cable as if there was a MAC address collision. There was no MAC address violations either but it simply was not possible. I tried rebooting, hard resetting several times as described here and I went back to the previous startup script (given below as I found in this forum). I was able to access the AP GUI again.

i=`nvram get wl0_hwaddr`
ifconfig br0 hw ether $i
nvram set lan_hwaddr=$i
nvram set et0macaddr=$i
nvram set wan_hwaddr=$i
nvram commit

_________________
WNR3500L DD-WRT-18730-Kong Gateway/Firewall/NAS
WRT54G-TM DD-WRT-14929 Mega (heatsink + 250MHz oc)
WHR-G300N DD-WRT-20548(external antennas)
2x E2000 Tomato-Toastman 0501.2 AP (external antennas)
TEW-652BRP Gargoyle 1.5.9 Client Bridge (antenna upgrade + heatsinks + ventilation)
DoesItMatter
DD-WRT Guru


Joined: 10 May 2008
Posts: 1380
Location: Pacific North West, USA

PostPosted: Thu Jan 14, 2010 16:20    Post subject: Reply with quote
Hmm... I'll try that when I get home and see if allows me access.

Was it wireless, or wired, or both that didn't allow access through the bridge?

I'll try both ways and see if it matters.

---------------

mrg666 - one thing I just noticed:

nvram set et0macaddr=00:11:22:33:42:53
nvram set et0macaddr_safe=00:11:22:33:42:53
nvram set lan_hwaddr=00:11:22:33:42:53 << Lan Diff
nvram set wan_hwaddr=00:11:22:33:43:54 << Wan Diff
nvram commit

compared to the script above:

i=`nvram get wl0_hwaddr`
ifconfig br0 hw ether $i
nvram set lan_hwaddr=$i << Lan Same?
nvram set et0macaddr=$i
nvram set wan_hwaddr=$i << Mac Same?
nvram commit

----------------

The main difference I see is Lan and Wan are set to the same MAC in the script.

However, in the default firmware options, the LAN and WAN macs are different by 1 hex.
I.e. before any scripts, it defaults to diff macs:

lan_hwaddr=00:1D:73:11:11:12
wan_hwaddr=00:1D:73:11:11:13

I wonder if thats the bug?

_________________
Evil or Very Mad Soylent Green Is People ! Evil or Very Mad
Twisted Evil =-=-=-=-=-=-=-=-=-=-= Twisted Evil
Netgear Nighthawk R7000 - DD-WRT Build R46220
Linksys EA8500 - OpenWRT IPQ806x Trunk R16375 5.4 Kernel

TP-Link Archer C7 V3 - OpenWRT Build R16290 5.4 Kernel
Linksys E3000 - FreshTomato Build MIPSR2 2021.2
DoesItMatter
DD-WRT Guru


Joined: 10 May 2008
Posts: 1380
Location: Pacific North West, USA

PostPosted: Thu Jan 14, 2010 20:05    Post subject: Reply with quote
OK - didn't want to edit prior post since that was too long!

This is my current test setup:

All 3 routers are WHR-G300N's with 13525

All settings are the same as my AP/RB How-To post

Access Point R#1 <== Repeater Bridge (R#2)
Access Point R#1 <== Repeater Bridge (R#3)

So Router 1 has 2 Repeater Bridges connected

Router #1 has 1 completely different set of MACS

Routers #2 and #3 have the SAME MACS for these values:

lan_hwaddr=00:1D:73:11:11:12
wan_hwaddr=00:1D:73:11:11:13

Routers #2 and #3 only have different MACS for the WIRELESS

Router #1 can access #2 and #3

Router #2 can access Router #1

Router #3 can access Router #1

Router #2 cannot access Router #3 and vice versa

Which I think is how its supposed to be in repeater bridge mode.

So - I'm not sure, maybe I'm lucky and connect these fine with same MACS?

Since these are wireless bridges, the WAN and LAN MACS are irrelevant anyway?

_________________
Evil or Very Mad Soylent Green Is People ! Evil or Very Mad
Twisted Evil =-=-=-=-=-=-=-=-=-=-= Twisted Evil
Netgear Nighthawk R7000 - DD-WRT Build R46220
Linksys EA8500 - OpenWRT IPQ806x Trunk R16375 5.4 Kernel

TP-Link Archer C7 V3 - OpenWRT Build R16290 5.4 Kernel
Linksys E3000 - FreshTomato Build MIPSR2 2021.2
mrg666
DD-WRT User


Joined: 22 Oct 2009
Posts: 157
Location: North East - USA

PostPosted: Thu Jan 14, 2010 20:18    Post subject: Reply with quote
DoesItMatter wrote:
Hmm... I'll try that when I get home and see if allows me access.

Was it wireless, or wired, or both that didn't allow access through the bridge?


I have configuration like this

WRT54G-TM(AP,Gateway) <==wired==> WHR-G300N#1(AP only) <==wireless bridge==> WHR-G300N#2 (no AP)<==wired==> My pc

DoesItMatter wrote:
mrg666 - one thing I just noticed:

nvram set et0macaddr=00:11:22:33:42:53
nvram set et0macaddr_safe=00:11:22:33:42:53
nvram set lan_hwaddr=00:11:22:33:42:53 << Lan Diff
nvram set wan_hwaddr=00:11:22:33:43:54 << Wan Diff
nvram commit

compared to the script above:

i=`nvram get wl0_hwaddr`
ifconfig br0 hw ether $i
nvram set lan_hwaddr=$i << Lan Same?
nvram set et0macaddr=$i
nvram set wan_hwaddr=$i << Mac Same?
nvram commit

----------------

The main difference I see is Lan and Wan are set to the same MAC in the script.

However, in the default firmware options, the LAN and WAN macs are different by 1 hex.
I.e. before any scripts, it defaults to diff macs:

lan_hwaddr=00:1D:73:11:11:12
wan_hwaddr=00:1D:73:11:11:13

I wonder if thats the bug?


You are right, having the same mac for LAN, WAN, and Wireless are not creating any trouble for me as long as those MACS are different across two routers. I think your script assigns ideal MAC numbers, i.e. all of them different. And I have verified that. I want to use your script but it is puzzling why I can not access WHR-G300N#1 GUI from my pc. I can access the other two routers, internet just fine.

_________________
WNR3500L DD-WRT-18730-Kong Gateway/Firewall/NAS
WRT54G-TM DD-WRT-14929 Mega (heatsink + 250MHz oc)
WHR-G300N DD-WRT-20548(external antennas)
2x E2000 Tomato-Toastman 0501.2 AP (external antennas)
TEW-652BRP Gargoyle 1.5.9 Client Bridge (antenna upgrade + heatsinks + ventilation)
mrg666
DD-WRT User


Joined: 22 Oct 2009
Posts: 157
Location: North East - USA

PostPosted: Thu Jan 14, 2010 20:30    Post subject: Reply with quote
DoesItMatter wrote:
Since these are wireless bridges, the WAN and LAN MACS are irrelevant anyway?


When two WHR-G300N routers have the same LAN MAC address I can not access the first router from my pc (see the configuration in my previous post). Those LAN MACS somehow collide in wireless bridge configuration. But I don't understand how that happens with your script when the MACS are different. By the way, WHR-G300N#1 shows a different MAC address for the wireless bridge connection of WHR-G300N#2 in status page. I mean: when the Wireless MAC of second router is xx:xx:xx:xx:xx:38, first router reports the wireless bridge connection of second router with xx:xx:xx:xx:xx:39. I think DD-WRT is automatically creating a virtual interface for the bridge connection.

_________________
WNR3500L DD-WRT-18730-Kong Gateway/Firewall/NAS
WRT54G-TM DD-WRT-14929 Mega (heatsink + 250MHz oc)
WHR-G300N DD-WRT-20548(external antennas)
2x E2000 Tomato-Toastman 0501.2 AP (external antennas)
TEW-652BRP Gargoyle 1.5.9 Client Bridge (antenna upgrade + heatsinks + ventilation)
DoesItMatter
DD-WRT Guru


Joined: 10 May 2008
Posts: 1380
Location: Pacific North West, USA

PostPosted: Fri Jan 15, 2010 4:35    Post subject: Reply with quote
So - you cannot access WHR-G300N AP #1 when you have WHR-G300N RB hooked up with same MACS?

Or you mean you cant access the WRT54G-TM from your PC?

If its the WRT54G-TM you're trying to access, what you should be able to do
is do this. Put your PC into the DMZ of the WHR-G300N #1 AP.

That way it should be able to access the WRT54G-TM from the repeater bridge also.

_________________
Evil or Very Mad Soylent Green Is People ! Evil or Very Mad
Twisted Evil =-=-=-=-=-=-=-=-=-=-= Twisted Evil
Netgear Nighthawk R7000 - DD-WRT Build R46220
Linksys EA8500 - OpenWRT IPQ806x Trunk R16375 5.4 Kernel

TP-Link Archer C7 V3 - OpenWRT Build R16290 5.4 Kernel
Linksys E3000 - FreshTomato Build MIPSR2 2021.2
mrg666
DD-WRT User


Joined: 22 Oct 2009
Posts: 157
Location: North East - USA

PostPosted: Fri Jan 15, 2010 14:10    Post subject: Reply with quote
DoesItMatter wrote:
So - you cannot access WHR-G300N AP #1 when you have WHR-G300N RB hooked up with same MACS?

Or you mean you cant access the WRT54G-TM from your PC?

If its the WRT54G-TM you're trying to access, what you should be able to do
is do this. Put your PC into the DMZ of the WHR-G300N #1 AP.

That way it should be able to access the WRT54G-TM from the repeater bridge also.


Sorry, let me clarify. There is no problem with accessing the WRT54G-TM router. It is the first WHR-G300N router I can not access either when the LAN MAC addresses are the same between the two router or I use your startup script. The other startup script works fine. I don't understand why.

_________________
WNR3500L DD-WRT-18730-Kong Gateway/Firewall/NAS
WRT54G-TM DD-WRT-14929 Mega (heatsink + 250MHz oc)
WHR-G300N DD-WRT-20548(external antennas)
2x E2000 Tomato-Toastman 0501.2 AP (external antennas)
TEW-652BRP Gargoyle 1.5.9 Client Bridge (antenna upgrade + heatsinks + ventilation)
antok86
DD-WRT User


Joined: 15 Jan 2010
Posts: 52

PostPosted: Sun Jan 17, 2010 16:01    Post subject: Reply with quote
im confused at how these mac values were changed:
(start cut/paste below the line)
------------------------

nvram set wan_hwaddr=00:11:22:33:43:54
nvram set lan_hwaddr=00:11:22:33:42:53
nvram set et0macaddr=00:11:22:33:42:53
nvram set et0macaddr_safe=00:11:22:33:42:53

nvram commit

gpio disable 14

-------------------------
(end cut/paste above the line)
antok86
DD-WRT User


Joined: 15 Jan 2010
Posts: 52

PostPosted: Sun Jan 17, 2010 16:01    Post subject: Reply with quote
im confused at how these mac values were changed, i know they are based off the wireless mac:
(start cut/paste below the line)
------------------------

nvram set wan_hwaddr=00:11:22:33:43:54
nvram set lan_hwaddr=00:11:22:33:42:53
nvram set et0macaddr=00:11:22:33:42:53
nvram set et0macaddr_safe=00:11:22:33:42:53

nvram commit

gpio disable 14

-------------------------
(end cut/paste above the line)
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum