Come configurare una fonera come ripetitore di un altro segnale Wi-Fi
Questo howto (ancora un po' grezzo) spiega come configurare una fonera (o un altro device atheros-based) come ripetitore di una rete Wi-Fi, aperta o chiusa. Si suppone che il dispositivo sia gia' stato flashato con OpenWrt Kamikaze, che il driver usato sia madwifi (il default) e che siano installati i seguenti pacchetti:
- wpa-supplicant
- dhcpcd
- dnsmasq
Indice
File di configurazione Fonera 2100/2200
/etc/config/wireless
config wifi-device wifi0
option type atheros
option channel '1'
option diversity '0'
option txantenna '0'
option disabled '0'
config wifi-iface
option device wifi0
option network 'lan'
option mode 'ap'
option ssid 'freenux'
option encryption none
option hidden '0'
option isolate '0'
option txpower '18'
option bgscan '0'
option wds '0'/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 'ifname' 'eth0 ath0'
option 'proto' 'static'
option 'ipaddr' '192.168.42.1'
option 'netmask' '255.255.255.0'
option 'dns' '151.100.31.31 8.8.8.8'
option 'gateway' ''/etc/config/dhcp
config dnsmasq
option domainneeded 1
option boguspriv 1
option filterwin2k '0' #enable for dial on demand
option localise_queries 1
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 0
#list interface br-lan
config dhcp lan
option interface lan
option start 100
option limit 150
option leasetime 12h
config dhcp wan
option interface wan
option ignore 1/etc/wpa_supplicant.conf
Per ripetere il segnale di una qualunque rete wireless aperta nelle vicinanze:
network={
key_mgmt=NONE
priority=1
}Se invece si vuole ripetere il segnale di una rete chiusa (es. WPA):
network={
ssid="Nome Rete"
psk="CHIAVE WPA-PSK"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
priority=2
}O si possono combinare le due cose, con diversa priorita':
network={
key_mgmt=NONE
priority=1
}
network={
ssid="Nome Rete"
psk="CHIAVE WPA-PSK"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
priority=2
}/etc/rc.local
# Put your custom commands here that should be executed once # the system init finished. By default this file does nothing. wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon wpa_supplicant -Dwext -iath1 -c/etc/wpa_supplicant.conf -B wpa_cli -a/root/wpaction.sh -B iptables -t nat -A POSTROUTING -o ath1 -j MASQUERADE iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/root/wpaction.sh
case $2 in
CONNECTED)
dhcpcd -x $1 >/dev/null
dhcpcd $1 >/dev/null
;;Infine dare il seguente comando:
/etc/init.d/firewall disable
e riavviare il dispositivo.
File di configurazione Fonera Plus
/etc/config/wireless
config wifi-device wifi0
option type atheros
option channel '1'
option diversity '0'
option txantenna '0'
option disabled '0'
config wifi-iface
option device wifi0
option network 'lan'
option mode 'ap'
option ssid 'coccinellanet'
option encryption psk
option key 'xxxxx'
option hidden '0'
option isolate '0'
option txpower '18'
option bgscan '0'
option wds '0'/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 'ipaddr' '192.168.42.1'
option 'netmask' '255.255.255.0'
option 'dns' '151.100.31.31 8.8.8.8'
option 'ifname' 'eth0.1 ath0'
config 'interface' 'wan'
option 'ifname' 'eth0.2'
option 'proto' 'dhcp'/etc/config/dhcp
config dnsmasq
option domainneeded 1
option boguspriv 1
option filterwin2k '0' #enable for dial on demand
option localise_queries 1
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 0
#list interface br-lan
config dhcp lan
option interface lan
option start 100
option limit 150
option leasetime 12h
config dhcp wan
option interface wan
option ignore 1/etc/wpa_supplicant.conf
Per ripetere il segnale di una qualunque rete wireless aperta nelle vicinanze:
network={
key_mgmt=NONE
priority=1
}Se invece si vuole ripetere il segnale di una rete chiusa (es. WPA):
network={
ssid="Nome Rete"
psk="CHIAVE WPA-PSK"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
priority=2
}O si possono combinare le due cose, con diversa priorita':
network={
key_mgmt=NONE
priority=1
}
network={
ssid="Nome Rete"
psk="CHIAVE WPA-PSK"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
priority=2
}/etc/rc.local
# Put your custom commands here that should be executed once # the system init finished. By default this file does nothing. wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon wpa_supplicant -Dwext -iath1 -c/etc/wpa_supplicant.conf -B wpa_cli -a/root/wpaction.sh -B iptables -t nat -A POSTROUTING -o ath1 -j MASQUERADE iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/root/wpaction.sh
case $2 in
CONNECTED)
dhcpcd -x $1 >/dev/null
dhcpcd $1 >/dev/null
;;Infine dare il seguente comando:
/etc/init.d/firewall disable
e riavviare il dispositivo.