Ouvrir :
/etc/apt/sources.list
Chercher :
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
Remplacer par :
deb http://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi
pi@photobooth:~ $ sudo apt-get update
pi@photobooth:~ $ sudo apt-get upgrade
pi@photobooth:~ $ sudo apt-get install mc vim
pi@photobooth:~ $ sudo apt-get remove minecraft-pi scratch wolfram-engine sonic-pi
pi@photobooth:~ $ sudo apt-get autoremove
pi@photobooth:~ $ sudo apt-get clean
pi@photobooth:~ $ ifconfig
...
wlan0: flags=4099<up,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:ea:a2:4c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
pi@photobooth:~ $
pi@photobooth:~ $ sudo apt-get install hostapd
pi@photobooth:~ $ sudo apt-get install dnsmasq
pi@photobooth:~ $ sudo systemctl stop hostapd
pi@photobooth:~ $ sudo systemctl stop dnsmasq
Ouvrir :
/etc/dhcpcd.conf
Ajouter à la fin :
interface wlan0
static ip_address=192.168.4.1/24
static routers=192.168.4.1
static domain_name_servers=8.8.8.8
pi@photobooth:~ $ sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
Ouvrir :
/etc/dnsmasq.conf
Ajouter :
interface=wlan0
domain-needed
bogus-priv
dhcp-range=192.168.4.8,192.168.4.250,12h
Ouvrir :
/etc/hostapd/hostapd.conf
Ajouter :
interface=wlan0
driver=nl80211
ssid=<nom du réseau sans-fil>
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=<mot de passe du réseau sans-fil>
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Ouvrir :
/etc/default/hostapd
Chercher :
#DAEMON_CONF=""
Remplacer par :
DAEMON_CONF="/etc/hostapd/hostapd.conf"
pi@photobooth:~ $ sudo service hostapd start
pi@photobooth:~ $ sudo service dnsmasq start
Ouvrir :
/etc/sysctl.conf
Chercher :
#net.ipv4.ip_forward=1
Remplacer par :
net.ipv4.ip_forward=1
pi@photobooth:~ $ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
pi@photobooth:~ $ sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
Ouvrir :
/etc/rc.local
Chercher :
exit 0
Ajouter avant :
iptables-restore < /etc/iptables.ipv4.nat
pi@photobooth:~ $ sudo reboot
A partir d'un autre ordinateur, se connecter au réseau sans-fil puis vérifier :
[~] ➔ ifconfig
...
wlan0 Link encap:Ethernet HWaddr 9c:ad:97:92:ed:43
inet adr:192.168.4.72 Bcast:192.168.4.255 Masque:255.255.255.0
adr inet6: fe80::9ead:97ff:fe92:ed43/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:187 erreurs:0 :0 overruns:0 frame:0
TX packets:182 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:16218 (16.2 KB) Octets transmis:20811 (20.8 KB)
[~] ➔
Ensuite se connecter en ssh :
[~] ➔ ssh pi@192.168.4.1
...
Last login: Sun Jun 3 12:01:23 2018
pi@photobooth:~ $
https://github.com/SurferTim/documentation/blob/6bc583965254fa292a470990c40b145f553f6b34/configuration/wireless/access-point.md http://www.mforge.org/fr/2017/11/26/creez-point-dacces/