User Tools

Site Tools


auto-oz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

auto-oz [2011/03/03 11:13]
gabe
auto-oz [2013/09/28 16:06]
Line 1: Line 1:
-====== auto-oz ====== 
- 
-===== Updates ===== 
-==== March 3 2011 ==== 
- 
-what's happening is that on this command: 
-curl -K curlcfg https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp -d "​username=XXX&​password=YYYYYY&​changePassword="​ -e "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -b /​tmp/​cookiejar 
- 
-onezone returns: 
-Session Timed out. Error in Proceeding Further. Please close and restart your browser. 
- 
-I tried removing the "-b /​tmp/​cookiejar"​ from the command, and it does the same thing. 
- 
-So, I guess we need to go further back to find the spot it stop complaining about this. Let's try: 
-curl -K curlcfg "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -b /​tmp/​cookiejar 
-curl -K curlcfg https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp -d "​username=XXX&​password=YYYYYY&​changePassword="​ -e "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -c /​tmp/​cookiejar 
- 
-Same problem. Check the cookies. It's setting the same one: 
-register.prontonetworks.com FALSE /​registration TRUE 0 JSESSIONID 0a0a0a4730d54b28d991910e4309a603ca5a1fbe4e94.e3yQbx4TbNeLe34Lb3mKchePbhn0n6jAmljGr5XDqQLvpAe 
-register.prontonetworks.com FALSE /​registration TRUE 0 JSESSIONID 0a0a0a4730d54b28d991910e4309a603ca5a1fbe4e94.e3yQbx4TbNeLe34Lb3mKchePbhn0n6jAmljGr5XDqQLvpAe 
- 
-Let's try deleting the cookie file. 
-rm /​tmp/​cookiejar 
-curl -K curlcfg "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -c /​tmp/​cookiejar 
- 
-It gave us the same cookie again: 
-register.prontonetworks.com FALSE /​registration TRUE 0 JSESSIONID 0a0a0a4730d5cfc25258927348bb8e5af08d27bdf765.e3yQbx4TbNeLe34Lb3mKchePbhn0n6jAmljGr5XDqQLvpAe 
- 
-Well, let's keep going: 
-curl -K curlcfg https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp -d "​username=XXX&​password=YYYYYY&​changePassword="​ -e "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -b /​tmp/​cookiejar 
- 
-This time it didn't return the session timeout message. I think maybe it's because I had my "​-b"​ and "​-c"​ confused on the commandline. -b is to read, -c is to write. 
- 
-Let's run the script again: 
-./​onezone-renew.pl 
- 
-It did the same thing: die at ./​onezone-renew.pl line 67. 
- 
-[.......] 
- 
-The renew wasn't working and so I logged in manually through my browser to try to see what was up. All I did was log in and the whole rig started working immediately. 
- 
-So... that means there'​s something'​s wrong with the onezone-login.sh script. It looks like that script isn't reading cookies, which is maybe the problem. ​ 
-This is awkward, because when the login doesn'​t work, the onezone-check script going straight to try to renew. Awkward, eh? 
- 
-So, I modified onezone-login.sh to get a cookie, and then send that cookie along with the login request. To the extent that my tests now are valid, it seems to be working. 
- 
-There'​s also the problem of multiple instances running. Fix this too! 
- 
- 
-===== Installation ===== 
- 
-This is a way to configure an OpenWRT router to connect in client mode to the OneZone network. ​ I've tested it ONLY using whiterussian-rc5,​ on a Linksys WRT54GL and a Motorola WR850G.  ​ 
- 
-Notes: 
-  * You can use this with either a regular $30/month OneZone account, or a $5/month iPhone account. ​ There are two tricks with the iPhone account: first (predictably) you can only sign up for the account if you hit the captive portal using an iPhone/iPod (iPad?) browser -- either an actual device, or a desktop browser with a spoofed user-agent. ​ Second, when you create the account, it (at least temporarily) **gets locked to the MAC address of the wifi client**. ​ So the best way to do it is to use a laptop browser spoofing an iPhone user-agent, plugged into the router that's going to be the client. 
-  * You're much better off configuring the router someplace where you've got a wired Internet connection. ​ These instructions assume that you've got one.  I've managed to pull it off otherwise, but it's a hassle. 
-  * Of course, in order to test this properly, you need to be doing the setup someplace where you've got a reasonably strong OneZone signal. 
-  * Instructions here are specific to Wireless Toronto'​s setup: we want these routers to check into the open-mesh dashboard so that we can monitor them and get notifications. ​ They also connect to our OpenVPN server. ​ If you're not Wireless Toronto, you'll have to adapt this to suit your needs.  ​ 
-  * It **may** be possible to use two iPhone accounts simultaneously in two different locations, by spoofing the MAC address of the wifi interface on the router. ​ The way to do that is 'nvram set il0macaddr=xx:​xx:​xx:​xx:​xx:​xx'​.  ​ 
- 
-Steps: 
-  - if there'​s any chance that it has some wacko nvram settings, reset the router to factory default (or use mtd erase if you know what you're doing) 
-  - flash the router with whiterussian-rc5 
-  - plug it into an Internet connection 
-  - ssh into it 
-  - run this:<​code>​ 
-vi /​etc/​ipkg.conf 
-</​code>​ 
-  - add this line:<​code>​ 
-src xwrt ftp://​ftp.berlios.de/​pub/​xwrt/​packages 
-</​code>​ 
-  - run this:<​code>​ 
-ipkg update 
-ipkg install microperl 
-cd /sbin 
-wget http://​wirelesstoronto.ca/​dist/​om-checkin.pl 
-wget http://​wirelesstoronto.ca/​dist/​onezone-check.pl 
-wget http://​wirelesstoronto.ca/​dist/​onezone-login.sh 
-wget http://​wirelesstoronto.ca/​dist/​onezone-logout.sh 
-chmod +x om-checkin.pl 
-chmod +x onezone-check.pl 
-chmod +x onezone-login.sh 
-chmod +x onezone-logout.sh 
-cd /etc 
-wget http://​wirelesstoronto.ca/​dist/​om-checkin.conf.pl 
-ifconfig eth0 
-</​code>​ 
-<​code>​ 
-WARNING: auto-oz is still in development. the versions of these files on the server aren't the newest ones. If you're interested, contact Gabe. 
-</​code>​ 
-  - it will output the mac address. ​ Copy it, and add the node to the OM dashboard. ​ The dashboard will then calculate its IP address. 
-  - run this:<​code>​ 
-vi /​etc/​om-checkin.conf.pl 
-</​code>​ 
-  - put the IP & MAC address in the appropriate spots 
-  - run this:<​code>​ 
-crontab -e 
-</​code>​ 
-  - add this line:<​code>​ 
-*/2 * * * * /​sbin/​om-checkin.pl 
-</​code>​ 
-  - run this:<​code>​ 
-ipkg install ntpclient 
-cd /etc/init.d 
-wget http://​wirelesstoronto.ca/​dist/​S55ntpclient 
-chmod +x /​etc/​init.d/​S55ntpclient 
-/​etc/​init.d/​S55ntpclient 
-echo EST5EDT,​M3.2.0/​02:​00,​M11.1.0/​02:​00 > /etc/TZ 
-cd /etc/init.d 
-cp S99done S99done.real 
-rm S99done 
-mv S99done.real S99done 
-vi /​etc/​init.d/​S99done 
-</​code>​ 
-  - add these lines to the end:<​code>​ 
-# start crond 
-/​usr/​sbin/​crond -c /​etc/​crontabs 
-</​code>​ 
-  - run this:<​code>​ 
-mkdir /​etc/​crontabs 
-touch /​etc/​crontabs/​root 
-ln -sf /​etc/​crontabs/​root /​etc/​crontab 
-/​usr/​sbin/​crond -c /​etc/​crontabs 
-vi /​etc/​crontab 
-</​code>​ 
-  - add this line:<​code>​ 
-0 * * * * /​usr/​sbin/​ntpclient -l -h pool.ntp.org -i 5 -s 
-</​code>​ 
-  - run this:<​code>​ 
-killall crond 
-/​usr/​sbin/​crond -c /​etc/​crontabs 
-ipkg install openvpn 
-mkdir /​etc/​openvpn 
-cd /​etc/​openvpn 
-wget http://​wirelesstoronto.ca/​dist/​client.conf 
-vi /​etc/​openvpn/​client.conf 
-</​code>​ 
-  - replace NODEID with the real router id 
-  - run this:<​code>​ 
-cd /​etc/​openvpn 
-wget http://​wirelesstoronto.ca/​dist/​ca.crt 
-</​code>​ 
-  - copy cert files from the server: scp wireless@openvpn.wirelesstoronto.ca:​easy-rsa/​keys/​client(NODEID).* . 
-  - run this:<​code>​ 
-chmod 600 client*.key 
-cd /etc/init.d 
-wget http://​wirelesstoronto.ca/​dist/​S90openvpn 
-chmod +x S90openvpn 
-nvram set wl0_mode=sta 
-nvram set lan_ifname=br0 
-nvram set lan_ifnames=vlan0 
-nvram set wan_ifname=eth1 
-nvram set lan_ipaddr=192.168.88.1 
-nvram set lan_proto=static 
-nvram set wan_proto=dhcp 
-nvram set wl0_ssid="​One Zone_High Speed Internet"​ 
-nvram commit 
-reboot 
-</​code>​ 
-  - now use a desktop browser spoofing an iPhone user-agent to log into onezone and create an account 
-  - run this:<​code>​ 
-vi /​sbin/​onezone-login.sh 
-</​code>​ 
-  - replace "<​USERNAME>"​ with the username, and "<​PASSWORD>"​ with the password 
-  - reboot it and watch it get online within a minute or so! 
-  - test your packet loss and throughput. ​ Note that you might want to leave it in place for ~5 minutes, since the signal strength & throughput seems to get better over the first few minutes. 
  
auto-oz.txt ยท Last modified: 2013/09/28 16:06 (external edit)