Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Raspberry as a standolone Wi-Fi Access Point
- A reminder on how to configure a Raspberry Pi 3 (Debian Jessie) as a Wi-Fi Access Point
- ## Find the Raspberry Pi ethernet ip-address
- > Instructions for the macOS platform, little trick to find the raspberry pi ip-address while connected through ethernet.
- Connect the Raspberry Pi with an ethernet cable
- ```sh
- $ ifconfig
- ```
- Then look for the `bridge100` interface, and get the inet ipaddress (for me `192.168.2.1`).
- You can use nmap to scan for all ips and guess the raspberry pi one.
- ```sh
- $ brew install nmap
- $ nmap -n -sP 192.168.2.1/24
- ```
- ## Install the dependencies
- ```sh
- $ ssh pi@<ip-address>
- pi@raspberrypi:~ $ sudo apt-get install hostapd dnsmasq
- ```
- ## /etc/dhcpcd.conf
- Configure a static ip profile for the `wlan0` interface. In Debian Jessie, it's done in the `/etc/dhcpcd.conf` configuration file.
- ```sh
- pi@raspberrypi:~ $ cat <<EOT >> /etc/dhcpcd.conf
- # define static profile
- interface wlan0
- static ip_address=192.168.1.23/24
- static routers=192.168.1.1
- static domain_name_servers=192.168.1.1 8.8.8.8
- EOT
- ```
- ## /etc/dnsmasq.conf
- Configure the Dnsmasq service on the wlan0 interface
- ```sh
- pi@raspberrypi:~ $ sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
- pi@raspberrypi:~ $ sudo touch /etc/dnsmasq.conf
- pi@raspberrypi:~ $ sudo tee <<EOT /etc/dnsmasq.conf >/dev/null
- interface=wlan0
- domain-needed
- bogus-priv
- dhcp-range=192.168.1.24,192.168.1.250,12h
- EOT
- ```
- ## /etc/hostapd.conf
- ```sh
- pi@raspberrypi:~ $ sudo tee <<EOT /etc/hostadp/hostadp.conf >/dev/null
- # Interface Settings
- interface=wlan0
- driver=nl80211
- # Wifi AP Settings
- ssid=BlackHat
- wpa_passphrase=DontTryMe
- hw_mode=g
- channel=6
- ieee80211n=1
- # Encryption Settings
- auth_algs=1
- wpa=2
- wpa_key_mgmt=WPA-PSK
- wpa_pairwise=TKIP
- rsn_pairwise=CCMP
- # Accept all MAC addresses
- macaddr_acl=0
- # Require clients to know the network name
- #ignore_broadcast_ssid=0
- # Enable WMM (QoS)
- wmm_enabled=0
- EOT
- ```
- ## Forward ipv4 and ipv6
- ```sh
- pi@raspberrypi:~ $ sudo touch /etc/sysctl.d/50-hostapd.conf
- pi@raspberrypi:~ $ sudo tee <<EOT /etc/sysctl.d/50-hostapd.conf >/dev/null
- net.ipv4.ip_forward=1
- net.ipv6.conf.all.forwarding=1
- EOT
- ```
- ## Restart the services
- For an unknown reason (yet), restarting the services is not enough, you should reboot your Raspberry Pi in order to make it work with our new configuration.
- ```sh
- pi@raspberrypi:~ $ sudo reboot
- ```
- Then once it's up and running, you need to check if all services are loaded and running too.
- ```sh
- pi@raspberrypi:~ $ sudo systemctl status dhcpcd.service
- pi@raspberrypi:~ $ sudo systemctl status dnsmasq.service
- pi@raspberrypi:~ $ sudo systemctl status hostapd.service
- ```
Add Comment
Please, Sign In to add comment