Author Topic: [HOWTO]Wireless WAN Worldspot Firmware Customization  (Read 4018 times)

Offline test_23277

  • Jr. Member
  • **
  • Posts: 11
[HOWTO]Wireless WAN Worldspot Firmware Customization
« on: June 24, 2013, 10:37:48 pm »
Hi,

I'd like to share my "Wireless WAN Worldspot Firmware Customization" with you. Following this tutorial, you'll be able to get rid of any cables and have a truly wireless hotspot setup. I hope it's of some use for the community. My configuration applies to Backfire-r30950/atheros target/Fonera 2100(my testing device). With minor modifications to /e/c/network, it should work with all supported routers though. Attitude Adjustment(OpenWrt 12.09) should also be straight-forward.

OK, let's get started. Default Worldspot Firmware ships with br-wan (wired-uplink+Private Wifi) and br-lan(Public Wifi/Chilli) interfaces. I changed it to wwan(wireless-uplink/NAT), br-wan(Private Wifi+eth0,172.16.0.1/24) and br-lan(Public Wifi/Chilli).

Step 1: Register your Worldspot router as usual (with default settings) and let the initial node checkin do its thing, then reboot.
Step 2: Install dnsmasq and edit its /e/c/dhcp (we need wired uplink for this particular step).
Code: [Select]
# opkg update
# opkg install dnsmasq
# /etc/init.d/dnsmasq enable
# cat /etc/config/dhcp
config dnsmasq
option domainneeded 1
option boguspriv 1
option filterwin2k 0  # enable for dial on demand
option localise_queries 1
option rebind_protection 1  # disable if upstream must serve RFC1918 addresses
option rebind_localhost 1  # enable for RBL checking and similar services
#list rebind_domain example.lan  # whitelist RFC1918 responses for domains
option local '/lan/'
option domain 'lan'
option expandhosts 1
option nonegcache 0
option authoritative 1
option readethers 1
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
#list server '/mycompany.local/1.2.3.4'
#option nonwildcard 1
#list interface br-lan
#list notinterface lo
#list bogusnxdomain     '64.94.110.11'

config dhcp lan
option interface lan
option start 100
option limit 150
option leasetime 12h
option ignore 1

config dhcp wan
option interface wan
option start 100
option limit 150
option leasetime 12h
list dhcp_option 6,208.67.222.222,208.67.220.220

config dhcp wwan
option interface wwan
option ignore 1
Step 3: Edit /e/c/network, /e/c/wireless, /e/init.d/chilli
Code: [Select]
# cat /etc/config/network
config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'

config 'interface' 'lan'
option 'type' 'bridge'
option 'proto' 'static'
option 'netmask' '255.255.255.0'
option 'ipaddr' '10.150.1.1'

config 'interface' 'wan'
option 'ifname' 'eth0'
option 'proto' 'static'
option 'type' 'bridge'
option 'netmask' '255.255.255.0'
option 'ipaddr' '172.16.0.1'

config 'interface' 'wwan'
option 'proto' 'dhcp'
# cat /etc/config/wireless
config 'wifi-device' 'wifi0'
option 'type' 'atheros'
option 'disabled' '0'
option 'channel' '11'

config 'wifi-iface'
option 'device' 'wifi0'
option 'network' 'lan'
option 'mode' 'ap'
option 'encryption' 'none'
option 'ssid' 'WorldSpot Hotspot'

config 'wifi-iface'
option 'network' 'wan'
option 'device' 'wifi0'
option 'mode' 'ap'
option 'key' 'your-secret-key'
option 'ssid' 'WorldSpot Private'
option 'encryption' 'psk'

config 'wifi-iface'
option 'network' 'wwan'
option 'encryption' 'psk2'
option 'device' 'wifi0'
option 'mode' 'sta'
option 'key' 'your-secret-key2'
option 'ssid' 'your-ssid'
# cat /etc/init.d/chilli
#!/bin/sh /etc/rc.common

START=91

updCfg() {
. /etc/chilli/functions
if [ -r /etc/chilli/wsDflt ] ; then
. /etc/chilli/wsDflt
. /etc/chilli/wsHack
fi
writeconfig
}

start() {
updCfg
#enable nat to wan
#only needed if firewall disabled
iptables -A POSTROUTING -t nat  -o $HS_WANIF -j MASQUERADE

chilli
}

stop() {
pkill chilli
}

reload() {
updCfg
pkill -1 chilli
}
Step 4: Introduce /e/chilli/wsHack, then reboot.
Code: [Select]
# cat /etc/chilli/wsHack
HS_WANIF=`uci -P/var/state get network.wwan.ifname`
If there's any significant community interest in my WorldSpot Firmware customization, I'm willing to release/write a script that automates the process, also for other routers (Hardware donations are welcome for that purpose, I currently just own Fonera 2100 devices). According to my testing so far, the customization is fully compatible with node checkin/setup + real-time dashboard.

Hope you like it. Feel free to ask questions if something isn't clear.
« Last Edit: June 24, 2013, 10:53:08 pm by test_23277 »

Offline WorldSpot

  • Administrator
  • Hero Member
  • *****
  • Posts: 2472
Re: [HOWTO]Wireless WAN Worldspot Firmware Customization
« Reply #1 on: June 25, 2013, 11:48:51 am »
Thanks for sharing your setup.

dnsmasq has a lot of settings, and is not that easy to configure for the average user...

About br-wan, if you can't bridge, your solution looks good.
However, have you tried to simply name "wwan" as "br-wan" (You wouldn't get the private wifi anymore.)

There is no need to configure NAT anywhere? Is it chilli that does the job?

Offline test_23277

  • Jr. Member
  • **
  • Posts: 11
Re: [HOWTO]Wireless WAN Worldspot Firmware Customization
« Reply #2 on: June 25, 2013, 12:18:49 pm »
Quote
Thanks for sharing your setup.
You're most welcome!
Quote
dnsmasq has a lot of settings, and is not that easy to configure for the average user...
Correct. I disabled dhcp for br-lan pool (Public Wifi, managed by coova-chilli), modified wan to wwan, introduced br-wan pool (Private Wifi+LAN, 172.16.0.1/24) and configured OpenDNS.
Quote
About br-wan, if you can't bridge, your solution looks good.
However, have you tried to simply name "wwan" as "br-wan" (You wouldn't get the private wifi anymore.)
It's not possible. wwan is sta/client mode wireless interface and you cannot bridge that in OpenWrt. br-wan (actually the private (W)LAN) essentially is there to deal with closed-source wsmng, could be br-lan2 otherwise. As far as my reverse engineering goes, wsmng depends on br-wan MAC address+ respective br-wan /e/c/wireless interface configuration (as Private Wifi) to function correctly, thus the naming.
Quote
There is no need to configure NAT anywhere? Is it chilli that does the job?
It is! coova-chilli manages this. See /etc/chilli/wsHack as a HS_WANIF overwrite to /etc/chilli/wsDflt.
« Last Edit: June 25, 2013, 12:24:50 pm by test_23277 »