#!/bin/sh # /etc/ponte #*********************************************************************************************** # this script force router fonera to act as: # - repeater (of an external AP) on ath1, configured by the external AP dhcpd # and # - Access Point on ath0 (configured here as 192.168.10.1/24) with SSID "fonera" # # The two subnet are then routed. # You can arrange your fonera near a window (better if connected to an antenna or can-antenna) # and let it gains a signal that will be repeated in your home by ath0. # So you can associate your WiFi-interface to the AP builded on ath0 # eg. # iwconfig ethn essid fonera # ifconfig ethn 192.168.10.2 netmask 255.255.255.0 up # route del default # route add default gw 192.168.10.1 # # and browse the internet by the external AP. # Powering off fonera will be return in standard mode ! # This script must be written in /etc # # ansanto@interfree.it #*********************************************************************************************** # # I added a line to associate the fonera to a defined access point # # emanuelefrancio@gmail.com - http://www.eftecno.com #*********************************************************************************************** # # stop daemons killall rcS killall crond killall -9 udhcpc killall dnsmasq # flush tables iptables -F iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT IPTABLES -t nat -F # config wlans wlanconfig ath0 destroy wlanconfig ath0 create wlandev wifi0 wlanmode ap wlanconfig ath1 destroy wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon # associate the fonera to a defined access point (change SSID-NAME and N°) # iwconfig ath1 mode managed essid SSID-NAME channel N° # discover external dhcpd for ath1 udhcpc -i ath1 # config AP iwconfig ath0 essid "fonera_ripetitore" ifconfig ath0 192.168.10.1 netmask 255.255.255.0 up # forwarding between the two subnets # ip_forward is set to 1 by default in fonera configuration iptables -t nat -A POSTROUTING -o ath1 -j MASQUERADE # have fun!