Raspberry 3 – create a wifi repeater with USB wifi dongle
Updated on 2019 Jan 11 – tested and working from scratch
What you need to do this :
You need a raspberry pi 3 or raspberry pi 3 B+ if you want to handle wifi 5Ghz.
We need an extra wifi adapter (panda 005 or canakit wifi or any kernel supported adapter) – listed below are 2.4Ghz only
https://www.amazon.ca/gp/product/B00EQT0YK2/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
https://www.amazon.ca/CanaKit-Raspberry-Wireless-Adapter-Dongle/dp/B00GFAN498/ref=sr_1_4?s=electronics&ie=UTF8&qid=1546365634&sr=1-4&keywords=raspberry+pi+wifi
or that
https://www.canakit.com/raspberry-pi-wifi.html
What you need to do then
Deploy original raspbian lite on it (this is a network management device, we don’t want or need a GUI on it). SSH to it or connect on the raspberri pi itself. User pi, password raspberry, sudo bash to be root.
Update the system and install requirements as follow :
apt-get update
apt upgrade
apt-get update
apt-get install git bash util-linux procps hostapd iproute2 iw haveged dnsmasq iptables vim
git clone https://github.com/oblique/create_ap
cd create_ap/
make install
cd ..
The above does apply all the latest updates, and clone the create_ap script that allows easy wifi access point creation.
You might want to change keyboard layout, which by default is UK. I do use US layout, so to change, run « raspi-config » -> « 4 – Localisation Options » -> « I3 – change keyboard layout » -> »Generic 103… » -> « Other » -> « English (US) » -> « ok » -> « default » -> « ok » -> « no compose key » -> « ok » -> « finish »
(use TAB to switch between buttons)
We want to handle wpa_supplicant manually, because otherwise we can’t assign proper interface. There is a configuration menu on the raspi-config command, but this is NOT what we want. The default wpa_supplicant use any of the wifi adapters to connect, sometime both. But in our case, we want 1 connected, and 1 access point.
mv /etc/wpa_supplicant/wpa_supplicant.conf /home/pi/wpa_supplicant.conf
Content of wpa_supplicant.conf have to be :
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="yourexistingwifi"
psk="existingwifipassword"
}
In the above, you have to put the SSID of your main / existing wifi, and the password of it as psk. This will allow the raspberry to connect to this network with 1 of its adapters.
We then create a little script that will do what wee need. Create the file /home/pi/start-relaywifi.sh with the following content :
#!/bin/bash
wpa_supplicant -B -c/home/pi/wpa_supplicant.conf -iwlan0 -Dnl80211,wext
create_ap -g 172.20.0.1 -c 10 -w 2 wlan1 wlan0 relaywifi relaywifipassword
The above use the wlan0 interface to connect to your existing wifi (using most likely the onboard wifi of the raspberry), and the second line create an access point on the second wifi adapter (the USB one) that shares the connection of the first one.
We then set this to be called at boot from /etc/rc.local by adding the following lines before the last line of rc.local :
/home/pi/start-relaywifi.sh
We then set the executable bit on our little script :
chmod +x /home/pi/start-relaywifi.sh
All good. Reboot the pi, and it should :
Boot raspbian, execute rc.local which call our script, connect to existing wifi, and appear as access point.
Sidenote : The onboard wifi driver does not support full A/P or bridging mode. Therefore, the extended wifi is using its own IP range, which must be different from the main one.
The IP range used in this example is 172.20.0.x, but you can pick any private IP range and adjust the create_ap command accordingly.
Device on extended wifi can speak to the main wifi, but main most likely won’t be able to see the devices on extended. If you have a printer, or so, it should be on the one.
If you want this to happen you should :
– reserve an IP on your main wifi for the raspberry MAC, so as it always gets the same IP
– add a route on your main router, that state, network 172.20.0.x can be reached via IP-YOU-RESERVED for the raspberry
I won’t go more in details, since the point was to get wifi network extended, and connect your wifi devices from bigger range.
I might add french later one, and will test this and adjust if need be, as i said, i have it running, but did not redo everything from scratch :D
Happy new year 2019 :D
Ajouter un commentaire
Links
Recherche
Derniers articles
Tresronours Twitter
Keywords cloud topic
Membre de la FSF
Liens qui vont bien
Mots clés vrac – keyword cloud
License du contenu – CC By NC SA
Archives
- Resumed posting and expanding on X
- Linkedin Access to your account has been restricted – Final debrief and resilience plan
- I’m thankful for the support I get in rough time
- Cyber security news of the day – 2024 May 31
- Alexandre Blanc Cyber Kicked out from Linkedin
- You’ll most likely find me on LinkedIn
- The Russian roulette landing page !
- RTSP, Debian, VLC, not playing, IP Camera
- 5G network hosted in the cloud, no internet, no phone ! So smart ! And I ended on TV, This week in cyber
- They lock the door for privacy… but they keep a copy of the key, and couple of backdoors
- Worst is yet to come, but they all warned you
- Migrating an old WordPress and handling character set, UTF8, latin1, latin1_swedish_ci
- From a broken TLS CA, to Facebook, to FIN12 hit and run
- Yes we can fix this mess, but do we want to ? That’s another story
- Criminals are still dominating the game, why are we doing so wrong, and what can we learn in this tech ocean ?
- Riding cloud can be tricky, don’t fall from it, in the weekly cyber !
- The threat landscape is very dynamic – Cyber news this week
- Cybersecurity is not obvious even for this newsletter !
- Install Slack desktop app on Kali rolling fixing libappindicator3-1 missing dependency
- How to delete all resources in azure to avoid charges after trial on your forced credit card registration
- Proxmox – ZFS – Dead drive on active VM, recover from replicated disk
- Restrict access to proxmox web admin interface
- Migrate your ESXI VMs to proxmox ZFS
- Install your VPN server with pi-hole on OVH VPS in 30 min
- Using raspberry pi 3 as wifi bridge and repeater and firewall
- Raspberry 3 – create a wifi repeater with USB wifi dongle
- raspberry 3 – routeur pare feu point d’acces wifi avec filtrage pub et tracking – router firewall access point with ads and tracking filtering
- Dell XPS 13 touchpad – corriger la sensibilité
- Utiliser Zazeen set top box depuis une connexion videotron
- Fermeture de mon compte facebook – la dernière goutte
- Choisir un kernel par defaut au demarrage de Centos 7.2 – configuration grub2
- Openvpn access server 2.0.25 et android
- Régler la luminosité du laptop par ligne de commande
- chromium outlook web app version complete sous linux
- Nexus 7 2012 – android 5 lollipop solution au probleme de lenteur
- HDD led sur Xubuntu – xfce
- xubuntu 14.04 verrouiller ecran de veille et desactiver mise en veille a la fermeture de l’ecran
- Authentification avec Radmin en utilisant Wine sur Gentoo
- Patcher bash sur une distribution plus supportee comme fedora 11
- Zimbra desktop sous xubuntu 14.04 64bit – fix
- xubuntu 12.10 probleme de son avec VLC – pulse audio – alsa – toshiba L855D – solution
- Evolution sous xubuntu 12.10 – bug affichage a la configuration – solution temporaire
- Booster son acces internet en changeant de DNS pour opendns
- Serveur DLNA sous ubuntu – minidlna
- sshfs sous windows – dokan sshfs
- xubuntu 11.10 Installer le plugin java pour firefox
- Installer Google Earth sur Xubuntu 11.10
- Installer nagios sur Fedora 11 depuis les sources
- Configurer varnish-cache avec des virtualhosts, apache, fedora, redhat, centos
- Installer Varnish depuis les sources sur Fedora 11