Italiano English
Modifica History Actions

Differenze per "FoneraAsRepeaterHowTo"

Differenze tra le versioni 4 e 6 (in 2 versioni)
Versione 4 del 2010-08-16 09:13:30
Dimensione: 3338
Autore: host244-16-dynamic
Commento: il pacchetto si chiama wpa-suppicant
Versione 6 del 2011-01-20 21:23:35
Dimensione: 6188
Autore: ClauzClauz
Commento: foneraplus
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 8: Linea 8:
== File di configurazione == <<TableOfContents>>

== File di configurazione Fonera 2100/2200 ==
Linea 22: Linea 24:
 option network 'ninuxif'  option network 'lan'
Linea 44: Linea 46:
 option 'ifname' 'eth0'  option 'type' 'bridge'
option 'ifname' 'eth0 ath0'
Linea 46: Linea 49:
 option 'ipaddr' '192.168.42.1'
Linea 47: Linea 51:
 option 'dns' '151.100.31.31'  option 'dns' '151.100.31.31 8.8.8.8'
Linea 49: Linea 53:
 option 'ipaddr' '192.168.42.1'

config 'interface' 'ninuxif'
 option 'proto' 'static'
 option 'ipaddr' '172.16.242.1'
 option 'netmask' '255.255.0.0'
 option 'gateway' ''
 option 'dns' '151.100.31.31'
Linea 85: Linea 82:
config dhcp ninuxif
        option interface ninuxif
 option start 50
 option limit 150
 option leasetime 12h

Linea 148: Linea 138:
wpa_supplicant -Dwext -iath1 -c/etc/wpa_supplicant.conf >/dev/null 2>/dev/null &
dhcpcd ath1
wpa_supplicant -Dwext -iath1 -c/etc/wpa_supplicant.conf -B
wpa_cli -a
/root/wpaction.sh -B
Linea 151: Linea 141:
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
;;
Linea 161: Linea 162:




== 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.

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

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.