[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
no way to compare when less than two revisions
Diferencias
Muestra las diferencias entre dos versiones de la página.
— | es:howtos:hardware:arm:raspberrypi3_wap [2019/03/17 23:44 (UTC)] (actual) – creado rramp | ||
---|---|---|---|
Línea 1: | Línea 1: | ||
+ | ====== Wireless Access Point With a Raspberry Pi 3 ====== | ||
+ | ===== Introduction ===== | ||
+ | |||
+ | This HOWTO shows you how to replace the WiFi element of your home network setup with a Raspberry Pi running Slackware. | ||
+ | |||
+ | Although I've originally written this HOWTO for a RPi 3, I've since tried it on an RPi2 and it works just as well. Interface wlan1 will obviously change to wlan0 because the Pi2 has no on-board WiFi however. | ||
+ | ===== Hardware Requirements ===== | ||
+ | |||
+ | * A Raspberry Pi 3 running Slackware 14.2 | ||
+ | * A powered USB hub with 2A Power supply (to ensure the Wifi adapter gets enough juice) | ||
+ | * Alfa Network AWUS036NHA - USB WiFi Adapter with chipset ar9271l | ||
+ | * Ethernet cable | ||
+ | |||
+ | The powered Hub was purchased from the_pi_hut (http:// | ||
+ | |||
+ | {{ howtos: | ||
+ | |||
+ | Whatever you get, Make sure it has a beefy power supply, e.g. 2A. USB WiFi dongles, particularly the ones with external antennas can be thirsty and a 2A power adapter is unlikely to cost much more than a 1A one. | ||
+ | |||
+ | {{ howtos: | ||
+ | |||
+ | The Wifi Adapter choice is important. | ||
+ | |||
+ | < | ||
+ | |||
+ | Which for this model gives: | ||
+ | |||
+ | < | ||
+ | * IBSS | ||
+ | * managed | ||
+ | * AP | ||
+ | * AP/VLAN | ||
+ | * monitor | ||
+ | * mesh point | ||
+ | * P2P-client | ||
+ | * P2P-GO | ||
+ | * outside context of a BSS</ | ||
+ | |||
+ | Obviously the ' | ||
+ | |||
+ | My adapter was purchased from Amazon: https:// | ||
+ | |||
+ | {{ howtos: | ||
+ | |||
+ | ===== Adapter detection ===== | ||
+ | |||
+ | < | ||
+ | I advise to not connect and disconnect the hub from the Pi while it's running. | ||
+ | </ | ||
+ | |||
+ | Ensure that iwconfig shows two adapters wlan0 and wlan1. | ||
+ | |||
+ | < | ||
+ | |||
+ | This should result in the blue LED coming on. | ||
+ | |||
+ | < | ||
+ | |||
+ | This should result in the blue LED going off again. | ||
+ | |||
+ | While you're here, have a quick scan to see which channels might be in use: | ||
+ | |||
+ | < | ||
+ | |||
+ | This will indicate the channels that you **don' | ||
+ | |||
+ | ===== Bridge Configuration ===== | ||
+ | |||
+ | We will configure the AP to get it's own IP address on the ethernet side. Edit / | ||
+ | |||
+ | < | ||
+ | IPADDR[0]="" | ||
+ | NETMASK[0]="" | ||
+ | USE_DHCP[0]=" | ||
+ | DHCP_HOSTNAME[0]=" | ||
+ | |||
+ | (comment out the four lines). | ||
+ | |||
+ | Now replace that lot by commenting **in** the section starting: | ||
+ | |||
+ | < | ||
+ | |||
+ | Ensure the following appears so a bridge will be created (adjust DHCP_HOSTNAME to suit): | ||
+ | |||
+ | < | ||
+ | BRNICS[0]=" | ||
+ | IPADDR[0]="" | ||
+ | NETMASK[0]="" | ||
+ | USE_DHCP[0]=" | ||
+ | DHCP_HOSTNAME[0]=" | ||
+ | |||
+ | This sets up a bridge, with eth0 attached to it, and tells Slackware to give the new br0 interface an IP address via DHCP. Reboot after you've done that and check that your ethernet networking is still in working order. | ||
+ | |||
+ | ===== Hostapd Install ===== | ||
+ | |||
+ | The only AP software for Linux that I'm aware of is hostapd. | ||
+ | |||
+ | < | ||
+ | # tar xvf hostapd.tar.gz | ||
+ | # cd hostapd | ||
+ | # wget https:// | ||
+ | # ./ | ||
+ | # installpkg / | ||
+ | |||
+ | Next you need to edit / | ||
+ | |||
+ | < | ||
+ | bridge=br0 | ||
+ | logger_syslog=-1 | ||
+ | logger_syslog_level=2 | ||
+ | ctrl_interface=/ | ||
+ | ssid=biffsnetwork | ||
+ | wpa=2 | ||
+ | wpa_passphrase=somethingreallysecret! | ||
+ | hw_mode=g | ||
+ | channel=7 | ||
+ | auth_algs=1</ | ||
+ | |||
+ | What this does: The interface wlan1, we've seen before. | ||
+ | |||
+ | That minimal config should get hostapd working fine, at least it did for me. | ||
+ | |||
+ | Finally, you just need to start hostapd, either by adding / | ||
+ | |||
+ | < | ||
+ | / | ||
+ | fi</ | ||
+ | |||
+ | Don't forget to: | ||
+ | |||
+ | < | ||
+ | |||
+ | ===== QR Codes ===== | ||
+ | |||
+ | {{ howtos: | ||
+ | |||
+ | No home WiFi network setup is complete without a QR code that you can wave at all your mates when they are round your house wanting to connect. | ||
+ | |||
+ | Type the following to create a PNG file with the code, which you can print, copy to your mobile, put on a local webpage or whatever. | ||
+ | |||
+ | < | ||
+ | |||
+ | The above assumes WPA2, MYSSID should be replaced with your SSID, MYPASSWD replaced with your password. | ||
+ | |||
+ | At a pinch, the following bash script should pull your SSID and passphrase out of the hostapd.conf file, and automatically use them to create a new QR code, so you can quickly keep it up to date after any changes. | ||
+ | |||
+ | < | ||
+ | |||
+ | SSID=$(cat / | ||
+ | PASS=$(cat / | ||
+ | |||
+ | qrencode -t PNG -o hostapd.png " | ||
+ | |||
+ | |||
+ | ===== Conclusion ===== | ||
+ | |||
+ | That's it! You should now be able connect to this AP, and (assuming you are running a DHCP server on your ethernet) it will serve your wireless devices, and everything will be able to talk to everything else. Your desktop will be able to ping your mobile and so on. | ||
+ | |||
+ | ====== Sources ====== | ||
+ | * Originally written by [[wiki: | ||
+ | |||
+ | {{tag> |