bpi-r2:wlan
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
bpi-r2:wlan [2018/02/01 17:22] – [intern] frank | bpi-r2:wlan [2023/06/08 17:06] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== WLAN ====== | ||
+ | :!: die hier vorgestellten Konfig-Dateien enthalten noch keine Sicherheitsparameter (z.B. WLAN-Verschlüsselung/ | ||
+ | ===== intern ===== | ||
+ | in Kernel 4.4.70 ist der Wlan-Code vorhanden, muss aber separat aktiviert werden | ||
+ | |||
+ | [[https:// | ||
+ | [[http:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | :!: wpasupplicant muss deinstalliert, | ||
+ | apt-get remove wpasupplicant | ||
+ | | ||
+ | apt-get install hostapd dnsmasq | ||
+ | |||
+ | hostapd.conf: | ||
+ | |||
+ | <code bash> | ||
+ | hw_mode=g | ||
+ | interface=ap0 | ||
+ | driver=nl80211 | ||
+ | channel=1 | ||
+ | auth_algs=1 | ||
+ | ssid=test | ||
+ | </ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | - wmt_loader | ||
+ | - stp_uart_launcher -p / | ||
+ | - Treibermodul laden (wenn als Modul 5.4+ compiliert): | ||
+ | - ( echo 0 >/ | ||
+ | - echo A >/ | ||
+ | |||
+ | beim letzten Schritt wird das AP-Gerät (Accesspoint) erzeugt, welches dann von hostapd genutzt wird | ||
+ | |||
+ | <code bash> | ||
+ | [14:14] root@bpi-r2: | ||
+ | ap0 Link encap: | ||
+ | bond0 Link encap: | ||
+ | eth0 Link encap: | ||
+ | inet6 addr: fe80:: | ||
+ | eth1 Link encap: | ||
+ | inet6 addr: fe80:: | ||
+ | lo Link encap:Local Loopback | ||
+ | sit0 Link encap: | ||
+ | tunl0 Link encap:IPIP Tunnel | ||
+ | wlan1 Link encap: | ||
+ | </ | ||
+ | hostapd starten | ||
+ | |||
+ | hostapd -dd / | ||
+ | |||
+ | nun kann mit der Schnittstelle weitergearbeitet werden: | ||
+ | |||
+ | <code bash> | ||
+ | ip addr add 192.168.10.1/ | ||
+ | #ip link set dev ap0 up | ||
+ | service dnsmasq start | ||
+ | </ | ||
+ | |||
+ | |||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
+ | {{ : | ||
+ | |||
+ | ==== Kernel 4.14 ==== | ||
+ | |||
+ | Code vom Kernel 4.4.70 habe ich in [[https:// | ||
+ | |||
+ | Diskussion hier (EN): [[http:// | ||
+ | |||
+ | ==== bekannte Probleme ==== | ||
+ | |||
+ | === Zufallszahlen === | ||
+ | |||
+ | direkt nach dem (Re-)boot ist der Zufallszahlengenerator noch nicht ausreichend gefüllt, so dass Verbindungversuche abgelehnt werden, bis dieser gefüllt ist. | ||
+ | |||
+ | in der hostapd-log sieht das so aus: | ||
+ | < | ||
+ | random: Cannot read from / | ||
+ | random: Got 0/14 bytes from /dev/random | ||
+ | random: Only 6/20 bytes of strong random data available from /dev/random | ||
+ | random: Not enough entropy pool available for secure operations | ||
+ | WPA: Not enough entropy in random pool to proceed - reject first 4-way handshake | ||
+ | ... | ||
+ | WPA: Reject 4-way handshake to collect more entropy for random number generation | ||
+ | random: Mark internal entropy pool to be ready (count=1/2) | ||
+ | ... | ||
+ | random: Cannot read from / | ||
+ | random: Got 0/14 bytes from /dev/random | ||
+ | random: Only 6/20 bytes of strong random data available from /dev/random | ||
+ | random: Allow operation to proceed based on internal entropy | ||
+ | </ | ||
+ | |||
+ | http:// | ||
+ | |||
+ | < | ||
+ | apt-get install rng-tools | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | ===== extern ===== | ||
+ | |||
+ | ==== MT76 ==== | ||
+ | |||
+ | FIXME | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | === 4.4.70 === | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | git clone https:// | ||
+ | cd bpi_r2_mt76/ | ||
+ | cd linux-mt/ | ||
+ | git clone https:// | ||
+ | cd ../../../.. # | ||
+ | patch -p1 < drivers/ | ||
+ | nano drivers/ | ||
+ | #add: obj-$(CONFIG_MT76) | ||
+ | nano drivers/ | ||
+ | #add before endif: before endif # WL_MEDIATEK: | ||
+ | cd .. | ||
+ | ./build.sh => 4 | ||
+ | #networking support => wireless => < | ||
+ | #Device Drivers | ||
+ | ./build.sh => 1 | ||
+ | cp SD/ | ||
+ | sudo cp -r SD/ | ||
+ | sudo cp linux-mt/ | ||
+ | #scp linux-mt/ | ||
+ | sync | ||
+ | </ | ||
+ | |||
+ | === 4.14 === | ||
+ | |||
+ | Kernel 4.14+ (in Arbeit...): | ||
+ | |||
+ | bei folgendem Fehler (dmesg): | ||
+ | |||
+ | mt76x2e: probe of 0000: | ||
+ | |||
+ | muss Firmware-Paket installiert werden: | ||
+ | |||
+ | apt-get install firmware-misc-nonfree | ||
+ | |||
+ | falls das abbricht muss in der / | ||
+ | |||
+ | < | ||
+ | {{ : | ||
+ | |||
+ | <code bash> | ||
+ | patch -p1 < pcie.patch | ||
+ | cd drivers/ | ||
+ | git clone https:// | ||
+ | </ | ||
+ | * in der mt76/ | ||
+ | * in der mt76/ | ||
+ | * im Makefile fehlen " | ||
+ | * und halt in drivers/ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | folgende module im kernel aktivieren: | ||
+ | |||
+ | < | ||
+ | CONFIG_MAC80211=m | ||
+ | CONFIG_CFG80211=m | ||
+ | CONFIG_MT76=m | ||
+ | |||
+ | #pcie | ||
+ | CONFIG_PCIEPORTBUS=y | ||
+ | CONFIG_PCIE_MEDIATEK=y | ||
+ | CONFIG_PHY_MTK_TPHY=y | ||
+ | </ | ||
+ | |||
+ | die firmware kopieren | ||
+ | |||
+ | sudo cp drivers/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | === einrichten === | ||
+ | |||
+ | <code bash> | ||
+ | [10:50] root@bpi-r2: | ||
+ | wlan1 Link encap: | ||
+ | </ | ||
+ | Wenn die wlan-Nummer größer 1, entsprechend anpassen | ||
+ | <code bash> | ||
+ | nano / | ||
+ | </ | ||
+ | |||
+ | / | ||
+ | <code bash> | ||
+ | interface=wlan1 | ||
+ | # | ||
+ | driver=nl80211 | ||
+ | |||
+ | ssid=r2_AP | ||
+ | |||
+ | hw_mode=g | ||
+ | channel=1 | ||
+ | # | ||
+ | auth_algs=1 | ||
+ | # | ||
+ | #wpa=2 | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | hostapd starten (Debugmode): | ||
+ | < | ||
+ | |||
+ | IP-Adresse setzen: | ||
+ | |||
+ | < | ||
+ | |||
+ | / | ||
+ | <code bash> | ||
+ | conf-dir=/ | ||
+ | </ | ||
+ | / | ||
+ | <code bash> | ||
+ | # | ||
+ | interface=wlan0 | ||
+ | # | ||
+ | interface=ap0 | ||
+ | |||
+ | # DHCP-Server nicht aktiv für Interface | ||
+ | # | ||
+ | no-dhcp-interface=eth0 | ||
+ | no-dhcp-interface=eth1 | ||
+ | |||
+ | # | ||
+ | dhcp-range=ap0, | ||
+ | dhcp-option=ap0, | ||
+ | dhcp-range=wlan1, | ||
+ | dhcp-option=wlan1, | ||
+ | </ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ===== HostAPd ===== | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
+ | Vif: https:// | ||
+ | ==== 5GHz ==== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | <code bash> | ||
+ | apt-get install iw wireless-regdb crda | ||
+ | </ | ||
+ | === country code === | ||
+ | den Country-Code (regulary domain) zu setzen kann bisschen tricky sein | ||
+ | <code bash> | ||
+ | iw reg set ISO_3166-1_alpha-2 | ||
+ | iw reg set DE | ||
+ | iw reg get | ||
+ | </ | ||
+ | |||
+ | falsche Ausgabe: | ||
+ | |||
+ | global | ||
+ | country 00: DFS-UNSET | ||
+ | |||
+ | richtig: | ||
+ | |||
+ | global | ||
+ | country DE: DFS-ETSI | ||
+ | |||
+ | cfg80211 als Modul (5.4, | ||
+ | <code bash> | ||
+ | $ sudo nano / | ||
+ | options cfg80211 ieee80211_regdom=DE | ||
+ | </ | ||
+ | |||
+ | ggf. manuell laden | ||
+ | |||
+ | modprobe cfg80211 ieee80211_regdom=DE | ||
+ | |||
+ | evtl. probieren: | ||
+ | < | ||
+ | COUNTRY=DE crda | ||
+ | </ | ||
+ | bricht bei mir aber mit " | ||
+ | |||
+ | === mögliche Frequenzen === | ||
+ | < | ||
+ | iw list | grep MHz | ||
+ | </ | ||
+ | === Hostapd-Konfiguration === | ||
+ | |||
+ | <code bash> | ||
+ | $ sudo nano / | ||
+ | [...] | ||
+ | country_code=DE | ||
+ | ieee80211n=1 | ||
+ | ieee80211d=1 | ||
+ | hw_mode=a | ||
+ | channel=48 | ||
+ | [...] | ||
+ | </ | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | ===== IP-Konfiguration ===== | ||
+ | IP-Adresse setzen: | ||
+ | |||
+ | ip addr add 192.168.10.1/ | ||
+ | ip addr add 192.168.11.1/ | ||
+ | |||
+ | / | ||
+ | <code bash> | ||
+ | conf-dir=/ | ||
+ | </ | ||
+ | / | ||
+ | <code bash> | ||
+ | # | ||
+ | interface=wlan0 | ||
+ | # | ||
+ | interface=ap0 | ||
+ | |||
+ | # DHCP-Server nicht aktiv für Interface | ||
+ | # | ||
+ | no-dhcp-interface=eth0 | ||
+ | no-dhcp-interface=eth1 | ||
+ | |||
+ | # | ||
+ | dhcp-range=ap0, | ||
+ | dhcp-option=ap0, | ||
+ | dhcp-range=wlan1, | ||
+ | dhcp-option=wlan1, | ||
+ | </ | ||
+ | |||
+ | {{ : | ||
+ | ==== Routing ==== | ||
+ | |||
+ | <code bash> | ||
+ | nano / | ||
+ | # | ||
+ | sysctl -p / | ||
+ | </ | ||
+ | |||
+ | Voraussetzung ist, dass der Router (wenn es nicht der BPI-R2 selbst ist) das/die WLAN-Netz(e) auch kennt und weiß wohin er die Pakete schicken muss. | ||
+ | |||
+ | Die folgenden beiden Befehle müssen im (Debian-)Router ausgeführt werden, um die Routing-Tabelle entsprechend zu erweitern (gehen beim reboot verloren, wenn nicht beim Systemstart ausgeführt): | ||
+ | <code bash> | ||
+ | route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.0.10 | ||
+ | route add -net 192.168.11.0 netmask 255.255.255.0 gw 192.168.0.10 | ||
+ | </ | ||
+ | dabei ist 192.168.10.0 das Netz des 1. WLAN, 192.168.11.0 das Netz des 2. WLAN und 192.168.0.10 die LAN-IP des BPI-R2 (gleiches netz wie die LAN-IP des Routers) |
bpi-r2/wlan.txt · Zuletzt geändert: 2023/06/08 17:06 von 127.0.0.1