how do i connect to a specific bssid(mac) using client mode?

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page 1, 2  Next
Author Message
tankerd
DD-WRT Novice


Joined: 07 Jun 2022
Posts: 6

PostPosted: Tue Jun 07, 2022 14:00    Post subject: how do i connect to a specific bssid(mac) using client mode? Reply with quote
my connection keeps reseting every 5 minutes as its not connecting to the main router, i have found few scripts over the internet but my router does not have "save custom script"
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Jun 07, 2022 14:04    Post subject: Reply with quote
What router and version / build number of DD-WRT?
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
tankerd
DD-WRT Novice


Joined: 07 Jun 2022
Posts: 6

PostPosted: Tue Jun 07, 2022 14:06    Post subject: Reply with quote
kernel-panic69 wrote:
What router and version / build number of DD-WRT?


tplink wr841nd v9 DD-WRT v3.0-r49081 std (06/04/22)
tankerd
DD-WRT Novice


Joined: 07 Jun 2022
Posts: 6

PostPosted: Tue Jun 07, 2022 14:43    Post subject: Reply with quote
any solution?
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Tue Jun 07, 2022 15:05    Post subject: Reply with quote
WebIF > Administration > Commands > Save Custom
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Jun 07, 2022 15:16    Post subject: Reply with quote
@ho1Aetoo: Not present on 4MB flash devices. My guess is devices with < 8MB flash space don't have save custom and devices without a USB port don't have save usb features. I was trying to find blatant specific proof of this, but didn't find anything glaring at me. Many of the device configs are not updated in the public repositories.

If I recall right, the script(s) you mention require a cron job or something to keep things persistent. I don't think you can use MAC filtering on wireless to accomplish your goal. The only options are MAC filtering or trying to use the script in startup or firewall, but I have my doubts about either option working for you.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Tue Jun 07, 2022 15:29    Post subject: Reply with quote
no idea why this should be missing, the scripts in the command tab are stored in nvram and written to /tmp (RAM) at startup
So actually no question of flash memory

but maybe it is really stripped because it saves a few lines of code
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Jun 07, 2022 16:07    Post subject: Reply with quote
I didn't see any conditional compile ifdef or ifndef lines that stuck out in any of the associated files for the webUI, but github's UX/UI is sh*t compared to notepad++ or codelite to spot these things.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
tankerd
DD-WRT Novice


Joined: 07 Jun 2022
Posts: 6

PostPosted: Wed Jun 08, 2022 7:38    Post subject: Reply with quote
i found a way to workaround this

first i blocked the router mac address on the AP's routers that i dont want it to connect to, then i added this code in Administrators > command, and saved as startup (this will reconnect till it finds internet access)


Code:
Sleep 60

while AP connected {
  ping -c 1 8.8.8.8
  if successful then break/quit
  else
    connect to next AP
    Sleep 30
};
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1634
Location: Belgrade

PostPosted: Wed Jun 08, 2022 9:13    Post subject: Reply with quote
I am not sure if I understand you correct but you can do it from gui... On you ddwrt client router firstly set wifi pass (matching your "AP" router)... then in the bottom of the wifi info page (ddwrt client router) click "scan" button... select SSID you want to connect to and click "join"... if the password is correct you will get "successfully conected" note and will be transfered to wifi page where you can select "client" mode...

if connection keeps droping usually signal strenght is the problem... about scripts... you don't need them... ddwrt has watchdog/keep alive feature... it checks if there is connection loss and restarts unit or whatsoever...
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Wed Jun 08, 2022 11:01    Post subject: Reply with quote
No you can't, because it only stores the SSID but not the MAC.
This means that if you have multiple APs with the same SSID, it will connect to one AP but not the one you selected.

for this you have to enter the BSSID into the WPA supplicant

this could also work, theoretically this looks every 30sec if the BSSID entry is present

Code:
#!/bin/ash
while :
do
   if grep -q bssid /tmp/wlan1_wpa_supplicant.conf;
   then
      sleep 30
   else
      sed -i $'/network={/a bssid=00:11:22:33:44:55' /tmp/wlan1_wpa_supplicant.conf
      kill -HUP $(pidof "wpa_supplicant")
      sleep 30
   fi
done
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Jun 08, 2022 11:07    Post subject: Reply with quote
I read somewhere that you can simply add the BSSID in the custom config e.g.:
bssid=00:11:22:33:44:55

Could that work?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Wed Jun 08, 2022 11:14    Post subject: Reply with quote
In which custom config?
There is none...
Everything I have in the wireless security "custom config" definitely does not end up in the wpa_supplicant also no BSSID

this would be the easiest and a function that many have already requested Wink

https://svn.dd-wrt.com//ticket/2138


Last edited by ho1Aetoo on Wed Jun 08, 2022 11:22; edited 1 time in total
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Jun 08, 2022 11:20    Post subject: Reply with quote
But where does that end up then??
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Wed Jun 08, 2022 11:28    Post subject: Reply with quote
nowhere the custom config is ignored in client mode
and otherwise in the hostap.conf
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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