Skip to content

Commit 6c434b1

Browse files
committed
Import Version 101, Netzwerkadressen änderbar
1 parent eb4b1b8 commit 6c434b1

File tree

7 files changed

+49
-11
lines changed

7 files changed

+49
-11
lines changed

.defaults

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Masks are fixed /24 for IPv4 and /64 for IPv6
2+
IPv6HOST=fd00:24::1
3+
IPv6NET=fd00:24::
4+
IPv4HOST=192.168.24.1
5+
IPv4NET=192.168.24.0
6+
DHCPv4START=192.168.24.201
7+
DHCPv4END=192.168.24.251
8+
SSID=raspion
9+
10+
11+

files/hostapd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interface=wlan0
22
bridge=br0
3-
ssid=raspion
3+
ssid=#SSID#
44
country_code=DE
55
wpa=2
66
wpa_key_mgmt=WPA-PSK

files/interfaces

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
auto br0
22
iface br0 inet static
33
bridge_ports wlan0 eth1
4-
address 192.168.24.1
4+
address #IPv4HOST#
55
netmask 255.255.255.0
66

77
#iface br0 inet6 manual
88

99
iface br0 inet6 static
10-
address fd00:24::1
10+
address #IPv4HOST#
1111
netmask 64
1212

1313
allow-hotplug eth0

files/ntopng.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,5 @@
7272
-i=br0
7373
-l=1
7474
--community
75+
-m=#IPv4NET#/24
76+

files/radvd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface br0
66
DeprecatePrefix on;
77
AdvRouterAddr on;
88
};
9-
RDNSS fd00:24::1 {
9+
RDNSS #IPv6HOST# {
1010
AdvRDNSSLifetime 3600;
1111
};
1212
};

files/setupVars.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ DNS_BOGUS_PRIV=true
88
DNSSEC=false
99
CONDITIONAL_FORWARDING=false
1010
DHCP_ACTIVE=true
11-
DHCP_START=192.168.24.201
12-
DHCP_END=192.168.24.251
13-
DHCP_ROUTER=192.168.24.1
11+
DHCP_START=#DHCPv4START#
12+
DHCP_END=#DHCPv4END#
13+
DHCP_ROUTER=#IPv4HOST#
1414
DHCP_LEASETIME=24
1515
PIHOLE_DOMAIN=lan
1616
DHCP_IPv6=true
1717
DHCP_rapid_commit=false
1818
PIHOLE_INTERFACE=br0
19-
IPV4_ADDRESS=192.168.24.1/24
20-
IPV6_ADDRESS=fd00:24::1
19+
IPV4_ADDRESS=#IPv4HOST#/24
20+
IPV6_ADDRESS=#IPv6HOST#/64
2121
PIHOLE_DNS_1=8.8.8.8
2222
PIHOLE_DNS_2=8.8.4.4
2323
QUERY_LOGGING=true

install2.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set -e
1212
WD=$(pwd)
1313
LOG=/var/log/raspion.log
1414
source ./.version
15+
source ./.defaults
1516
sudo touch $LOG
1617
sudo chown pi:pi $LOG
1718

@@ -56,12 +57,17 @@ echo "* Softwaregrundkonfiguration ..." | tee -a $LOG
5657
sudo usermod -a -G wireshark pi >> $LOG 2>&1
5758
sudo usermod -a -G www-data pi >> $LOG 2>&1
5859
sudo cp $WD/files/ntopng.conf /etc/ntopng >> $LOG 2>&1
60+
sudo sed -i "s/^-m=#IPv4NET#/-m=$IPv4NET/" /etc/ntopng/ntopng.conf >> $LOG 2>&1
5961
sudo cp $WD/files/interfaces /etc/network >> $LOG 2>&1
62+
sudo sed -i "s/^ address #IPv4HOST#/ address $IPv4HOST/" /etc/network/interfaces >> $LOG 2>&1
63+
sudo sed -i "s/^ address #IPv6HOST#/ address $IPv6HOST/" /etc/network/interfaces >> $LOG 2>&1
6064
sudo cp $WD/files/hostapd.conf /etc/hostapd >> $LOG 2>&1
65+
sudo sed -i "s/^ssid=#SSID#/ssid=$SSID/" /etc/hostapd/hostapd.conf >> $LOG 2>&1
6166
sudo cp $WD/files/ipforward.conf /etc/sysctl.d >> $LOG 2>&1
6267
sudo cp $WD/files/hostname /etc/ >> $LOG 2>&1
6368
sudo cp $WD/files/raspion-sudo /etc/sudoers.d/ >> $LOG 2>&1
6469
sudo cp $WD/files/radvd.conf /etc/ >> $LOG 2>&1
70+
sudo sed -i "s/^ RDNSS #IPv6HOST#/ RDNSS $IPv6HOST/" /etc/radvd.conf >> $LOG 2>&1
6571
sudo mkdir -p /root/.mitmproxy >> $LOG 2>&1
6672
sudo cp $WD/files/config.yaml /root/.mitmproxy >> $LOG 2>&1
6773
mkdir -p /home/pi/.config/wireshark >> $LOG 2>&1
@@ -78,7 +84,7 @@ HERE
7884

