Posted: Sat Feb 18, 2017 8:55 Post subject: Wpa supplicant editing issue through telnet
Edit: last time I was here I didn’t understand much, pretty much still don’t lol, but I’ve found out there was a much easier way to do what I wanted, I have a new much simpler question on the last post so anyone who can help out y’all can skip everything else from 2 years ago.
So I have a tp link wr841n v9 flashed with DD-WRT v3.0-r31277 std (02/07/17) the problem is whenever I try to edit wpa supplicant through telnet with ( sed -i '7ibssid=XX:XX:XX:XX:XX:XX' /tmp/ath0_wpa_supplicant.conf ) it doesn't take and the line is not added same for when I add it as a custom script in administration, the only way I can add the line is if I use winscp and manually edit the file, only after I manually edit is when telnet works and I can add custom lines anybody know what's the issue ? It's annoying that I have to log into a windows machine to edit the file as I can't find an scp client app for Mac that is free.
Last edited by Itsyaboy on Wed Aug 18, 2021 0:49; edited 2 times in total
Joined: 03 Jan 2010 Posts: 7568 Location: YWG, Canada
Posted: Sat Feb 18, 2017 10:27 Post subject:
there is some issues currently with hostapd, aka wpasupplicant, take what u find with a grain of salt. im currently in a "battle" with head developer, on fixing these issues, see http://svn.dd-wrt.com/timeline _________________ LATEST FIRMWARE(S)
BrainSlayer wrote:
we just do it since we do not like any restrictions enforced by stupid cocaine snorting managers
Ok thanx I'll give echo a try next time the router needs a reboot, although the sed does add lines, but only after I manually edit the file with winscp after it's manually edited it works fine but pointless afterwards since winscp got the job done already lol
And the line added is bssid=(Mac address) the mac address of the connection I want to stay locked on to, to prevent roaming.
So do I use that as is with the quotes ? And not sure what >> is
Last edited by Itsyaboy on Sun Feb 26, 2017 13:11; edited 1 time in total
Joined: 03 Jan 2010 Posts: 7568 Location: YWG, Canada
Posted: Sun Feb 26, 2017 13:05 Post subject:
WAIT... much of what ur saying is all changed up from latest public build to latest nightly build.
install this latest r31495, THEN, test.. ONLY. accept this build in the event the small chance it may brick & will need to recover.
this is WEBFLASH build, NOT, tftp or initial flash! and this is for wr841ndv9. i posted this cause many things are being mentioned that are already fixed in trunk, "trunk" = latest nightly, svn build, not available to public users except a few.
if u dont believe me then DONT FLASH, PERIOD. I DONT WANT UR BLAMING CRAP IF UR A NOOB AT FLASHING A ROUTER! _________________ LATEST FIRMWARE(S)
BrainSlayer wrote:
we just do it since we do not like any restrictions enforced by stupid cocaine snorting managers
WAIT... much of what ur saying is all changed up from latest public build to latest nightly build.
install this latest r31495, THEN, test.. ONLY. accept this build in the event the small chance it may brick & will need to recover.
this is WEBFLASH build, NOT, tftp or initial flash! and this is for wr841ndv9. i posted this cause many things are being mentioned that are already fixed in trunk, "trunk" = latest nightly, svn build, not available to public users except a few.
if u dont believe me then DONT FLASH, PERIOD. I DONT WANT UR BLAMING CRAP IF UR A NOOB AT FLASHING A ROUTER!
wait are you saying i should install that before trying anything else ?
Joined: 03 Jan 2010 Posts: 7568 Location: YWG, Canada
Posted: Sun Feb 26, 2017 13:48 Post subject:
Itsyaboy wrote:
tatsuya46 wrote:
WAIT... much of what ur saying is all changed up from latest public build to latest nightly build.
install this latest r31495, THEN, test.. ONLY. accept this build in the event the small chance it may brick & will need to recover.
this is WEBFLASH build, NOT, tftp or initial flash! and this is for wr841ndv9. i posted this cause many things are being mentioned that are already fixed in trunk, "trunk" = latest nightly, svn build, not available to public users except a few.
if u dont believe me then DONT FLASH, PERIOD. I DONT WANT UR BLAMING CRAP IF UR A NOOB AT FLASHING A ROUTER!
wait are you saying i should install that before trying anything else ?
correct. lots of 2.4 ghz changes. lots of 5ghz changes. openvpn changes. stuff i cant even remember.
Ok thanx I'll give echo a try next time the router needs a reboot, although the sed does add lines, but only after I manually edit the file with winscp after it's manually edited it works fine but pointless afterwards since winscp got the job done already lol
And the line added is bssid=(Mac address) the mac address of the connection I want to stay locked on to, to prevent roaming.
So do I use that as is with the quotes ? And not sure what >> is
While you can use sed to add lines, your command in particular, the way you wrote it, does nothing.
If you want to use sed to append a line to a file, you need the following.
Code:
sed -i '$a7ibssid=XX:XX:XX:XX:XX:XX' /tmp/ath0_wpa_supplicant.conf
The "$a" at the head of the string is interpreted as a command, specifically "append what ever follows to the file". Again, what you originally wrote does nothing since you didn't provided any command(s). You simply passed a string, without any commands, and expected sed to do something w/ it.
All that said, using sed to append lines to the end of a file is overkill. You can simply echo those lines using the >> operator.
sed is primarily used to search for text and perform certain operations upon a match (replace the text in the matched line, prepend/append a new line before/after the matched line, delete all lines after the match, etc.).
So I tried it your way but it didint work the line was not added correctly whithin network={
So I finally found a way to make it work by using > to completely rewrite wpa_supplicant with that below since I couldint figure out how to add just one line whithin the network= { }bracket anyone know how that can be done ?
Ahhh k I get it thank you so much !! One last question tho how do I go about saving that command + the kill hup into a costume script or start up script @ administration commands so that I won't have to send this everytime my router reboots, do I save it just like that or do I need to do something else ?
sed -i.bak '/ssid="optimumwifi"/a 7ibssid=XX:XX:XX:XX:XX:XX' /tmp/ath0_wpa_supplicant.conf
So, what exactly are we trying to do here, what is this for? MAC filtering?
Yea Mac filtering but I’m using my router as a repeater and I want it to avoid connecting to certain bssids, so I’m not filtering devices connecting to an ap, I’m filtering what the client can connect to.