Curiosità  Wi-Fi

Postate qui per tutte le discussioni legate a Linux in generale.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Gnu/Linux in genere, se l'argomento è specifico alla Slackware usate uno dei forum Slackware o Slackware64.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Buongiorno a tutti :)...
Stavo rivedendo i miei script per fare l' hotspot che ridirige al mio server web apache,
ma ottengo questo errore:

Codice: Seleziona tutto

Configuration file: /tmp/hostapd.conf
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
Ho provato a ricompilare il kernel 4.2 con il supporto NL80211:

Codice: Seleziona tutto

CONFIG_NL80211_TESTMODE=y
Ma non è servito..
Il tutto gira su kubuntu 15.04...
Sapete darmi una mano..
Grazie 1000
Francesco

Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Ho risolto tornando alla versione hostapd_1.0-3ubuntu2.1_amd64.deb.
e bloccando gli aggiornamenti con

Codice: Seleziona tutto

sudo apt-mark hold hostapd
Grazie

Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Buonasera, è da qualche ora che tento di far partire hostapd sulla mia slackware current senza successo [-( ...
Questa è la mia scheda:

Codice: Seleziona tutto

Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 3e)


Wiphy phy0
        max # scan SSIDs: 20
        max scan IEs length: 95 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports RSN-IBSS.
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
                * 00-0f-ac:10
                * GCMP (00-0f-ac:8)
                * 00-0f-ac:9
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * monitor
        Band 1:
                Capabilities: 0x1072
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 8191 bytes (exponent: 0x000)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT Max RX data rate: 450 Mbps
                HT TX/RX MCS rate indexes supported: 0-23
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 2412 MHz [1] (15.0 dBm)
                        * 2417 MHz [2] (15.0 dBm)
                        * 2422 MHz [3] (15.0 dBm)
                        * 2427 MHz [4] (15.0 dBm)
                        * 2432 MHz [5] (15.0 dBm)
                        * 2437 MHz [6] (15.0 dBm)
                        * 2442 MHz [7] (15.0 dBm)
                        * 2447 MHz [8] (15.0 dBm)
                        * 2452 MHz [9] (15.0 dBm)
                        * 2457 MHz [10] (15.0 dBm)
                        * 2462 MHz [11] (15.0 dBm)
                        * 2467 MHz [12] (15.0 dBm) (no IR)
                        * 2472 MHz [13] (15.0 dBm) (no IR)
        Band 2:
                Capabilities: 0x1072
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 8191 bytes (exponent: 0x000)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT Max RX data rate: 450 Mbps
                HT TX/RX MCS rate indexes supported: 0-23
                Bitrates (non-HT):
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 5180 MHz [36] (15.0 dBm) (no IR)
                        * 5200 MHz [40] (15.0 dBm) (no IR)
                        * 5220 MHz [44] (15.0 dBm) (no IR)
                        * 5240 MHz [48] (15.0 dBm) (no IR)
                        * 5260 MHz [52] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5280 MHz [56] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5300 MHz [60] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5320 MHz [64] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5500 MHz [100] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5520 MHz [104] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5540 MHz [108] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5560 MHz [112] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5580 MHz [116] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5600 MHz [120] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5620 MHz [124] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5640 MHz [128] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5660 MHz [132] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5680 MHz [136] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5700 MHz [140] (15.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 31621 sec)
                          DFS CAC time: 0 ms
                        * 5745 MHz [149] (15.0 dBm) (no IR)
                        * 5765 MHz [153] (15.0 dBm) (no IR)
                        * 5785 MHz [157] (15.0 dBm) (no IR)
                        * 5805 MHz [161] (15.0 dBm) (no IR)
                        * 5825 MHz [165] (15.0 dBm) (no IR)
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * new_mpath
                 * set_mesh_config
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * join_mesh
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * start_p2p_device
                 * set_mcast_rate
                 * set_qos_map
                 * connect
                 * disconnect
        Supported TX frame types:
                 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * IBSS: 0x40 0xb0 0xc0 0xd0
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * mesh point: 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-device: 0x40 0xd0
        software interface modes (can always be added):
                 * monitor
        interface combinations are not supported
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        Device supports TX status socket option.
        Device supports HT-IBSS.
        Device supports SAE with AUTHENTICATE command
        Device supports scan flush.
        Device supports per-vif TX power setting
        Driver supports a userspace MPM
        Device supports static SMPS
        Device supports dynamic SMPS
        Device supports configuring vdev MAC-addr on create.
Ho provato varie versioni di hostapd, anche la 1.0 ma non funziona con errore

Codice: Seleziona tutto

Channel not configured (hw_mode/channel in hostapd.conf)
Could not select hw_mode and channel. (-3)
wlan0: Unable to setup interface.
Could not connect to kernel driver.
oppure nelle versioni successive:

Codice: Seleziona tutto

Configuration file: /tmp/hostapd.conf
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211 driver initialization failed.
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED 
hostapd_free_hapd_data: Interface wlan0 wasn't started
Mi sapete consigliare una versione funzionante o avete consigli?

Grazie Francesco

Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Ho risolto facendo tutto con airbase.. grazie

Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Buonasera, è dà un pò che non metto mano ai miei script per fare l'hotspot
ma ora mi sono nuovamente indispensabili.....

In pratica ho 2 schede di rete wifi, una connessa alla rete ed un altra che dovrebbe fare da hotspot...
Rileggendo i vecchi appunti ho messo giu questo:

Codice: Seleziona tutto

#!/bin/bash
NOME_RETE='Rete_PC_2'
device_in='wlo1'
device_out='wlp0s20u4'
airmon-ng start $device_out 1> /dev/null 2> /dev/null 
device_out_mon=$(ifconfig -a | grep mon | awk -F ':' '{print $1}')

sudo killall -9 dnsmasq 2> /dev/null
sudo killall -9 airbase-ng 2> /dev/null

echo "* Imposto la scheda di rete device_out_mon"

 sudo ifconfig $device_out down
 sudo ifconfig $device_out_mon down 
 sudo ip addr add 192.168.2.1/8 dev $device_out_mon
 sudo ifconfig $device_out_mon up
airbase-ng -e $NOME_RETE -c 9 $device_out_mon 1> /dev/null 2> /dev/null &

echo "* Set DHCP"
 sudo dnsmasq --address=/#/192.168.2.1 --bind-interfaces --except-interface=$device_in --clear-on-reload --strict-order --listen-address=192.168.2.1 --dhcp-range=192.168.2.10,192.168.2.200,60m --dhcp-option=option:router,192.168.2.1 --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-$device_out.pid 
 

echo "* Set ip_forward ";
sysctl net.ipv4.ip_forward=1
echo "* Set iptables";
iptables -X
iptables -F
iptables -A FORWARD -i $device_out_mon -o $device_in -s 192.168.0.0/24 -m state --state NEW -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE

echo "* Ora collegati alla rete wifi '$NOME_RETE' ";
ma dnsmasq non dà ip, e anche iptables non lavora correttamente.....

Sapete aiutarmi?
Grazie

Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Ho modificato leggermente così

Codice: Seleziona tutto

#!/bin/bash
NOME_RETE='Rete_PC_2'
device_in='wlo1'
device_out='wlp0s20u4'
airmon-ng start $device_out &> /dev/null 
device_out_mon=$(ifconfig -a | grep mon | awk -F ':' '{print $1}')

sudo killall -9 dnsmasq &> /dev/null
sudo killall -9 airbase-ng &> /dev/null

echo "* Imposto la scheda di rete $device_out_mon"

 sudo ifconfig $device_out down
 sudo ifconfig $device_out_mon down 
 sudo ip addr add 10.0.0.1/8 dev $device_out_mon &> /dev/null
 sudo ifconfig $device_out_mon up
airbase-ng -e $NOME_RETE -c 9 $device_out_mon &> /dev/null &

echo "* Set ip_forward ";
sysctl net.ipv4.ip_forward=1 &> /dev/null

echo "* Set iptables";
sudo iptables -F
sudo iptables -v -tnat -A POSTROUTING -o $device_out_mon -j MASQUERADE &> /dev/null

echo "* Set DHCP"
cat << EOF > /etc/resolv.dnsmasq
nameserver 8.8.8.8
nameserver 8.8.4.4
EOF
sudo dnsmasq -x /var/run/dnsmasq.pid -z -a 10.0.0.1 -r /etc/resolv.dnsmasq --dhcp-range=10.0.0.100,10.0.0.150,60m --dhcp-option=option:router,10.0.0.1 &> /dev/null
 
echo "* Ora collegati alla rete wifi '$NOME_RETE' ";
exit 0
Ma l'ip non viene assegnato in dhcp, e provando ad inserirlo in modo statico la connessione c'è ma facendo dei ping ottengo
Destination Host Unreachable

Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Sono riuscito a far partire l'hotspot e il dhcp...
mi servirebbe solo la regola iptables per far sì che la rete "hotspot" sia connessa con la rete connessa a internet...
Vi chiedo aiuto :o
Queste sono le periferiche:

Codice: Seleziona tutto

wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.27  netmask 255.255.255.0  broadcast 192.168.1.255
        ether 24:77:03:cc:40:c5  txqueuelen 1000  (Ethernet)
        RX packets 1908012  bytes 2410089834 (2.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1443485  bytes 267719534 (255.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp0s20u3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.1  netmask 255.0.0.0  broadcast 0.0.0.0
        inet6 fe80::20c:f6ff:fe77:e9c3  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:f6:77:e9:c3  txqueuelen 1000  (Ethernet)
        RX packets 2782  bytes 226502 (221.1 KiB)
        RX errors 0  dropped 6  overruns 0  frame 0
        TX packets 1405  bytes 1129815 (1.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Dove wlo1 è connessa ad internet
mentre wlp0s20u3 è l'hotspot

Grazie

Avatar utente
darkstaring
Linux 3.x
Linux 3.x
Messaggi: 657
Iscritto il: mer 13 ott 2010, 13:55
Nome Cognome: Francesco Achenza
Desktop: KDE
Distribuzione: Arch Linux
Contatta:

Re: Curiosità  Wi-Fi

Messaggio da darkstaring »

Risolto con:

Codice: Seleziona tutto

/sbin/iptables --flush 
/sbin/iptables --table nat --flush 
/sbin/iptables --delete-chain 
/sbin/iptables --table nat --delete-chain 
/sbin/iptables --table nat --append POSTROUTING --out-interface wlo1 -j MASQUERADE 
/sbin/iptables --append FORWARD --in-interface wlp0s20u3 -j ACCEPT

Rispondi