User Tools

Site Tools


raspberrypi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
raspberrypi [2018/12/06 21:05] – created 91.177.234.129raspberrypi [2020/04/04 17:11] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== RaspberryPi ====== 
  
-  * [[https://github.com/thibmaek/awesome-raspberry-pi|Lots of Raspberry Pi tips and tutorials - thibmaek on GitHub.com]] +  *  [[https://github.com/thibmaek/awesome-raspberry-pi|Lots of Raspberry Pi tips and tutorials - thibmaek on GitHub.com]] 
-  * [[https://github.com/wtsxDev/Raspberry-Pi|Lots of Raspberry Pi tips and tricks: NFS, SSH, VNC, DNS,... - wtsxDev on github.com]] +  *  [[https://github.com/wtsxDev/Raspberry-Pi|Lots of Raspberry Pi tips and tricks: NFS, SSH, VNC, DNS,... - wtsxDev on github.com]] 
-  * [[http://frederickvandenbosch.be/?p=2385|Good info on setting up a useful Raspbian microsd card right away - frederickvandenbosch.be]] +  *  [[http://frederickvandenbosch.be/?p=2385|Good info on setting up a useful Raspbian microsd card right away - frederickvandenbosch.be]] 
-=====Install Raspbian using img file=====+  * [[https://magpi.raspberrypi.org/articles/anpr-car-spy-raspberry-pi|Build an automatic number plate recognition(ANPR) system]] 
 +==== Install Raspbian using img file ====
 On a Mac, use Etcher and point it at the downloaded image file, or ... On a Mac, use Etcher and point it at the downloaded image file, or ...
-  * Format the SD card using SDCardFormatter +  *  Format the SD card using SDCardFormatter 
-  * Check where the SD card is mounted +  *  Check where the SD card is mounted 
-<code>0@@</code>+<code> 
 +mbpi7:.ssh stuart$ df -g 
 +Filesystem    1G-blocks Used Available Capacity   iused    ifree %iused  Mounted on 
 +/dev/disk0s2        237   47       189    21%  12608239 49696631   20%   / 
 +devfs                              100%       724        0  100%   /dev 
 +/dev/disk1s2        931  637       293    69% 167108601 76998065   68%   /Volumes/data 
 +map -hosts            0    0           100%                0  100%   /net 
 +map auto_home            0           100%                0  100%   /home 
 +/dev/disk2s1          3    0             1%                0  100%   /Volumes/UNTITLED 4 
 +</code>
 We see here it is mounted on /Volumes/UNTITLED 4 We see here it is mounted on /Volumes/UNTITLED 4
-  * Unmount the SD card using Disk Utility or +  *  Unmount the SD card using Disk Utility or 
-<code>1@@</code> +<code> 
-  * Copy the image file to the SD card +sudo umount /Volumes/UNTITLED\\ 4/ 
-<code>2@@</code>+</code> 
 +  *  Copy the image file to the SD card 
 +<code> 
 +sudo dd if=../Downloads/2014-01-07-wheezy-raspbian.img of=/dev/rdisk2 bs=1m 
 +</code>
  
-=====Backup your Raspberry Pi SD card to an image file===== +==== Backup your Raspberry Pi SD card to an image file ==== 
-After the OS is installed, up to date, upgraded and just how you want it, keep a copy to save time if it crashes<br />+After the OS is installed, up to date, upgraded and just how you want it, keep a copy to save time if it crashes\\
 First find out the name of the Pi's disk First find out the name of the Pi's disk
-<code>3@@</code>+<code> 
 +diskutil list 
 +</code>
 Do the copy Do the copy
-<code>4@@</code> +<code> 
-For the geeks, kill -29 makes dd report its status to stderr<br />+sudo dd bs=1m if=/dev/rdisk2 of=raspi_20140108.img 
 +</code> 
 +For the geeks, kill -29 makes dd report its status to stderr\\
  
-=====Enable remote SSH access=====+==== Enable remote SSH access ====
 Either: Either:
-  * mount the sd card on another computer and create an empty file named 'ssh' on the boot filesystem, or +  *  mount the sd card on another computer and create an empty file named 'ssh' on the boot filesystem, or 
-<code>5@@</code>+<code> 
 +sudo systemctl enable ssh 
 +sudo systemctl start ssh 
 +</code>
  
-=====How to install a Raspberry Pi SMS Server===== +==== How to install a Raspberry Pi SMS Server ==== 
-====Send text messages via a 3G GSM modem from your applications==== +=== Send text messages via a 3G GSM modem from your applications === 
-  * [[https://www.howtoforge.com/tutorial/how-to-install-raspberry-pi-sms-server/|How to install a Raspberry Pi SMS Server]] +  *  [[https://www.howtoforge.com/tutorial/how-to-install-raspberry-pi-sms-server/|How to install a Raspberry Pi SMS Server]] 
-  * [[https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/|Example of a 3G modem conversation]] +  *  [[https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/|Example of a 3G modem conversation]] 
-  * [[http://www.smssolutions.net/tutorials/gsm/sendsmsat/|Send SMS using AT commands]] +  *  [[http://www.smssolutions.net/tutorials/gsm/sendsmsat/|Send SMS using AT commands]] 
-====Use Pushbullet - no cost option==== +=== Use Pushbullet - no cost option === 
-  * [[https://docs.pushbullet.com/#api-quick-start|Pushbullet API]]+  *  [[https://docs.pushbullet.com/#api-quick-start|Pushbullet API]]
  
-=====Autoboot the wlan0 wireless lan interface on Raspberry Pi===== +==== Autoboot the wlan0 wireless lan interface on Raspberry Pi ==== 
-<code>6@@</code>+<code> 
 +root@raspberrypi:/# cat /etc/network/interfaces 
 +auto lo 
 + 
 +iface lo inet loopback 
 +iface eth0 inet dhcp 
 + 
 +  - allow-hotplug wlan0 
 +  - iface wlan0 inet manual 
 +  - wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf 
 +  - iface default inet dhcp 
 + 
 + 
 +auto wlan0 
 +allow-hotplug wlan0 
 +iface wlan0 inet dhcp 
 +wpa-ssid "<SSID>" 
 +wpa-psk "<PASSPHRASE>" 
 + 
 + 
 +iface default inet dhcp 
 +</code>
  
 or, for later versions... or, for later versions...
-<code>7@@</code> +<code> 
-<code>8@@</code>+vi /etc/network/interfaces 
 + 
 +allow-hotplug wlan0 
 +iface wlan0 inet manual 
 +    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf 
 +</code> 
 +<code> 
 +vi /etc/wpa_supplicant/wpa_supplicant.conf 
 + 
 +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 
 +network={ 
 +    ssid="YOUR_NETWORK_NAME" 
 +    psk="YOUR_PASSWORD" 
 +    key_mgmt=WPA-PSK 
 +
 +</code>
 or on later versions of Raspbian, with the card in your computer, place a file named wpa_supplicant.conf on the boot filesystem containing the WiFi network and it's password and you are done! or on later versions of Raspbian, with the card in your computer, place a file named wpa_supplicant.conf on the boot filesystem containing the WiFi network and it's password and you are done!
-<code>9@@</code>+<code> 
 +vi /boot/wpa_supplicant.conf 
 +</code>
 and put this info in it (adjust as necessary) and put this info in it (adjust as necessary)
-<code>10@@</code> +<code> 
-This file then gets copied at boot time to <tt>/etc/wpa_supplicant/wpa_supplicant.conf</tt><br /> +country=BE 
-or, if using RetroPie...<br />+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 
 +update_config=1 
 + 
 +network={ 
 +    ssid="<your_ssid>" 
 +    psk="<your_password>" 
 +    key_mgmt=WPA-PSK 
 +
 +</code> 
 +This file then gets copied at boot time to ''/etc/wpa_supplicant/wpa_supplicant.conf''\\ 
 +or, if using RetroPie...\\
 With the SD card in your computer, place a file named wifikeyfile.txt on the boot filesystem containing the WiFi network and it's password and you are done! With the SD card in your computer, place a file named wifikeyfile.txt on the boot filesystem containing the WiFi network and it's password and you are done!
-<code>11@@</code>+<code> 
 +vi /boot/wifikeyfile.txt 
 + 
 +ssid="WIFI SSID" 
 +psk="wifi passphrase" 
 +</code> 
 + 
 +==== Mount an NFS share ==== 
 +  *  Ready made tutorial [[http://www.kalitut.com/2017/11/mount-nfs-share.html|here]] 
 +==== What version of Raspbian do I have? ==== 
 +<code> 
 +lsb_release -a 
 +</code> 
 +or 
 +<code> 
 +cat /etc/apt/sources.list 
 +</code> 
 +==== Assign a fixed IP address (Stretch) ==== 
 +It is actually a lot simpler now to assign a fixed IP. As root, 
 +<code> 
 +vi /etc/dhcpcd.conf 
 +</code> 
 +Add this to the bottom of the file 
 +<code> 
 + 
 +interface eth0 
 +static ip_address=192.168.1.13/24 
 +static routers=192.168.1.1 
 +#static domain_name_servers=192.168.1.1 
 + 
 +</code> 
 +and restart.\\ 
 +Uncomment the domain_name_servers line if you don't want to use the dns server supplied by the gateway (router)
  
-=====Mount an NFS share===== +==== Assign a fixed IP address (to the wireless adapter in the case) ====
-  * Ready made tutorial [[http://www.kalitut.com/2017/11/mount-nfs-share.html|here]] +
-=====Assign a fixed IP address (to the wireless adapter in the case)=====+
 Get the current IP address and other info Get the current IP address and other info
-<code>12@@</code>+<code> 
 +ifconfig -a 
 +</code>
 We're interested in these bits: We're interested in these bits:
-<code>13@@</code>+<code> 
 +wlan0 
 +          inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0 
 + 
 +</code>
 Get the router/gateway address Get the router/gateway address
-<code>14@@</code>+<code> 
 +netstat -rn 
 +</code>
 We're interested in these bits: We're interested in these bits:
-<code>15@@</code>+<code> 
 +Kernel IP routing table 
 +Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface 
 +0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0 
 +</code>
 Now using the above data, edit /etc/network/interfaces and add the following lines to the wlan0 section (also changing the iface line to "static") Now using the above data, edit /etc/network/interfaces and add the following lines to the wlan0 section (also changing the iface line to "static")
-<code>16@@</code>+<code> 
 +address 192.168.1.100 
 +netmask 255.255.255.0 
 +network 192.168.1.0 
 +broadcast 192.168.1.255 
 +gateway 192.168.1.1 
 +</code>
 It should end up looking something like this: It should end up looking something like this:
-<code>17@@</code> +<code> 
-====Restart the networking daemon====+auto wlan0 
 +allow-hotplug wlan0 
 +iface wlan0 inet static 
 +address 192.168.1.100 
 +netmask 255.255.255.0 
 +network 192.168.1.0 
 +broadcast 192.168.1.255 
 +gateway 192.168.1.1 
 +wpa-ssid "<SSID>" 
 +wpa-psk "<PASSPHRASE>" 
 +</code> 
 +=== Restart the networking daemon ===
 (or reboot the Pi) (or reboot the Pi)
-<code>18@@</code>+<code> 
 +/etc/init.d/networking reload 
 +</code>
  
-=====Install an OpenVPN server===== +==== Install an OpenVPN server ==== 
-All operations as root<br /> +All operations as root\\ 
-====Get the Pi up-to-date==== +=== Get the Pi up-to-date === 
-<code>19@@</code> +<code> 
-====Install the packages==== +apt-get update 
-<code>20@@</code>+apt-get upgrade 
 +apt-get autoremove 
 +raspi-config  # set overclocking to Medium 
 +</code> 
 +=== Install the packages === 
 +<code> 
 +apt-get install openvpn openssl 
 +</code>
 and optionally this to be able to reach the server from the internet using names instead of numbers and optionally this to be able to reach the server from the internet using names instead of numbers
-<code>21@@</code>+<code> 
 +apt-get install ddclient 
 +</code>
 and maybe other useful stuff and maybe other useful stuff
-<code>22@@</code>+<code> 
 +apt-get install host shorewall telnet lighttpd 
 +</code>
  
-====Generate a copy of the easy-rsa structure==== +=== Generate a copy of the easy-rsa structure === 
-<code>23@@</code> +<code> 
-====Modify the easy-rsa location==== +cd /etc/openvpn 
-<code>24@@</code> +cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 ./easy-rsa 
-====Link correct binary==== +</code> 
-<code>25@@</code> +=== Modify the easy-rsa location === 
-====Generate certificate authority files==== +<code> 
-<code>26@@</code>+cd easy-rsa 
 +vi vars 
 +Change 
 +  - export EASY_RSA="`pwd`" 
 +export EASY_RSA="/etc/openvpn/easy-rsa" 
 +. ./vars 
 +./clean-all 
 +</code> 
 +=== Link correct binary === 
 +<code> 
 +ln -s openssl-1.0.0.cnf openssl.cnf 
 +</code> 
 +=== Generate certificate authority files === 
 +<code> 
 +./build-ca ca 
 +</code>
 This creates 4 files in the keys subdirectory... This creates 4 files in the keys subdirectory...
-<code>27@@</code>+<code> 
 +-rw-r--r-- 1 root root 1383 Feb  2 12:02 ca.crt 
 +-rw------- 1 root root  916 Feb  2 12:02 ca.key 
 +-rw-r--r-- 1 root root    0 Feb  2 12:02 index.txt 
 +-rw-r--r-- 1 root root    3 Feb  2 12:02 serial 
 +</code>
  
-====Generate the server key files====+=== Generate the server key files ===
 just hit ENTER for the password but sign and commit the certificate when asked just hit ENTER for the password but sign and commit the certificate when asked
-<code>28@@</code>+<code> 
 +./build-key-server home_server 
 +</code>
 keys subdirectory now looks like this keys subdirectory now looks like this
-<code>29@@</code>+<code> 
 +-rw-r--r-- 1 root root 4129 Feb  2 12:03 01.pem 
 +-rw-r--r-- 1 root root 1383 Feb  2 12:02 ca.crt 
 +-rw------- 1 root root  916 Feb  2 12:02 ca.key 
 +-rw-r--r-- 1 root root 4129 Feb  2 12:03 home_server.crt 
 +-rw-r--r-- 1 root root  737 Feb  2 12:03 home_server.csr 
 +-rw------- 1 root root  916 Feb  2 12:03 home_server.key 
 +-rw-r--r-- 1 root root  141 Feb  2 12:03 index.txt 
 +-rw-r--r-- 1 root root   21 Feb  2 12:03 index.txt.attr 
 +-rw-r--r-- 1 root root    0 Feb  2 12:02 index.txt.old 
 +-rw-r--r-- 1 root root    3 Feb  2 12:03 serial 
 +-rw-r--r-- 1 root root    3 Feb  2 12:02 serial.old 
 +</code>
  
-====Generate the client keys====+=== Generate the client keys ===
 just hit ENTER for the password but sign and commit the certificate when asked just hit ENTER for the password but sign and commit the certificate when asked
-<code>30@@</code>+<code> 
 +./build-key home_client1 
 +</code>
 keys subdirectory now looks like this keys subdirectory now looks like this
-<code>31@@</code>+<code> 
 +-rw-r--r-- 1 root root 4129 Feb  2 12:03 01.pem 
 +-rw-r--r-- 1 root root 4012 Feb  2 12:04 02.pem 
 +-rw-r--r-- 1 root root 1383 Feb  2 12:02 ca.crt 
 +-rw------- 1 root root  916 Feb  2 12:02 ca.key 
 +-rw-r--r-- 1 root root 4012 Feb  2 12:04 home_client1.crt 
 +-rw-r--r-- 1 root root  737 Feb  2 12:04 home_client1.csr 
 +-rw------- 1 root root  916 Feb  2 12:04 home_client1.key 
 +-rw-r--r-- 1 root root 4129 Feb  2 12:03 home_server.crt 
 +-rw-r--r-- 1 root root  737 Feb  2 12:03 home_server.csr 
 +-rw------- 1 root root  916 Feb  2 12:03 home_server.key 
 +-rw-r--r-- 1 root root  283 Feb  2 12:04 index.txt 
 +-rw-r--r-- 1 root root   21 Feb  2 12:04 index.txt.attr 
 +-rw-r--r-- 1 root root   21 Feb  2 12:03 index.txt.attr.old 
 +-rw-r--r-- 1 root root  141 Feb  2 12:03 index.txt.old 
 +-rw-r--r-- 1 root root    3 Feb  2 12:04 serial 
 +-rw-r--r-- 1 root root    3 Feb  2 12:03 serial.old 
 +</code>
  
-====Generate the Diffie-Hellman file==== +=== Generate the Diffie-Hellman file === 
-<code>32@@</code>+<code> 
 +./build-dh 
 +</code>
 This gives us one extra file This gives us one extra file
-<code>33@@</code>+<code> 
 +-rw-r--r-- 1 root root  245 Dec 24 13:40 dh1024.pem 
 +</code>
  
-====Build a server config file====+=== Build a server config file ===
 Copy from the examples directory... Copy from the examples directory...
-<code>34@@</code>+<code> 
 +cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/ 
 +gunzip /etc/openvpn/server.conf.gz 
 +</code>
 … or … or
-<code>35@@</code>+<code> 
 +cd .. 
 +vi server.conf 
 +</code>
 and paste this snippet: and paste this snippet:
-<code>36@@</code>+<code> 
 +dev tun 
 +proto udp 
 +port 1194 
 +ca /etc/openvpn/easy-rsa/keys/ca.crt 
 +cert /etc/openvpn/easy-rsa/keys/home_server.crt 
 +key /etc/openvpn/easy-rsa/keys/home_server.key 
 +dh /etc/openvpn/easy-rsa/keys/dh1024.pem 
 +server 10.8.0.0 255.255.255.0 
 +persist-key 
 +persist-tun 
 +status /var/log/openvpn-status.log 
 +verb 3 
 +push "redirect-gateway def1" 
 +push "dhcp-option DNS 8.8.8.8" 
 +push "dhcp-option DNS 8.8.4.4" 
 +log-append /var/log/openvpn 
 +comp-lzo 
 +</code>
  
-====Enable IP forwarding==== +=== Enable IP forwarding === 
-<code>37@@</code> +<code> 
-====Allow IP forwarding across reboots==== +echo 1 >/proc/sys/net/ipv4/ip_forward 
-<code>38@@</code>+</code> 
 +=== Allow IP forwarding across reboots === 
 +<code> 
 +vi /etc/sysctl.conf 
 +  -  Uncomment the next line to enable packet forwarding for IPv4 
 +net.ipv4.ip_forward=1 
 +</code>
 Activate the changes with Activate the changes with
-<code>39@@</code>+<code> 
 +sysctl -p 
 +</code>
  
-====Generate and export an OpenVPN client config file==== +=== Generate and export an OpenVPN client config file === 
-Use Tunnelblick (on a Mac) to generate a template client configuration file or copy/paste and modify this:<br /> +Use Tunnelblick (on a Mac) to generate a template client configuration file or copy/paste and modify this:\\ 
-If you use Viscosity, this is not necessary. You just need to fill in the blanks on its connection panel…<br />+If you use Viscosity, this is not necessary. You just need to fill in the blanks on its connection panel…\\
 In either case you need to know where you stored the files (ca.crt, home_client1.crt and home_client1.key) generated earlier. In either case you need to know where you stored the files (ca.crt, home_client1.crt and home_client1.key) generated earlier.
-<code>40@@</code>+<code> 
 +dev tun 
 +client 
 +proto udp 
 +  - remote 192.168.1.100 1194    # testing with lan address of Raspberry Pi 
 +remote <public ip address> 1194 
 +resolv-retry infinite 
 +nobind 
 +persist-key 
 +persist-tun 
 +ca ca.crt 
 +cert home_client1.crt 
 +key homeclient1.key 
 +comp-lzo 
 +verb 3 
 +</code>
  
-====Check IP address and interface name==== +=== Check IP address and interface name === 
-<code>41@@</code> +<code> 
-====Alter routing table to allow traffic to the server====+ifconfig -a 
 +</code> 
 +=== Alter routing table to allow traffic to the server ===
 Copy/paste this snippet: Copy/paste this snippet:
-assuming wired interface and the ip address of our Pi is 192.168.1.100<br /> +assuming wired interface and the ip address of our Pi is 192.168.1.100\\ 
-Some info on iptables might come in handy at this point. See references below...<br /> +Some info on iptables might come in handy at this point. See references below...\\ 
-<code>42@@</code> +<code> 
-<code>43@@</code>+vi /etc/iptables.rules 
 +</code> 
 +<code> 
 +  -  Generated by iptables-save v1.4.14 on Sun Feb  9 16:15:03 2014 
 +  * filter 
 +>INPUT ACCEPT [[121:9458]] 
 +>FORWARD ACCEPT [[0:0]] 
 +>OUTPUT ACCEPT [[261:42388]] 
 +-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
 +-A INPUT -p udp -m udp --dport 1194 -j ACCEPT 
 +-A INPUT -i eth0 -p udp -m udp --dport 1194 -j ACCEPT 
 +-A FORWARD -o eth0 -m state --state NEW -j ACCEPT 
 +-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT 
 +-A OUTPUT -o eth0 -m state --state NEW -j ACCEPT 
 +-A OUTPUT -o eth0 -p udp -m udp --dport 1194 -j ACCEPT 
 +COMMIT 
 +  -  Completed on Sun Feb  9 16:15:03 2014 
 +  -  Generated by iptables-save v1.4.14 on Sun Feb  9 16:15:03 2014 
 +  * nat 
 +>PREROUTING ACCEPT [[127:9041]] 
 +>INPUT ACCEPT [[97:6824]] 
 +>OUTPUT ACCEPT [[9:642]] 
 +>POSTROUTING ACCEPT [[9:642]] 
 +-A INPUT -i eth0 -p udp -m udp --dport 1194 -j ACCEPT 
 +-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 192.168.1.100 
 +COMMIT 
 +  -  Completed on Sun Feb  9 16:15:03 2014 
 +</code>
 then edit /etc/network/interfaces and add the following line just after "iface eth0 inet static" then edit /etc/network/interfaces and add the following line just after "iface eth0 inet static"
-<code>44@@</code> +<code> 
-====Start the server==== +pre-up iptables-restore < /etc/iptables.rules 
-<code>45@@</code> +</code> 
-Server is running, setup client.<br /> +=== Start the server === 
-  * Gotcha that caught me out several times…<br />+<code> 
 +/etc/init.d/openvpn start 
 +</code> 
 +Server is running, setup client.\\ 
 +  *  Gotcha that caught me out several times…\\
 If you change any of the iptables rules, you need to stop/start the OpenVPN server for it to take note of the new settings! If you change any of the iptables rules, you need to stop/start the OpenVPN server for it to take note of the new settings!
-<code>46@@</code>+<code> 
 +/etc/init.d/openvpn restart 
 +</code>
  
-====ddclient sample configuration file==== +=== ddclient sample configuration file === 
-Put this in /etc/ddclient.conf and modify it to taste<br />+Put this in /etc/ddclient.conf and modify it to taste\\
 I use dnsdynamic. If you don't, you'll need to change more than is indicated below I use dnsdynamic. If you don't, you'll need to change more than is indicated below
-<code>47@@</code>+<code> 
 +daemon=600                              # check every 10 minutess 
 +syslog=yes                              # log update msgs to syslog 
 +mail=root                               # mail all msgs to root 
 +mail-failure=root                       # mail failed update msgs to root 
 +pid=/var/run/ddclient.pid               # record PID in file. 
 +ssl=yes                                 # use ssl-support.  Works with ssl-library 
 +use=web, web=myip.dnsdynamic.com        # get ip from server. 
 +server=www.dnsdynamic.org               # default server 
 +login=[[your username here]]              # default login 
 +password=[[your password here]]           # default password 
 +server=www.dnsdynamic.org,              \\ 
 +protocol=dyndns2                        \\ 
 +[[your website here]] 
 +</code>
  
-=====iptables===== +==== iptables ==== 
-  * man iptables!+  *  man iptables!
 list open ports list open ports
-<code>48@@</code>+<code> 
 +netstat -tulpn 
 +</code>
 see if firewall is allowing access see if firewall is allowing access
-<code>49@@</code>+<code> 
 +telnet <ip address> <port> 
 +</code>
 list FILTER rules list FILTER rules
-<code>50@@</code>+<code> 
 +iptables -L -n -v 
 +</code>
 list NAT rules list NAT rules
-<code>51@@</code>+<code> 
 +iptables -L -t nat -n -v 
 +</code>
 list all rules in selected chain list all rules in selected chain
-<code>52@@</code>+<code> 
 +iptables -S -t nat -v 
 +</code>
 show all rules in a form to use for input show all rules in a form to use for input
-<code>53@@</code>+<code> 
 +iptables-save | tee /etc/iptables.rules 
 +</code>
 bring in those rules previously saved (does not overwrite the table - just adds these rules) bring in those rules previously saved (does not overwrite the table - just adds these rules)
-<code>54@@</code>+<code> 
 +iptables-restore < /etc/iptables.rules 
 +</code>
 show local routing table show local routing table
-<code>55@@</code>+<code> 
 +ip route show table local 
 +</code>
  
-======Install both Flightradar24 and FlightAware feeders on a headless Raspberry Pi (Stretch)====== +===== Install both Flightradar24 and FlightAware feeders on a headless Raspberry Pi (Stretch) ===== 
-Feed flight data up to flight services.<br /> +Feed flight data up to flight services.\\ 
-We can install both fr24feed and piaware and have them feeding at the same time.<br />+We can install both fr24feed and piaware and have them feeding at the same time.\\
 At the time of writing, the Pi 3b+ is out but FlightAware does not have an image that works on it yet. So we will install its package manually. At the time of writing, the Pi 3b+ is out but FlightAware does not have an image that works on it yet. So we will install its package manually.
-=====Steps===== +==== Steps ==== 
-====Install Raspbian==== +=== Install Raspbian === 
-  * Very well documented already (I like [[https://etcher.io|Etcher]] though for burning the images)+  *  Very well documented already (I like [[https://etcher.io|Etcher]] though for burning the images)
  
-====Prepare for initial boot====+=== Prepare for initial boot ===
 Before installing the microsd card in the Pi Before installing the microsd card in the Pi
-  * Enable the ssh server +  *  Enable the ssh server 
-<code>56@@</code> +<code> 
-  * Assign static (wired) IP address for initial boot +touch /boot/ssh 
-<code>57@@</code>+</code> 
 +  *  Assign static (wired) IP address for initial boot 
 +<code> 
 +vi /boot/cmdline.txt 
 +</code>
 Append this to the end of the line already there (modifying for your local network)... Append this to the end of the line already there (modifying for your local network)...
-<code>58@@</code>+<code> 
 + ip=192.168.1.12::192.168.1.1:255.255.255.0:rpi:eth0:off 
 +</code>
  
-====Initial boot====+=== Initial boot ===
 Put the microsd card in the Pi, plug in an ethernet cable and power it up.  Give it 20 seconds and login using the IP address above. Put the microsd card in the Pi, plug in an ethernet cable and power it up.  Give it 20 seconds and login using the IP address above.
-  * Login as pi/raspberry and change the password and hostname if required +  *  Login as pi/raspberry and change the password and hostname if required 
-<code>59@@</code> +<code> 
-  * Assign static IP address in correct place+sudo su - 
 +raspi-config 
 +</code> 
 +  *  Assign static IP address in correct place
 On Stretch, /etc/network/interfaces is no longer used On Stretch, /etc/network/interfaces is no longer used
-<code>60@@</code>+<code> 
 +vi /etc/dhcpcd.conf 
 + 
 +  -  Example static IP configuration: 
 +interface eth0 
 +static ip_address=192.168.1.12/24 
 +  - static ip6_address=fd51:42f8:caae:d92e::ff/64 
 +static routers=192.168.1.1 
 +static domain_name_servers=192.168.1.13 8.8.8.8 
 +</code>
 Remove the IP address added to <tt>/boot/cmdline.txt</tt> Remove the IP address added to <tt>/boot/cmdline.txt</tt>
-<code>61@@</code> +<code> 
-  * Install useful stuff +vi /boot/cmdline.txt 
-<code>62@@</code>+</code> 
 +  *  Install useful stuff 
 +<code> 
 +apt-get install -y dnsutils 
 +</code>
  
-  * Turn IPV6 off +  *  Turn IPV6 off 
-<code>63@@</code> +<code> 
-====Install the feeder packages==== +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 
-<code>64@@</code> +</code> 
-The web server of choice of both of these tools is lighttpd (good choice in my opinion) and it will be installed by whichever package is run first.<br />+=== Install the feeder packages === 
 +<code> 
 +apt-get update 
 +apt-get upgrade 
 +</code> 
 +The web server of choice of both of these tools is lighttpd (good choice in my opinion) and it will be installed by whichever package is run first.\\
 In order to get the local skyview website up on <tt><nowiki>http://<pi address>>8080</nowiki></tt>, piaware should be installed first. In order to get the local skyview website up on <tt><nowiki>http://<pi address>>8080</nowiki></tt>, piaware should be installed first.
-  * [[https://flightaware.com/adsb/piaware/install.rvt|Install FlightAware using the package method]] +  *  [[https://flightaware.com/adsb/piaware/install.rvt|Install FlightAware using the package method]] 
-At this point, PiAware is installed, dump1090-fa is installed and lighttpd is installed. Now the DVB-T dongle needs to be connected otherwise the dump1090 software won't startup successfully.<br /> +At this point, PiAware is installed, dump1090-fa is installed and lighttpd is installed. Now the DVB-T dongle needs to be connected otherwise the dump1090 software won't startup successfully.\\ 
-If this is a reinstall of the software, you will have lost your feeder identification and you will be uploading as a guest user.<br />+If this is a reinstall of the software, you will have lost your feeder identification and you will be uploading as a guest user.\\
 Get your feeder id from your login page on FlightAware. eg. [[https://flightaware.com/adsb/stats/user/rockingh0rse|flightaware.com/adsb/stats/user/rockingh0rse]] Put your feeder id back into PiAware's config file with this Get your feeder id from your login page on FlightAware. eg. [[https://flightaware.com/adsb/stats/user/rockingh0rse|flightaware.com/adsb/stats/user/rockingh0rse]] Put your feeder id back into PiAware's config file with this
-<code>65@@</code> +<code> 
-  * Reboot to initialise everything. +piaware-config feeder-id 12345678-1234-1234-1234-123456789abc 
-  * Log back in as root ( as pi, then <tt>sudo su - </tt>) and check the status of the components with +</code> 
-<code>66@@</code>+  *  Reboot to initialise everything. 
 +  *  Log back in as root ( as pi, then <tt>sudo su - </tt>) and check the status of the components with 
 +<code> 
 +systemctl status piaware 
 +</code>
 or or
-<code>67@@</code>+<code> 
 +piaware-status 
 +</code>
 If all is running ok, install FlightRadar24. This will detect that lighttpd and a version of dump1090 are already installed and will not overwrite them. If all is running ok, install FlightRadar24. This will detect that lighttpd and a version of dump1090 are already installed and will not overwrite them.
-  * [[https://forum.flightradar24.com/threads/8908-New-Flightradar24-feeding-software-for-Raspberry-Pie|FlightRadar24 install using a nice bash shell script]]+  *  [[https://forum.flightradar24.com/threads/8908-New-Flightradar24-feeding-software-for-Raspberry-Pie|FlightRadar24 install using a nice bash shell script]]
 If you want to look at the script, download it using If you want to look at the script, download it using
-<code>68@@</code> +<code> 
-If choosing to use MLAT, [[https://www.latlong.net|this is a good website to find your lat/long coordinates]]<br />+wget -O install_fr24_rpi.sh http://repo.feed.flightradar24.com/install_fr24_rpi.sh 
 +</code> 
 +If choosing to use MLAT, [[https://www.latlong.net|this is a good website to find your lat/long coordinates]]\\
 You will need these when the <tt>fr24feed --signup</tt> program runs (last part of the setup). It will also ask for a sharing key. This can be found in the Welcome mail Flightradar24 sent you! You will need these when the <tt>fr24feed --signup</tt> program runs (last part of the setup). It will also ask for a sharing key. This can be found in the Welcome mail Flightradar24 sent you!
 Check the status of the components with Check the status of the components with
-<code>69@@</code> +<code> 
-or <code>70@@</code>+systemctl status fr24feed 
 +</code> 
 +or <code> 
 +fr24feed-status 
 +</code>
 All done? Check out the aircraft you're capturing. Start a browser and go to port 8080 on the Raspberry Pi for snazzy PiAware stats All done? Check out the aircraft you're capturing. Start a browser and go to port 8080 on the Raspberry Pi for snazzy PiAware stats
-<code>71@@</code>+<code> 
 +http://192.168.1.12:8080 
 +</code>
 or port 8754 for less snazzy but equally informative stats for FlightRadar24 or port 8754 for less snazzy but equally informative stats for FlightRadar24
-<code>72@@</code>+<code> 
 +http://192.168.1.12:8754 
 +</code>
 Next step? Maybe interrogate the ACARS message system on board? Next step? Maybe interrogate the ACARS message system on board?
-  * [[http://www.satsignal.eu/raspberry-pi/acars-decoder.html|satsignal.eu]]+  *  [[http://www.satsignal.eu/raspberry-pi/acars-decoder.html|satsignal.eu]] 
 +==== GUIDE TO INSTALL RASPBERRY PI RADARBOX FEEDER ==== 
 +  * [[https://www.radarbox24.com/raspberry-pi/guide|How to install AirNav RadarBox]] 
 +===== References ===== 
 +  *  [[http://blog.remibergsma.com/2013/01/27/secure-browsing-via-untrusted-wifi-networks-using-openvpn-and-the-raspberry-pi/|http://blog.remibergsma.com/2013/01/27/secure-browsing-via-untrusted-wifi-networks-using-openvpn-and-the-raspberry-pi/]] 
 +  *  [[http://blog.remibergsma.com/2013/01/13/howto-connect-to-hosts-on-a-remote-network-using-openvpn-and-some-routing/|http://blog.remibergsma.com/2013/01/13/howto-connect-to-hosts-on-a-remote-network-using-openvpn-and-some-routing/]] 
 +  *  [[http://blog.remibergsma.com/2013/01/05/building-an-economical-openvpn-server-using-the-raspberry-pi/|http://blog.remibergsma.com/2013/01/05/building-an-economical-openvpn-server-using-the-raspberry-pi/]] 
 +  *  [[http://ivanx.com/raspberrypi/|http://ivanx.com/raspberrypi/]] 
 +  *  [[http://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian|http://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian (using dd for img file)]] 
 +  *  [[http://www.sans.org/reading-room/whitepapers/hsoffice/soho-remote-access-vpn-easy-pie-raspberry-pi-34427|http://www.sans.org/reading-room/whitepapers/hsoffice/soho-remote-access-vpn-easy-pie-raspberry-pi-34427]] 
 +  *  [[http://en.alexnogard.com/install-openvpn-raspberry-pi-wheezy-debian/|http://en.alexnogard.com/install-openvpn-raspberry-pi-wheezy-debian/]] 
 +  *  [[https://forums.openvpn.net/topic14286.html|https://forums.openvpn.net/topic14286.html]] 
 +  *  [[http://raspberrypi-hacks.com/29/turn-your-raspberry-into-an-openvpn-vpn-server/|http://raspberrypi-hacks.com/29/turn-your-raspberry-into-an-openvpn-vpn-server/]] 
 +  *  [[http://www.cyberciti.biz/tips/linux-iptables-examples.html|http://www.cyberciti.biz/tips/linux-iptables-examples.html]] 
 +  *  [[http://www.smallnetbuilder.com/security/security-howto/30353-how-to-set-up-a-site-to-site-vpn-with-openvpn|http://www.smallnetbuilder.com/security/security-howto/30353-how-to-set-up-a-site-to-site-vpn-with-openvpn]] 
 +  *  [[http://community.openvpn.net/openvpn/wiki/RoutedLans|http://community.openvpn.net/openvpn/wiki/RoutedLans]] 
 +  *  [[https://workaround.org/openvpn-faq|https://workaround.org/openvpn-faq]] 
 +  *  [[https://wiki.debian.org/iptables|https://wiki.debian.org/iptables]] 
 +  *  [[http://en.wikipedia.org/wiki/Iptables|http://en.wikipedia.org/wiki/Iptables]] 
 +  *  [[http://www.revsys.com/writings/quicktips/nat.html|http://www.revsys.com/writings/quicktips/nat.html]]
  
-======References====== 
-  * [[http://blog.remibergsma.com/2013/01/27/secure-browsing-via-untrusted-wifi-networks-using-openvpn-and-the-raspberry-pi/|http://blog.remibergsma.com/2013/01/27/secure-browsing-via-untrusted-wifi-networks-using-openvpn-and-the-raspberry-pi/]] 
-  * [[http://blog.remibergsma.com/2013/01/13/howto-connect-to-hosts-on-a-remote-network-using-openvpn-and-some-routing/|http://blog.remibergsma.com/2013/01/13/howto-connect-to-hosts-on-a-remote-network-using-openvpn-and-some-routing/]] 
-  * [[http://blog.remibergsma.com/2013/01/05/building-an-economical-openvpn-server-using-the-raspberry-pi/|http://blog.remibergsma.com/2013/01/05/building-an-economical-openvpn-server-using-the-raspberry-pi/]] 
-  * [[http://ivanx.com/raspberrypi/|http://ivanx.com/raspberrypi/]] 
-  * [[http://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian|http://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian (using dd for img file)]] 
-  * [[http://www.sans.org/reading-room/whitepapers/hsoffice/soho-remote-access-vpn-easy-pie-raspberry-pi-34427|http://www.sans.org/reading-room/whitepapers/hsoffice/soho-remote-access-vpn-easy-pie-raspberry-pi-34427]] 
-  * [[http://en.alexnogard.com/install-openvpn-raspberry-pi-wheezy-debian/|http://en.alexnogard.com/install-openvpn-raspberry-pi-wheezy-debian/]] 
-  * [[https://forums.openvpn.net/topic14286.html|https://forums.openvpn.net/topic14286.html]] 
-  * [[http://raspberrypi-hacks.com/29/turn-your-raspberry-into-an-openvpn-vpn-server/|http://raspberrypi-hacks.com/29/turn-your-raspberry-into-an-openvpn-vpn-server/]] 
-  * [[http://www.cyberciti.biz/tips/linux-iptables-examples.html|http://www.cyberciti.biz/tips/linux-iptables-examples.html]] 
-  * [[http://www.smallnetbuilder.com/security/security-howto/30353-how-to-set-up-a-site-to-site-vpn-with-openvpn|http://www.smallnetbuilder.com/security/security-howto/30353-how-to-set-up-a-site-to-site-vpn-with-openvpn]] 
-  * [[http://community.openvpn.net/openvpn/wiki/RoutedLans|http://community.openvpn.net/openvpn/wiki/RoutedLans]] 
-  * [[https://workaround.org/openvpn-faq|https://workaround.org/openvpn-faq]] 
-  * [[https://wiki.debian.org/iptables|https://wiki.debian.org/iptables]] 
-  * [[http://en.wikipedia.org/wiki/Iptables|http://en.wikipedia.org/wiki/Iptables]] 
-  * [[http://www.revsys.com/writings/quicktips/nat.html|http://www.revsys.com/writings/quicktips/nat.html]] 
raspberrypi.1544130327.txt.gz · Last modified: 2018/12/06 21:05 by 91.177.234.129

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki