forked from imaginator/home-network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emmauskirche.settings
190 lines (155 loc) · 6.43 KB
/
emmauskirche.settings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/bash
set -xe
# Setup a Nanobridge M5
imagifi2_nasid="000000000000" && [[ -e /sys/class/net/imagifi2/address ]] && imagifi2_nasid=$(cat /sys/class/net/imagifi2/address | tr -d \:)
imagifi2_r1_key_holder="000000000000" && [[ -e /sys/class/net/imagifi2/address ]] && imagifi2_r1_key_holder=$(cat /sys/class/net/imagifi2/address | tr -d \:)
freifunk_nasid="000000000000" && [[ -e /sys/class/net/freifunk/address ]] && freifunk_nasid=$(cat /sys/class/net/freifunk/address | tr -d \:)
freifunk_r1_key_holder="000000000000" && [[ -e /sys/class/net/freifunk/address ]] && freifunk_r1_key_holder=$(cat /sys/class/net/freifunk/address | tr -d \:)
ETH0MAC=$(cat /sys/class/net/eth0/address |sed 's/://g')
uci import system <<EOF
EOF
uci add system system
uci set system.@system[-1]=system
uci set system.@system[-1].hostname="emmausupink-$ETH0MAC"
uci set system.@system[-1].zonename='UTC'
uci set system.@system[-1].timezone='UTC'
uci set system.@system[-1].conloglevel='8'
uci set system.@system[-1].klogconloglevel='8'
uci set system.@system[-1].cronloglevel='0'
uci set system.@system[-1].log_size='128'
uci set system.@system[-1].log_buffer_size='64'
uci set system.@system[-1].log_ip='10.7.11.1'
uci set system.@system[-1].log_proto='tcp'
uci set system.@system[-1].log_remote='1'
uci add system ntp
uci set system.ntp=timeserver
uci set system.ntp.enabled=1
uci add_list system.ntp.server='0.de.pool.ntp.org'
uci add_list system.ntp.server='1.de.pool.ntp.org'
uci add_list system.ntp.server='2.de.pool.ntp.org'
uci commit system
uci add system led
uci set system.@led[-1]=led
uci set system.@led[-1].sysfs='ubnt:red:link1'
uci set system.@led[-1].trigger='netdev'
uci set system.@led[-1].name='imagifi2-rx'
uci set system.@led[-1].dev='imagifi2'
uci set system.@led[-1].mode='rx'
uci set system.@led[-1].default='0'
uci commit system.@led[-1]
uci add system led
uci set system.@led[-1]=led
uci set system.@led[-1].sysfs='ubnt:orange:link2'
uci set system.@led[-1].trigger='netdev'
uci set system.@led[-1].name='imagifi2-tx'
uci set system.@led[-1].dev='imagifi2'
uci set system.@led[-1].mode='tx'
uci set system.@led[-1].default='0'
uci commit system.@led[-1]
uci add system led
uci set system.@led[-1]=led
uci set system.@led[-1].sysfs='ubnt:green:link3'
uci set system.@led[-1].trigger='netdev'
uci set system.@led[-1].name='freifunk-rx'
uci set system.@led[-1].dev='freifunk'
uci set system.@led[-1].mode='rx'
uci set system.@led[-1].default='0'
uci commit system.@led[-1]
uci add system led
uci set system.@led[-1]=led
uci set system.@led[-1].sysfs='ubnt:green:link4'
uci set system.@led[-1].trigger='netdev'
uci set system.@led[-1].name='freifunk-tx'
uci set system.@led[-1].dev='freifunk'
uci set system.@led[-1].mode='tx'
uci set system.@led[-1].default='0'
uci commit system.@led[-1]
uci import dropbear <<EOF
EOF
uci add dropbear dropbear
uci set dropbear.@dropbear[-1]=dropbear
uci set dropbear.@dropbear[-1].Port='22'
uci set dropbear.@dropbear[-1].PasswordAuth='0'
uci set dropbear.@dropbear[-1].RootPasswordAuth='0'
uci commit dropbear
cat <<'EOF' > /etc/dropbear/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHwK3f7YB4qmDKgnZ6yKaQlLEdDAFaVbNREiE2gyHwSN simon@imaginator.com
EOF
chmod 0600 /etc/dropbear/authorized_keys
uci import wireless <<EOF
EOF
uci set wireless.radio0.channel='auto'
uci set wireless.radio0.country='DE'
uci set wireless.radio0.disabled='0'
uci set wireless.radio0.distance='734'
uci set wireless.radio0.htmode='HT40'
uci set wireless.radio0.legacy_rates='0'
uci set wireless.radio0.log_level=0 # 0=verbose
uci set wireless.radio0.type='mac80211'
uci set wireless.radio0=wifi-device
uci commit wireless.radio0
uci add wireless wifi-iface
uci set wireless.@wifi-iface[-1]=wifi-iface
uci set wireless.@wifi-iface[-1].device='radio0'
uci set wireless.@wifi-iface[-1].encryption='none'
uci set wireless.@wifi-iface[-1].ifname='ffuplink'
uci set wireless.@wifi-iface[-1].mode='sta'
uci set wireless.@wifi-iface[-1].network='wwan'
uci set wireless.@wifi-iface[-1].ssid='berlin.freifunk.net'
uci commit wireless.@wifi-iface[-1]
uci import network <<EOF
EOF
uci set network.loopback=interface
uci set network.loopback.ifname='lo'
uci set network.loopback.proto='static'
uci set network.loopback.ipaddr='127.0.0.1'
uci set network.loopback.netmask='255.0.0.0'
uci set network.trusted=interface
uci set network.trusted.type='bridge'
uci set network.trusted.igmp_snooping=1
uci add_list network.trusted.ifname='eth0.2'
uci set network.trusted.proto='dhcp'
uci set network.trusted6=interface
uci set network.trusted6.ifname='@trusted'
uci set network.trusted6.proto='dhcpv6'
uci set network.trusted6.reqprefix='no'
uci set network.notrust=interface
uci set network.notrust.type='bridge'
uci add_list network.notrust.ifname='eth0.3'
uci set network.notrust.proto='none'
uci set network.iot=interface
uci set network.iot.type='bridge'
uci add_list network.iot.ifname='eth0.5'
uci set network.iot.proto='none'
uci commit network
uci import firewall <<EOF
EOF
uci add firewall defaults
uci set firewall.@defaults[-1]=defaults
uci set firewall.@defaults[-1].input=ACCEPT
uci set firewall.@defaults[-1].output=ACCEPT
uci set firewall.@defaults[-1].forward=ACCEPT
uci set firewall.@defaults[-1].drop_invalid=0
uci commit firewall
/etc/init.d/firewall disable || true
# metrics
uci import prometheus-node-exporter-lua<<EOF
EOF
uci set prometheus-node-exporter-lua.main=prometheus-node-exporter-lua
uci set prometheus-node-exporter-lua.main.listen_address='0.0.0.0'
uci set prometheus-node-exporter-lua.main.listen_port='9100'
uci commit prometheus-node-exporter-lua
/etc/init.d/prometheus-node-exporter-lua enable || true
/etc/init.d/dnsmasq disable
echo "all done with writing"
echo "rebooting..."
reboot
uci add wireless wifi-iface # =cfg033579
uci del wireless.default_radio0
uci set wireless.@wifi-iface[-1].bssid='DA:9F:DB:1B:CE:8E'
uci set wireless.@wifi-iface[-1].device='radio0'
uci set wireless.@wifi-iface[-1].encryption='none'
uci set wireless.@wifi-iface[-1].ifname='ffuplink'
uci set wireless.@wifi-iface[-1].mode='sta'
uci set wireless.@wifi-iface[-1].network='wwan'
uci set wireless.@wifi-iface[-1].ssid='berlin.freifunk.net'