7985
echo "* Firewall-Regeln setzen und speichern ..." | tee -a $LOG
8086
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE >> $LOG 2>&1
81-
sudo ip6tables -t nat -A POSTROUTING -o eth0 -s fd00:24::/64 -j MASQUERADE >> $LOG 2>&1
87+
sudo ip6tables -t nat -A POSTROUTING -o eth0 -s $IPv6NET/64 -j MASQUERADE >> $LOG 2>&1
8288
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 81 -i eth0 >> $LOG 2>&1
8389
sudo ip6tables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 81 -i eth0 >> $LOG 2>&1
8490
sudo netfilter-persistent save >> $LOG 2>&1
@@ -95,7 +101,21 @@ cd /etc/lighttpd/conf-enabled >> $LOG 2>&1
95101
sudo ln -sf ../conf-available/10-userdir.conf 10-userdir.conf >> $LOG 2>&1
96102
sudo ln -sf ../conf-available/10-proxy.conf 10-proxy.conf >> $LOG 2>&1
97103
sudo cp $WD/files/10-dir-listing.conf . >> $LOG 2>&1
98-
sudo cp $WD/files/20-extport.conf . >> $LOG 2>&1
104+
sudo -s <<HERE
105+
echo '\$SERVER["socket"] == ":81" {
106+
server.document-root = "/home/pi/public_html"
107+
dir-listing.encoding = "utf-8"
108+
\$HTTP["url"] =~ "^/caps(\$|/)" {
109+
dir-listing.activate = "enable"
110+
}
111+
\$HTTP["url"] =~ "^/scans(\$|/)" {
112+
dir-listing.activate = "enable"
113+
}
114+
\$HTTP["url"] =~ "^/admin" {
115+
proxy.server = ( "" => (( "host" => "'$IPv4HOST'", "port" => "80")) )
116+
}
117+
}' >> /etc/lighttpd/conf-enabled/20-extport.conf
118+
HERE
99119
sudo chmod g+s /home/pi/public_html/caps >> $LOG 2>&1
100120
sudo chmod 777 /home/pi/public_html/caps >> $LOG 2>&1
101121
sudo chgrp www-data /home/pi/public_html/caps >> $LOG 2>&1
@@ -107,6 +127,11 @@ fi
107127
sudo mkdir -p /etc/pihole >> $LOG 2>&1
108128
sudo chown pihole:pihole /etc/pihole >> $LOG 2>&1
109129
sudo cp $WD/files/setupVars.conf /etc/pihole >> $LOG 2>&1
130+
sudo sed -i "s/IPV4_ADDRESS=#IPv4HOST#/IPV4_ADDRESS=$IPv4HOST/" /etc/pihole/setupVars.conf >> $LOG 2>&1
131+
sudo sed -i "s/IPV6_ADDRESS=#IPv6HOST#/IPV6_ADDRESS=$IPv6HOST/" /etc/pihole/setupVars.conf >> $LOG 2>&1
132+
sudo sed -i "s/DHCP_ROUTER=#IPv4HOST#/DHCP_ROUTER=$IPv4HOST/" /etc/pihole/setupVars.conf >> $LOG 2>&1
133+
sudo sed -i "s/DHCP_START=#DHCPv4START#/DHCP_START=$DHCPv4START/" /etc/pihole/setupVars.conf >> $LOG 2>&1
134+
sudo sed -i "s/DHCP_END=#DHCPv4END#/DHCP_END=$DHCPv4END/" /etc/pihole/setupVars.conf >> $LOG 2>&1
110135
sudo -s <<HERE
111136
curl -sSL https://install.pi-hole.net | bash /dev/stdin --unattended >> $LOG 2>&1
112137
HERE

0 commit comments

Comments
 (0)