Goals:
June 17, 2018 · View on GitHub
- Eliminate all hotplug/auto networking interfacing on bootup
- Get 2 RPI3 to talk to each other, one being the Outer Pi and one being the Inner Pi
- Outer Pi has access to the internet, inner pi can get access to the net through the Outer Pi
- helpful links
- (setting up wifi manually, node, etc) https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp
Outer Pi (access to the internet)
- (disable all AUTO network interfaces…we are manually configuring from here on out)
sudo update-rc.d dhcpcd disable
- put the below chunk in
/etc/rc.local
#Manually set up network interfaces since we disabled dhcp
ip link set eth0 up
ip addr add 10.66.66.1/24 dev eth0
#forward stuff to inside pi
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
#uncomment the below to connect to wifi
#ip link set wlan0 up
#wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
#dhclient -v wlan0
- Above, where you see 'uncomment the below to connect to wifi: when you do want to connect, well need to setup your ssid>
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf- put the below chunk in the wpa_supplicant.conf file:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid=“THE SSID“
psk=“THE PASSOWRD”
}
- this should be it for the outer pi. Now for the inner pi...
Inner Pi
- (disable all AUTO network interfaces…we are manually configuring from here on out)
sudo update-rc.d dhcpcd disable
- put the below chunk in
/etc/rc.local
ip link set eth0 up
ip addr add 10.66.66.2/24 dev eth0
ip route add default via 10.66.66.1