Ian Ko Homan - Emerging Technology Project Pi-Fi documentation.

Originally Submitted During The Emerging Technology Class with Jeff Sonnleitner in Spring 2019.

Please Note: This was posted after said class was finished for the semester as discussed and approved by Professor Jeff Sonnleitner who approved my Emerging Technology Class Project for posting for documentation reasons for interested community members and club members.

The Goal of the project is to turn a raspberry pi to turn the Raspberry Pi into Portable Travel Sized WiFi router with pi-hole (an adblocking server) along with built in VPN (Which provides security on the go). Great for hotel or for public housing use.

Set-up Raspian Put SD card in RPi Wait for boot Find IP address in router

SSH [email protected] NB might need to delete keystore but will tell you this sudo raspi-config change password option Interface options -> SSH enable permanent SSH

Update Raspian sudo apt-get update sudo apt-get dist-upgrade

sudo reboot

Set-up HostAPD in bridge mode https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

sudo apt-get install hostapd dnsmasq bridge-utils sudo systemctl stop dnsmasq sudo systemctl stop hostapd

sudo nano /etc/dhcpcd.conf add below lines to end of file but above any other interface lines denyinterfaces wlan0 denyinterfaces eth0 interface wlan0 static ip_address= interface br0 static ip_address= static routers= static domain_name_servers=

sudo brctl addbr br0 sudo brctl addif br0 eth0

sudo nano /etc/network/interfaces

Bridge setup

auto br0 iface br0 inet manual bridge_ports eth0 wlan0

sudo service dhcpcd restart

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

sudo nano /etc/dnsmasq.conf add below lines interface=wlan0 # Use the require wireless interface - usually wlan0 dhcp-range=,,,24h

sudo nano /etc/hostapd/hostapd.conf

country_code=US interface=wlan0 bridge=br0

driver=nl80211 ssid=hw_mode=g channel=7 wmm_enabled=1 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP hw_mode=a

N ieee80211n=1 require_ht=1 ht_capab=[MAX-AMSDU-3839][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]

AC ieee80211ac=1 require_vht=1 ieee80211d=0 ieee80211h=0 vht_capab=[MAX-AMSDU-3839][SHORT-GI-80] vht_oper_chwidth=1 channel=36 vht_oper_centr_freq_seg0_idx=42

sudo nano /etc/default/hostapd DAEMON_CONF="/etc/hostapd/hostapd.conf” sudo systemctl start hostapd sudo systemctl start dnsmasq sudo nano /etc/sysctl.conf uncomment below line net.ipv4.ip_forward=1 sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo su iptables-save > /etc/iptables.ipv4.nat exit sudo nano /etc/rc.local iptables-restore < /etc/iptables.ipv4.nat

sudo reboot

set-up pihole