2016-01-09 18:50:44 +00:00
|
|
|
#!/bin/sh
|
2016-03-06 11:52:37 +00:00
|
|
|
# Version 1.91
|
2016-01-09 18:50:44 +00:00
|
|
|
|
|
|
|
curl -X POST --data-urlencode 'payload={"text": "{{ sn_hostname }} is rebooted", "channel": "#technik", "username": "{{ sn_hostname }}", "icon_emoji": ":floppy_disk:"}' https://hooks.slack.com/services/{{ slack_token }}
|
|
|
|
|
|
|
|
# Activate IP forwarding
|
|
|
|
/sbin/sysctl -w net.ipv6.conf.all.forwarding=1
|
|
|
|
/sbin/sysctl -w net.ipv4.ip_forward=1
|
|
|
|
|
|
|
|
# restart when kernel panic
|
|
|
|
/sbin/sysctl kernel.panic=1
|
|
|
|
|
|
|
|
# Routing table 42
|
|
|
|
/bin/grep 42 /etc/iproute2/rt_tables || /bin/echo 42 ffrl >> /etc/iproute2/rt_tables
|
|
|
|
|
|
|
|
# Set table for traffice with mark 4
|
|
|
|
/bin/ip rule add fwmark 0x4 table 42
|
|
|
|
/bin/ip -6 rule add fwmark 0x4 table 42
|
|
|
|
|
|
|
|
# Set mark 4 to Freifunk traffic
|
|
|
|
/sbin/iptables -t mangle -A PREROUTING -s 10.0.0.0/8 ! -d 10.0.0.0/8 -j MARK --set-mark 4
|
2016-05-17 21:50:08 +00:00
|
|
|
/sbin/ip6tables -t mangle -A PREROUTING -s 2a03:2260:121::/48 ! -d 2a03:2260:121::/48 -j MARK --set-mark 4
|
2016-01-09 18:50:44 +00:00
|
|
|
|
|
|
|
# All from FF IPv4 via routing table 42
|
|
|
|
/bin/ip rule add from {{ sn_ffrl_IPv4 }}/32 lookup 42
|
2016-05-17 21:50:08 +00:00
|
|
|
/bin/ip -6 rule add from {{ sn_mesh_IPv6_net }} lookup 42
|
2016-01-09 18:50:44 +00:00
|
|
|
|
|
|
|
# Allow MAC address spoofing
|
|
|
|
/sbin/sysctl net.ipv4.conf.bat0.rp_filter=0
|
|
|
|
|
2016-01-26 21:58:39 +00:00
|
|
|
# Create Tunneldigger Bridge
|
|
|
|
/sbin/brctl addbr br-nodes
|
2016-03-06 00:55:12 +00:00
|
|
|
/sbin/ip link set dev br-nodes up address 2E:9D:FA:A1:6B:0{{ sn_number }}
|
2016-01-26 21:58:39 +00:00
|
|
|
/sbin/ebtables -A FORWARD --logical-in br-nodes -j DROP
|
|
|
|
/usr/local/sbin/batctl if add br-nodes
|
|
|
|
|
2016-01-09 18:50:44 +00:00
|
|
|
sleep 5
|
2019-02-05 20:40:58 +00:00
|
|
|
/bin/systemctl restart radvd
|
|
|
|
/bin/systemctl retsrat tunneldigger
|
|
|
|
/bin/systemctl restart bird
|
|
|
|
/bin/systemctl restart bird6
|
|
|
|
/bin/systemctl restart isc-dhcp-server
|
2016-01-09 18:50:44 +00:00
|
|
|
exit 0
|