
how-to block ads
|
 mcoan
join:2002-07-29 Taos, NM
| reply to wifi4milez Re: [Firmware] WRT54G Captive Portal with EWRT .3
Here is a helpful post that was a great reply to my request for more specific instructions. I haven't tried the steps yet, but will today. This post was on the Linksysinfo.org site at: »www.linksysinfo.org/modules.php?···80#12180
--------------------------------------------------------- Thanks to the information provided by mcoan, I''ve been able to crack this nut. Here''s how:
First, you''re going to need to get an SSH client and an SCP client if you use Windows. I recommend PuTTY and PSCP, respectively. You can find them both at »www.chiark.greenend.org.uk/~sgta···oad.html -- they''re free and open source.
Next, of course, you need to update the router''s firmware. I''m sure you''ve figured this one out already.
Now for the more involved part. First, I''ll show you how to get the existing splash page and contents off the router so you can base your own splash page off of them. Next, I''ll show you how to copy your modified splash page to the router. And finally, I''ll show you how to make your router recognize the location of the modified splash page.
To get the existing splash page off of your router, open up a command prompt (Start -> Run. Type \"cmd\" and hit Enter.) and navigate your way to the location of the pscp.exe file you downloaded. For example, if you kept the pscp.exe file in the C:\\scp\\ folder, you''d type this:
[code:1:f05de0bf14]cd C:\\scp\\ <Enter>[/code:1:f05de0bf14]
(Note: Don''t type the \"<Enter>\" part. That''s where you hit the enter key.)
Now you need to copy the files to your local computer. I''m going to assume you want them to end up at C:\\scp\\htdocs\\ -- you can put them anywhere, but be wary of putting them anywehere there''s a space in a directory name... that''s asking for trouble. Type the following at the command prompt:
[code:1:f05de0bf14]pscp.exe -l root -r 192.168.1.1:/usr/share/nocat/htdocs C:\\scp\\ <Enter>[/code:1:f05de0bf14]
It will then ask for the router''s password (the same password as the login to the Web interface). Type in your password and it will show the files as they''re being copied. Unless it gives you an error, it worked.
Next, go ahead and modify the existing splash page to your heart''s content. (How to modify the splash page is beyond the scope of this post.) Go back to your command prompt and make your way to the C:\\scp\\ directory again. Then type in the following command:
[code:1:f05de0bf14]pscp.exe -l root -r C:\\scp\\htdocs\\ 192.168.1.1:/opt/htdocs <Enter>[/code:1:f05de0bf14]
Again, it will ask for the router''s password. And again, it will show the files as they''re being copied. Unless you run into an error, the copying was successful.
That''s all you need to do to copy the files to the router. Using the above command, you''ve taken the C:\\scp\\htdocs\\ directory and copied it over to the router at /opt/htdocs. Now you have to make sure the router is looking in the right place for the splash page. As dellsweig found, just changing the Document Root variable in the Web GUI doesn''t seem to work. This is pretty easily fixed.
Open up putty.exe. (You only need to double-click on this one.) Enter the IP address of the router in the Host Name (or IP Address) field. Make sure the SSH radio button is selected and click on the Open button.
It will ask for the login name. Use \"root\" for the login name the same password as before for the password. (Note: It will not show anything as you type in the password, but it''s still accepting what you type.)
Once the prompt--\"ewrt ~#\"--comes up, type in the following:
[code:1:f05de0bf14]cd /opt/htdocs <Enter> ls <Enter>[/code:1:f05de0bf14]
If you see a list of the splash page files, you''ve succeeded thus far.
Now, type in:
[code:1:f05de0bf14]nvram show | grep NC_ <Enter>[/code:1:f05de0bf14]
It should display several variables and their values. The key variable here is NC_DocumentRoot. We need to change this variable to point to the right place. So type in the following command:
[code:1:f05de0bf14]nvram set NC_DocumentRoot=/opt/htdocs/ <Enter>[/code:1:f05de0bf14]
If this works, it will bring up another prompt--\"ewrt /opt/htdocs#\"--immediately below the previous one. (Generally speaking, with Linux, if it doesn''t complain, that means it worked.) Now hit the up arrow key twice (which will bring up the grep command you typed in earlier) and hit enter. If all went well, you should see that the NC_DocumentRoot value has changed to the appropriate value.
Close the putty.exe window and click OK to accept closing the session.
That''s it. You''re done!
I must thank mcoan for posting that information. Without the hint to check the NVRAM, I wouldn''t have gotten this to work.
As for your other questions, mcoan, I''m afraid I can''t really answer any of them. I''ll be sure to post here again if I find out the answers. ---------------------------------------------------------
Pretty darned complicated, I must say, but I'm willing to try it. | |   dellsweig Extreme Aerobatics Premium,MVM join:2003-12-10 Campbell Hall, NY
·Time Warner VOIP
·Vonage
·RoadRunner Cable
| Hey
I was able to make this happen!!!
I used putty (pscp) to get the htdocs directory off the router and onto my pc. The command looks like this:
Pscp -v -r root@172.26.53.1:/usr/share/nocat/htdocs c:/temp
This copied the entire htdocs tree from the router to my c:\temp directory.
I then used Frontpage to edit the splash.html file to make it what I wanted
Then I copied my modified htdocs directory back to the router - this time I put it on the read/wrte file system /opt
Pscp -v -r c:\temp\htdocs root@172.26.53.1:/opt
This put the modified stuff onto the router in /opt/htdocs
I then used Putty to connect via SSH to the router. I changed the nvram
Nvram set NC_DocumentRoot=/opt/htdocs
ALL DONE
The only thing I am not happy with at this point is EWRT has NO backup capability. If the router toasts, you have to start from scratch
Now I have to spend some time making a nice web page for the splash!!
Pretty cool!!
Dan -- »aerobatix.webhop.net | |   dellsweig Extreme Aerobatics Premium,MVM join:2003-12-10 Campbell Hall, NY
·Time Warner VOIP
·Vonage
·RoadRunner Cable
| reply to dellsweig Re: [Firmware] WRT54G Captive Portal with EWRT .3 Beta
All
Judging from the number of reads on this topic - I would say alot of folks are interested in this kind of feature - how about it Avenger (hyperwrt) or BrainSlayer (DDWRT)??
A EWRT build with working backup/restore would be nice
YOU HAVE TO LOVE OPEN SOURCE -- »aerobatix.webhop.net | |  mcoan
join:2002-07-29 Taos, NM
| reply to dellsweig Okay, I was able to get this to work, with many thanks to "glhines" (the solver's) post at »www.linksysinfo.org/modules.php?···80#12180.
However, when I pasted his post from there to here, a bunch of strange HTML codes showed up. So, here's the correct, easy-to-read version: ----------------------------------------------------------------------- Thanks to the information provided by mcoan, Ive been able to crack this nut. Heres how:
First, youre going to need to get an SSH client and an SCP client if you use Windows. I recommend PuTTY and PSCP, respectively. You can find them both at »www.chiark.greenend.org.uk/~sgta···oad.html -- they're free and open source.
Next, of course, you need to update the routers firmware. Im sure you've figured this one out already.
Now for the more involved part. First, Ill show you how to get the existing splash page and contents off the router so you can base your own splash page off of them. Next, Ill show you how to copy your modified splash page to the router. And finally, Ill show you how to make your router recognize the location of the modified splash page.
To get the existing splash page off of your router, open up a command prompt (Start -> Run. Type \"cmd\" and hit Enter.) and navigate your way to the location of the pscp.exe file you downloaded. For example, if you kept the pscp.exe file in the C:\temp\ folder, you'd type this:
cd C:\temp\ (Note: Dont type the part. Thats where you hit the enter key.)
Now you need to copy the files to your local computer. Im going to assume you want them to end up at C:\temp\htdocs\ -- you can put them anywhere, but be wary of putting them anywhere theres a space in a directory name... that's asking for trouble. Type the following at the command prompt:
pscp.exe -l root -r 192.168.1.1:/usr/share/nocat/htdocs C:\temp\
It will then ask for the routers password (the same password as the login to the Web interface). Type in your password (won't show on screen) and it will show the files as they're being copied. Unless it gives you an error, it worked.
Next, go ahead and modify the existing splash page to your heart's content. (How to modify the splash page is beyond the scope of this post, but try a tool like FrontPage.) Go back to your command prompt and make your way to the C:\temp\ directory again. Then type in the following command:
pscp.exe -l root -r C:\temp\htdocs\ 192.168.1.1:/opt/htdocs
Again, it will ask for the routers password. And again, it will show the files as theyre being copied. Unless you run into an error, the copying was successful.
Thats all you need to do to copy the files to the router. Using the above command, youve taken the C:\\scp\\htdocs\\ directory and copied it over to the router at /opt/htdocs. Now you have to make sure the router is looking in the right place for the splash page. As dellsweig found, just changing the Document Root variable in the Web GUI doesnt seem to work. This is pretty easily fixed.
Open up putty.exe. (You only need to double-click on this one.) Enter the IP address of the router in the Host Name (or IP Address) field. Make sure the SSH radio button is selected and click on the Open button.
It will ask for the login name. Use \"root\" for the login name the same password as before for the password. (Note: It will not show anything as you type in the password, but its still accepting what you type.)
Once the prompt, i.e., "ewrt~#\" comesup, type in the following:
cd /opt/htdocs ls
If you see a list of the splash page files, youve succeeded thus far.
Now, type in:
nvram show | grep NC_
It should display several variables and their values. The key variable here is NC_DocumentRoot. We need to change this variable to point to the right place. So type in the following command:
nvram set NC_DocumentRoot=/opt/htdocs/
If this works, it will bring up another prompt: "ewrt /opt/htdocs#\" immediately below the previous one. (Generally speaking, with Linux, if it doesnt complain, that means it worked.) Now hit the up arrow key twice (which will bring up the grep command you typed in earlier) and hit enter. If all went well, you should see that the NC_DocumentRoot value has changed to the appropriate value, /opt/htdocs/.
Close the putty.exe window and click OK to accept closing the session.
That's it. You're done! --------------------------
Thanks again to glhines for his great instructions.
-Marc | |  mcoan
join:2002-07-29 Taos, NM | reply to dellsweig Now, I have it working with my own custom splash page, but it STILL makes me click the login button twice in order to access the 'net. Anyone know a fix for this?
Marc | |   dellsweig Extreme Aerobatics Premium,MVM join:2003-12-10 Campbell Hall, NY
·Time Warner VOIP
·Vonage
·RoadRunner Cable
| said by mcoan :Now, I have it working with my own custom splash page, but it STILL makes me click the login button twice in order to access the 'net. Anyone know a fix for this? Marc I am waiting for the answer to this one as well...... -- »aerobatix.webhop.net | |  mcoan
join:2002-07-29 Taos, NM
| The following was emailed to me by dellsweig in response to my request for any update on the "double login" issue. He gave me permission to post his response:
> No, I have not resolved the splash page/login issue. But I have been > having some stability issues with EWRT as well. I had the WAN > interface fail on 2 separate WRT54G's. I returned one and it failed > again. All were 2.2 hardware. > > The WAN light on the front would flash VERY rapidly - not like the normal > on/off you would see when it is connected to the cable modem.. > > I could not ping out the WAN interface either. Did not matter if I assigned > static values for the WAN or let DHCP do its thing. The only thing in > common for these failed routers was EWRT. > > I did factory resets - cleared NVRAM, used the linksys factory upgrade tool > to re-flash 3.x.x, then put DDWRT back on and the device was OK again.... > > I have fallen back to DD-WRT and will wait till ERWT does his next > release. > > I really want the captive portal but I cant put this device in a > commercial establishment (Deli) without backup/restore > capability.... > > As for the splash twice issue - I can live with that - I don't see > anywhere in the HTML code why this would occur. It must have to do > with the way the iptables are mangled before the passthough occurs. > > I spoke to Brian (DDWRT) - he is adding chillispot (another captive portal > thing) into DDWRT. He has a build but wanted to do more testing before he > gave it to me. > > I think the thing I like the most about EWRT is the R/W file system and the > ability to have the captive portal web code local on the router. Chillispot > will require an external web server. I am not sure if this has to be on the > local LAN....
NOW I'M CURIOUS: Are other folks running EWRT-3beta experiencing either stability problems as described above, and/or the "must login twice" issue?
Marc | |   jaa Premium,MVM join:2000-06-13
·Optimum Online
·Vonage
1 edit | reply to dellsweig I must be doing something wrong. I can't get a changed splash screen to come up.
I put the screen in /opt/htdocs and verified. I set NC_DocumentRoot=/opt/htdocs and verified.
I still get the old splash screen. If I powercycle the router, the NC_DocumentRoot value gets reset.
Where am I going wrong?
Edit: Nevermind. I must be slow today - tried it the third time and it is working fine. I must have been doing something wrong. -- NOTHING justifies terrorism. We don't negotiate with terrorists. Those that support terrorists are terrorists. | |   dellsweig Extreme Aerobatics Premium,MVM join:2003-12-10 Campbell Hall, NY
·Time Warner VOIP
·Vonage
·RoadRunner Cable
| said by jaa :I must be doing something wrong. I can't get a changed splash screen to come up. I put the screen in /opt/htdocs and verified. I set NC_DocumentRoot=/opt/htdocs and verified. I still get the old splash screen. If I powercycle the router, the NC_DocumentRoot value gets reset. Where am I going wrong? Edit: Nevermind. I must be slow today - tried it the third time and it is working fine. I must have been doing something wrong. JAA - What version Linksys WRT54G are you runnign this on. I have had some problems using EWRT .3 on 2.2 hardware.... -- »aerobatix.webhop.net | |   jaa Premium,MVM join:2000-06-13
·Optimum Online
·Vonage
| reply to dellsweig Yes, 2.2 hardware. I got that one to work.
But flashing .3 on to another 2.2 hardware I think I bricked the darned thing. All I get is a flashing power light - anyone have any suggestions? I have tried holding the reset with the power on and with the power off. When I push reset with the power on, it seems to have no effect - power light keeps flashing. Tftp fails; cannot find 192.168.1.1.
In the future, after flashing the ewrt firmware through the web interface, and I get the "continue" prompt, what is the "safest" way to proceed? Or should I use tftp to load the firmware? -- NOTHING justifies terrorism. We don't negotiate with terrorists. Those that support terrorists are terrorists. | |   happydat
@knology.net
| reply to dellsweig Re: [Firmware] WRT54G Captive Portal with EWRT .3
I'm trying to copy the captive portal page files from ewrt-3 to change them. I followed your instructions - ssh-pscp, when I type the copy command i get "empty usrname". I think this is the point you said I should get "password?". I'm just using the default password for now and no username on the router. That will change soon. What do I need to do to get to the next step of copying files? don't know where to set up a username for the router.
Thanks for your help Scott | |
|