Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
vmware:vsan:vsanlab [2019/11/17 16:13] – [PowerShell/PowerCLI auf dem Raspi] mschubivmware:vsan:vsanlab [2020/04/20 20:08] – [Raspi als WLAN Access Point und DHCP/DNS Server] mschubi
Line 8: Line 8:
 Bei mir hat es nur für 1GB gereicht... Bei mir hat es nur für 1GB gereicht...
  
-Um in der gesamten Infrastruktur DNS, DHCP u.s.w. zu haben, wird ein RaspberryPi eingesetzt. Der ist gleichzeitig WLAN Accesspoint, damit man einfach auf die Hosts etc. kommt. Gleichzeitig ist der RasPi auch WLAN Client, damit man einfach Pakete +Um in der gesamten Infrastruktur DNS, DHCP u.s.w. zu haben, wird ein RaspberryPi mit Raspian https://www.raspberrypi.org/downloads/raspbian/ eingesetzt. Der ist gleichzeitig WLAN Accesspoint, damit man einfach auf die Hosts etc. kommt. Gleichzeitig ist der RasPi auch WLAN Client, damit man einfach Pakete 
 aus dem Internet laden kann. aus dem Internet laden kann.
  
Line 31: Line 31:
 |**1**|RPI DS1307 RTC| z.B. AMAZON "MakerHawk RPI DS1307 RTC Modul Himbeer pi Echtzeituhrmodul mit Münzbatterie"| |**1**|RPI DS1307 RTC| z.B. AMAZON "MakerHawk RPI DS1307 RTC Modul Himbeer pi Echtzeituhrmodul mit Münzbatterie"|
  
 +Gehäuseteile als STL und OpenSCAD: {{ :vmware:vsan:vsan_stls.zip |}}
  
 ===== Raspi als WLAN Access Point und DHCP/DNS Server ===== ===== Raspi als WLAN Access Point und DHCP/DNS Server =====
Line 36: Line 37:
 Dieser sollte neben Ethernet auch gleichzeitig ein WLAN Access Point und ein WLAN Client sein. Dieser sollte neben Ethernet auch gleichzeitig ein WLAN Access Point und ein WLAN Client sein.
 Hier eine Config von mir. eth0 und wlan0 sind die DNS/DHCP Netze. wlan0 ist Accesspoint. wlan1 (Edimax mini) ist WLAN Client. Hier eine Config von mir. eth0 und wlan0 sind die DNS/DHCP Netze. wlan0 ist Accesspoint. wlan1 (Edimax mini) ist WLAN Client.
 +
 +Hostname und ssh Key ändern
 +<code bash>
 +raspi-config
 +reboot
 +#/etc/hosts
 +127.0.0.1       localhost
 +192.168.10.1    rasp-dns.schubi.local   rasp-dns
 +#
 +rm /etc/ssh/ssh_host_*
 +dpkg-reconfigure openssh-server
 +service ssh restart
 +#/etc/ssh/sshd_config
 +PermitRootLogin yes
 +PasswordAuthentication yes
 +#
 +touch /boot/ssh
 +</code>
  
 Wir brauchen einige Pakete.... Wir brauchen einige Pakete....
Line 110: Line 129:
 </code> </code>
  
 +Falls hostapd.service nicht startet (//hostapd.service is masked//)
 +
 +<code bash>
 +systemctl unmask hostapd
 +systemctl enable hostapd
 +systemctl start hostapd
 +</code>
  
 In der bash Shell wird die Bridge gebaut In der bash Shell wird die Bridge gebaut
Line 143: Line 169:
 wpa-ssid "iPhone von Schubi" wpa-ssid "iPhone von Schubi"
 wpa-psk "XXXXXXX" wpa-psk "XXXXXXX"
 +wireless-power off
 +###check mit iw wlan1 get power_save
 +</code>
 +
 +<code bash>
 +post-up iw dev wlan0 set power_save off
 +post-up iw dev wlan1 set power_save off
 </code> </code>
  
Line 148: Line 181:
 Durch das //iptables-persistent// Paket wird dies sofort persistent. Durch das //iptables-persistent// Paket wird dies sofort persistent.
 <code bash> <code bash>
 +sysctl -w net.ipv4.ip_forward=1
 +sysctl -w net.ipv4.conf.all.rp_filter=0
 +sysctl -p
 +
 iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
-iptables -t nat -L+iptables -t nat -L -v -n 
 +iptables-save > /etc/iptables/rules.v4
 </code> </code>
  
Line 352: Line 390:
 hwclock -w hwclock -w
 </code> </code>
 +
 +===== Lighttpd als Info Server =====
 +
 +Nur für die Lab Umgebung eine kurze Info Seite.
 +
 +<code bash>
 +
 +apt-get install lighttpd
 +vi /etc/lighttpd/lighttpd.conf
 +->
 +server.modules = (
 +        "mod_indexfile",
 +        "mod_access",
 +        "mod_alias",
 +        "mod_fastcgi",
 +        "mod_redirect",
 +)
 +
 +server.document-root        = "/var/www/html"
 +server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
 +server.errorlog             = "/var/log/lighttpd/error.log"
 +server.pid-file             = "/var/run/lighttpd.pid"
 +server.username             = "www-data"
 +server.groupname            = "www-data"
 +server.port                 = 11111
 +....
 +
 +fastcgi.server = ( ".php" => ((
 +                    "bin-path" => "/usr/bin/php-cgi",
 +                    "socket" => "/tmp/php.sock"
 +                )))
 +
 +<-
 +service lightttpd start
 +service lighttpd status
 +
 +apt-get install php php-cgi
 +</code>
 +
 +===== Samba einrichten =====
 +
 +<code bash>
 +apt-get install samba
 +mv /etc/samba/smb.conf /etc/samba/smb.orig
 +vi /etc/samba/smb.conf
 +
 +->
 +
 +[global]
 +workgroup = workgroup
 +security = user
 +map to guest = Bad Password
 +
 +[homes]
 +comment = Home Directories
 +browsable = no
 +read only = no
 +create mode = 0750
 +
 +[public]
 +path = /var/www/html 
 +public = yes
 +writable = yes
 +comment = www share
 +printable = no
 +guest ok = yes
 +
 +<-
 +
 +systemctl restart smbd.service
 +systemctl status smbd.service
 +</code>
 +
 +<code cmd>
 +net use W: \\rasp-dns\public
 +</code>
 +
 +===== XRDP =====
 +
 +<code bash>
 +apt-get install xrdp
 +</code>
 +
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International