LaFonera Software Chilispot

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:16, 7 February 2007 (edit)
Wildblue (Talk | contribs)

← Previous diff
Revision as of 15:55, 8 February 2007 (edit) (undo)
ChrisPHL (Talk | contribs)
(La Fonera Chilispot and second virtual SSID)
Next diff →
Line 51: Line 51:
' > /tmp/chilli.conf ' > /tmp/chilli.conf
-echo -n radiusnasid `nvram get eth0_hwaddr|sed -e radiusnasid -e s/:/-/g`>>/tmp/chilli.conf+echo -n radiusnasid `nvram get ath0.1_hwaddr|sed -e radiusnasid -e s/:/-/g`>>/tmp/chilli.conf
## We need to wait 5 seconds (10sec. for Fonera) to make sure we have our WAN DHCP lease and DNS info. ## We need to wait 5 seconds (10sec. for Fonera) to make sure we have our WAN DHCP lease and DNS info.
Line 63: Line 63:
## Runs the heartbeat to fon at startup. ## Runs the heartbeat to fon at startup.
-/usr/bin/wget "http://download.fon.com/heartbeat.php?mac=`nvram get ath0_hwaddr|sed s/:/-/g`"+/usr/bin/wget "http://download.fon.com/heartbeat.php?mac=`nvram get ath0.1_hwaddr|sed s/:/-/g`"
sleep 15 sleep 15

Revision as of 15:55, 8 February 2007

Back to La Fonera

La Fonera Chilispot and second virtual SSID

SCENARIO:

When version 24 of DD-WRT was released in beta, one of the first things I wanted to accomplish was to setup FON on 1 SSID and my internal network on another SSID. It took me a while to find the time to work on it but here is how I set it up. I tested this on a WRT54G v4, WRT54GS v1 and a Buffalo WHR-G54S running WPA and WEP for the internal network security.

STEPS:

1. Install the v.24 dd-wrt standard beta version (we are using the 2006-0911 release) of firmware available HERE -- Instructions for installing DD-WRT on the WRT54G or GS are available HERE

2. Logon to the web management interface in DD-WRT. Click the Wireless tab, under the Virtual Interfaces click the Add button.

3. Set the Physical Interface SSID and the set Virtual Interface SSID to FON_HotSpot. Enable AP Isolation and set the Network Configuration to Unbridged. Scroll to the bottom and select Save Settings.

Image:step3.gif

4. The IP Address and Subnet Mask fields should now be present at the bottom of the form. Enter the IP Address of 192.168.181.1 and a subnet mask of 255.255.255.0. Scroll to the bottom and select Save Settings.

Image:step4.gif

5. Click the Wireless Security sub-tab. Change the Security Mode for the Physical Interface to what ever security you want to use for your LAN. (On the FON interface the the Security Mode should remain at disabled.) Scroll to the bottom and select Save Settings.

Image:step5.gif

6. Click the Administration tab and click the Info Site Password Protection check box. Scroll to the bottom and select Save Settings.

Image:step6.gif

7. Click the Hotspot sub-tab. Verify that Chillispot is set to Disable. Scroll to the bottom and select Save Settings.

Image:step7.gif

8. Click the Commands sub-tab. Select the following text and paste it into the Commands window. Scroll to the bottom and select Save Startup.

#!/bin/sh

# The following lines create /tmp/chilli.conf
echo -n '
dhcpif ath0.1
radiusserver1 radius01.fon.com
radiusserver2 radius02.fon.com
radiussecret garrafon
uamserver https://login.fon.com/cp/index.php # login.fon.com = 213.134.45.152 
uamsecret garrafon
uamallowed www.fon.com,acceso.fon.com,www.paypal.com,www.paypalobjects.com
net 192.168.182.0/24
dynip 192.168.182.0/24
' > /tmp/chilli.conf

echo -n radiusnasid `nvram get ath0.1_hwaddr|sed -e radiusnasid -e s/:/-/g`>>/tmp/chilli.conf

## We need to wait 5 seconds (10sec. for Fonera) to make sure we have our WAN DHCP lease and DNS info.
sleep 10

## get the first two entries of DNS- Server out of Setup-->Basic Setup-->Network Address Server Settings (DHCP):
echo `nvram get wan_dns` | sed -e 's/[0-9]/=&/' -e 's/ /%/' -e 's/=/\ndns1 /' -e 's/%/\ndns2 /' >> /tmp/chilli.conf

## The following statement adds a statement to cron.d that runs a heartbeat to fon each night at 2am.
echo '00 02 * * * root /usr/bin/wget "http://download.fon.com/heartbeat.php?mac=`nvram get ath0.1_hwaddr|sed s/:/-/g`" -O /tmp/inet.html' > /tmp/cron.d/heartbeat

## Runs the heartbeat to fon at startup.
/usr/bin/wget "http://download.fon.com/heartbeat.php?mac=`nvram get ath0.1_hwaddr|sed s/:/-/g`"
sleep 15

## Execute chillispot
/usr/sbin/chilli --conf /tmp/chilli.conf

9. Again, select the following text and paste it into the Commands window. Scroll to the bottom and select Save Firewall. (You can change the DOWNLINK and UPLINK settings in the text below to whatever bandwidth you want to be available to your FON users. Setting is in kbit/s)

#!/bin/sh

iptables -I INPUT -i tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o vlan1 -m state --state NEW -j ACCEPT
iptables -I FORWARD -i tun0 -o ppp0 -m state --state NEW -j ACCEPT
iptables -I FORWARD -i br0 -o tun0 -j logdrop

iptables -A FORWARD -i tun0 -j DROP;
iptables  -t nat -I PREROUTING -i tun0 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -j DROP

DEV="tun0"
DOWNLINK="768"
UPLINK="64"
 
tc qdisc del dev $DEV root
tc qdisc del dev $DEV ingress
 
# limit download
tc qdisc add dev $DEV root handle 1: htb
tc class add dev $DEV parent 1: classid 1:1 htb rate  ${DOWNLINK}kbit burst 6k
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst 192.168.182.1/24 flowid 1:1
 
# limit upload
tc qdisc add dev $DEV ingress handle ffff:
tc filter add dev $DEV parent ffff: protocol ip u32 match ip src 0.0.0.0/0 police rate ${UPLINK}kbit burst 10k drop flowid :1

10. Click the Management sub-tab and scroll to the bottom and click the Reboot Router button.

11. Now connect to your router via the FON ssid and login to fon.com. Login or create your fon.com account. Once your router is registered your setup should be complete.

Good luck! (Don't forget to go to the Management sub-tab and change your routers password.)

  • Just a note... the drivers on some wireless cards handle the multi SSIDs differently. On some cards when connected to 1 of the SSIDs won't display the other SSID. Just disconnect from the currently connected SSID and you should be able to see both SSIDs.

(This text on this Wiki-page was taken from http://www.geek-pages.com/articles/latest/dd-wrt_-_multiple_ssids_-_1_for_fon_-_1_for_private_network.html)

maybe we can upload pictures in this wiki, or we have to rewrite this text as good as possible!