3.5 KiB
3.5 KiB
RASPBERRY PI ALS MOBILE HOTSPOT MIT PROXYSERVER
Hardware
- Raspberry Pi Zero W
- 3G Stick Huawei E3533
INSTALLATION
Grundinstallation
Image: 2018-03-13-raspbian-stretch-lite.zip von https://www.raspberrypi.org/downloads/raspbian/
Installation auf SD:
# unzip -p 2018-03-13-raspbian-stretch-lite.zip |dd of=/dev/sdXXX bs=4M conv=fsync
# raspi-config
- Change User Password: heimetli27
- Hostname: proxypi
- enable predicatble network interface names
- locale: en_US.utf8 (auch Default)
- locale: de_CH.utf8
- Timezone: Europe/Zurich
- Change Wifi Country: CH
- Keyboard: Generic 105-key (Intl), German (Switzerland)
- Enable SSH Server
- WLAN einrichten (siehe "per WLAN")
- reboot
# apt-get update
# apt-get upgrade
reboot
# apt-get updat
Software installieren:
# apt-get install gammu python-gammu
# apt-get install python-serial
# apt-get install minicom
# apt-get install ppp
# apt-get install hostapd
# apt-get install ntpdate
# apt-get install dnsmasq
# apt-get install python-bottle
# apt-get install privoxy
reboot
Boot Config anpassen
in /boot/config.txt
dtparam=audio=off
# Disable Bluetooth
dtoverlay=pi3-disable-bt
# Disable the ACT LED on the Pi Zero.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on
In /boot/cmdline.txt folgendes anhaengen:
dwc_otg.speed=1
Bluetooth Dienste disablen:
systemctl disable hciuart.service
systemctl disable bluetooth.service
Zugang ermöglichen
# cat /etc/wpa_supplicant/wpa_supplicant.conf
country=CH
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="haerdoepfu27" psk="XXXXXXXXXXXX"
}
USB Stick E3533
Einrichten GSM:
/etc/usb_modeswitch.d/12d1:157d:
#Huawei E3533
TargetVendor=0x12d1
TargetProduct=0x1436
MessageContent="55534243123456780000000000000011063000000000010000000000000000"
Test SMS-Versand:
gammu sendsms TEXT 0765006123 -text "Halooo von beielipi"
Konfiguration privoxy
/etc/privoxy/config anpassen:
debug 512
listen-address 192.168.255.1:8118
in /etc/privoxy/user.action folgendes anfuegen (am Ende):
# Wir blockieren grundsaetzlich alles
{ +block{Adresse ist nicht erlaubt} }
/ # Block all URLs
# Jetzt kommt die Whitelist
{ -block }
www.nbit.ch/files/heartbeat.html
*.autodesk.com
js-agent.newrelic.com
bam.nr-data.net
urs.microsoft.com
ssl.google-analytics.com
smetrics.autodesk.com
nexus.ensighten.com
api.demandbase.com
munchkin.marketo.net
918-fod-433.mktoresp.com
*.symdb.com
*.symcb.com
*.ws.symantec.com
*.symcd.com
*.geotrust.com
*.pki.goog
*.verisign.com
*.ss2.us
*.digicert.com
crl.microsoft.com
gateway.bluesnap.com
nexus.ensighten.com
d1rvg4h59z7jah.cloudfront.net
Installation Applikation
# Aus Git uebernehmen:
(auf anderem Rechner):
$ git clone https://git.nbit.ch/joerg/proxypi.git
$ cd proxypi
$ tar cvf /var/tmp/proxypi-git-files.tar .
# cd /home/pi && tar xvf /var/tmp/proxypi-git-files.tar
# rm -rf /home/pi/.git
# chown -R root:root /home/pi/root-bin
# chown -R root:root /home/pi/web-root
# cd /home/pi/install-files
# for i in $(find . -type f); do echo cp $i /$i ; done
# for i in $(find . -type f); do if [ -f /$i ]; then cp -p /$i /$i.6apr2018; fi ; done
# for i in $(find . -type f); do cp $i /$i ; done
# systemctl enable my_web_server
# systemctl disable dhcpcd
# systemctl disable avahi-daemon
# systemctl disable triggerhappy
Cronjob einrichten:
/etc/cron.d/send_sms:
@reboot root sleep 30;/home/pi/root-bin/send_sms
Reboot:
# init 6