Unable to connect after changing WAN MAC address

hi all

occasionally i need to change the mac address in order to get another ip address and routes due to poor connections. however i found that openwrt cant get connected to my isp's dhcp unless i unplug the lan cable or power it off, note that restarting related services (and interfaces perhaps) or router does not work either. i have also tried to remove the dhcp lease thing but no luck. this should not be the isp or modem problem since once i removed the current lan cable conneted with my openwrt router and replaced it with, for instance, another lan cable connected to my pc it can get a new ip without problem

this seems a minor bug where i can get another ip after changing my mac address on linux and windows by restarting the interface only. i have tried on my old tp link router as well as my netgear, with openwrt 17 , 19 etc and probably one of the lede releases

thanks

Try the following when the issue happens:

# DHCP release
killall -SIGUSR2 udhcpc
# Wait
sleep 5
# DHCP renew
killall -SIGUSR1 udhcpc
1 Like

just tested twice but it didnt work unfortunately

eth0.2    Link encap:Ethernet  HWaddr 14:59:C0:44:C3:B8
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1037 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1284 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4018447 (3.8. MiB)  TX bytes:143853 (140.4 KiB)

You aren't using VPN or MWAN, are you?

rite, nothing. no vpn

and after i tried a few time, i couldnt get connected even by unplugging the lan cable

it doesnt seems like a usual problem as no one talk about this afaik but i can understand that as not too many ppl will change their mac address

Tear down the connection (ifdown wan) first, so the DHCP lease gets released, the ISP is probably fighting against multiple concurrent logins and catches you that way (the ISP might also insist on physically severing the connection or a timeout, before allowing a new connection).

@slh, tearing down the connection doesn't issue the DHCP release message at least on 19.07.

@johnson, collect the diagnostics and post it to pastebin.com redacting the private parts:

ubus call system board; uci show network; uci show dhcp; uci show firewall; \
ip address show; ip route show table all; ip rule show; iptables-save -c

that didn't work neither, i have tried restarting those services too. forgot to mention it in the first post, i will add it back now

ok i will do it later when i go home

hi here it is, after mac address changed and your commands executed as:
sleep 5;killall -SIGUSR2 udhcpc; sleep 10; killall -SIGUSR1 udhcpc
https://pastebin.com/KnuxBow2

note that there's nothing special, especially for my previous settings on my old router which served as a pure wifi router only

1 Like

The DHCP renew rule has no hits, so the problem appears to be on the DHCP server side.
It's best to contact the ISP and ask them if you are allowed to use a dynamic MAC.
Also let them verify that the DHCP server works correctly with your MAC.

there should be no problem with their server since they asked me to changed my mac address before to avoid poor connections. also as i said before, it only happen when openwrt/lede is involved, if i remember correctly, the old tp link router didnt have this problem with their firmware installed.

moreover, during the installation of my broadband we were testing the speed and switched between a few devices including my linux box, a laptop etc without problem. but when it was connected to my router with openwrt installed it just didnt work.

so can you get another ip successfully after changing the mac address with openwrt? i believe it's a bug regarding the dhcp client for not able to talk to the dhcp server, perhaps the old mac address is still in use or unable to release it but forced to connect with the new mac address. just my two cents

1 Like

There should be no problem on the OpenWrt side.
But my ISP doesn't allow change MAC since they use it for billing.

Try to run DHCP release before changing MAC as mentioned above.

ok may be i will try again later as i need it atm

thanks

1 Like