Ceci est une ancienne révision du document !
apt install hostapd
Un fichier d'exemple de configuration se trouve dans /usr/share/doc/hostapd/examples/hostapd.conf.gz
Créez-en un nouveau fichier de configuration
nano /etc/hostapd/hostapd.conf
Placez cette configuration à l'intérieur
#L'interface wifi interface=wlx503eaa3d7d6c #Le SSID (le nom du point d'accès wifi) ssid=OPEN WIFI #Le driver wifi driver=nl80211 #On choisit le channel channel=6 #Mettre le paramètre à "g" pour la bande à 2.4Ghz, et à "a" pour la bande à 5Ghz hw_mode=g #Vous pouvez décommenter les paramètres suivants pour utiliser l'authentification #wpa=2 #wpa_passphrase=votre_mot_de_passe #wpa_key_mgmt=WPA-PSK #wpa_pairwise=CCMP #rsn_pairwise=CCMP #On log le trafic logger_syslog=-1 logger_syslog_level=1 logger_stdout=-1 logger_stdout_level=2 # Levels (minimum value for logged events): # 0 = verbose debugging # 1 = debugging # 2 = informational messages # 3 = notification # 4 = warning # -1 = all
Le SSID a une limite de 32 caractères (31 parfois sur certaines cartes wifi)
Éditez le fichier /etc/networkinterfaces.d/interface_ap et rajoutez les lignes suivantes
Si le dossier interfaces.d n'existe pas, créez-le
nano /etc/network/interfaces.d/interface_ap
auto wlx503eaa3d7d6c iface wlx503eaa3d7d6c inet static hostapd /etc/hostapd/hostapd.conf address 192.168.0.254 netmask 255.255.255.0
Dans le fichier /etc/network/interfaces, veillez bien à avoir la ligne suivante :
source /etc/network/interfaces.d/*
Ce qui nous donne au final dans le fichier /etc/network/interfaces :
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet dhcp # This is an autoconfigured IPv6 interface iface eth0 inet6 auto
Redémarrez le service
service hostapd stop service hostapd start
De même pour l'interface wifi
ifup wlx503eaa3d7d6c
On va maintenant configurer le serveur DHCP.