technodogs:notebooks:worthing:pi:access:access_point
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
technodogs:notebooks:worthing:pi:access:access_point [2020/03/01 01:26] – [Start up the Services] worthing | technodogs:notebooks:worthing:pi:access:access_point [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== The pi as its own access point ===== | ||
- | ==== Overview ==== | ||
- | Configuring the pi this way has the benefit of never having to seek out its ip address. Just connect to the pi's network and you have access to the machine. | ||
- | * Connecting the PI loses your own internet access unless you bridge the pi to the local network | ||
- | * FRC robots are not allowed to have hot spots on them | ||
- | * Multiple PIs in the house will conflict unless you have a system for unique networks | ||
- | We are going to solve these cons later but lets just get the pi up and running as an access point. | ||
- | |||
- | ==== Install Necessary Services ==== | ||
- | sudo apt-get install dnsmasq | ||
- | sudo apt-get install hostapd | ||
- | |||
- | Make sure the new services are not running | ||
- | sudo systemctl stop dnsmasq | ||
- | sudo systemctl stop hostapd | ||
- | |||
- | ==== Configure Static IP with a 24 network ==== | ||
- | Now we pick a network that the PI will host. I am choosing 192.168.3.x as our network. | ||
- | |||
- | Now put the following at the end **/ | ||
- | interface wlan0 | ||
- | static ip_address=192.168.3.1/ | ||
- | |||
- | Restart dhcpcd | ||
- | sudo service dhcpcd restart | ||
- | |||
- | ==== Configure DHCP ==== | ||
- | sudo mv / | ||
- | sudo emacs / | ||
- | |||
- | and add the following | ||
- | interface=wlan0 | ||
- | dhcp-range=192.168.3.2, | ||
- | | ||
- | ==== Configure Wireless Access Point ==== | ||
- | |||
- | Edit | ||
- | sudo emacs / | ||
- | |||
- | and put | ||
- | interface=wlan0 | ||
- | driver=nl80211 | ||
- | ssid=raspberry | ||
- | hw_mode=g | ||
- | channel=7 | ||
- | wmm_enabled=0 | ||
- | macaddr_acl=0 | ||
- | auth_algs=1 | ||
- | ignore_broadcast_ssid=0 | ||
- | wpa=2 | ||
- | wpa_passphrase=robotfun | ||
- | wpa_key_mgmt=WPA-PSK | ||
- | wpa_pairwise=TKIP | ||
- | rsn_pairwise=CCMP | ||
- | | ||
- | Now edit | ||
- | sudo emacs / | ||
- | |||
- | and set **DAEMON_CONF="/ | ||
- | |||
- | ==== Start up the Services ==== | ||
- | sudo rfkill unblock 0 | ||
- | sudo systemctl unmask hostapd | ||
- | sudo systemctl enable hostapd | ||
- | sudo systemctl start hostapd | ||
- | sudo systemctl start dnsmasq | ||
- | |||
- | ==== Adjust Routing ==== | ||
- | First uncomment **net.ipv4.ip_forward=1** in / | ||
- | |||
- | ** Doing the below, but I dont like it. Need a solution that does not use rc.local ** | ||
- | |||
- | Add a masquerade and save it | ||
- | sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | ||
- | sudo sh -c " | ||
- | |||
- | add to rc.local | ||
- | | ||
- | iptables-restore < / |