Comment réaliser un point d’accès wifi avec un Raspberry 3.
(original : http://blog.ithasu.org/2016/10/using-a-raspberry-pi-3-as-a-wifi-access-point-and-bridge/ )
Il s’agit de laisser le DHCP du modem délivrer ces IP.
- Installer une distribution avec SSHD activé : https://minibianpi.wordpress.com/ (root / raspberry)
- Activer la carte wifi et le bluetooth (spécifique à cette distribution) :
-
apt-get install firmware-brcm80211 pi-bluetooth wpasupplicant
- reboot
-
- Installer ensuite : apt-get install -y bridge-utils hostapd
- Création du bridge : Éditer le fichier /etc/sysctl.conf et dé-commenter la ligne :net.ipv4.ip_forward=1
- Ensuite créer le bridge sur Eth0 en editant le fichier /etc/network/interfaces (A adapter en fonction du réseau)
- auto lo
iface lo inet loopback# Disable eth0 / wlan0 config, handled by bridge
auto eth0
iface eth0 inet manualallow-hotplug wlan0
iface wlan0 inet manual# Create a bridge with static IP
auto br0
iface br0 inet static
bridge_ports eth0
address 192.168.1.13
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1 # a ajouter pour les mise a jour du point d acces
dns-nameservers 192.168.1.1 # a ajouter pour la mise a jour du point d acces
# Or use dhcp client on bridge
#iface br0 inet dhcp
- auto lo
- Configuration du Point d’accès Wifi en éditant le fichier /etc/hostapd/hostapd.conf
- # First part is about configuring the access point and is copied from reference 1
interface=wlan0
driver=nl80211
hw_mode=g
channel=6
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
# This part is about setting SSID and WPA2 password
ssid=wifi_ssid
wpa_passphrase=wifi_password
# This line ask hostapd to add wlan0 to the bridge br0
bridge=br0
- # First part is about configuring the access point and is copied from reference 1
- Configurer Hostpapd pour utiliser le fichier de configuration en éditant /etc/default/hostapd ;
- DAEMON_CONF= »/etc/hostapd/hostapd.conf »
- Il suffit de rebooter