-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbgp-konzentrator-rc.sh
executable file
·44 lines (35 loc) · 1.34 KB
/
bgp-konzentrator-rc.sh
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
#!/bin/sh -e
# Diese Parameter muessen angepasst werden
KONZENTRATOR_NAME=${KONZENTRATOR_NAME:-xyzbackbone-1}
KONZENTRATOR_IPV6_NET=${KONZENTRATOR_IPV6_NET:-2a03:2260:xxxx:xxxx::/56}
FFRL_IFS=${FFRL_IFS:-"tun-ffrl-dus-a tun-ffrl-dus-b tun-ffrl-ber-a tun-ffrl-ber-b tun-ffrl-fra-a tun-ffrl-fra-b"}
#DBG=echo
##
## Ab hier muss nichts mehr angepasst werden
##
BASE=/opt/eulenfunk/konzentrator/konzentrator
${DBG} logger -t bpg-konz-rc "Start: BPG Konzentrator ${KONZENTRATOR_NAME} Setup"
# Alles was von iptables markiert wurde (siehe ferm.conf) landet in table 42
$DBG ip -4 rule add prio 1000 fwmark 0x1 table 42
$DBG ip -6 rule add prio 1000 fwmark 0x1 table 42
# Alles von den Backbone-Tunneln landet in table 42
for interface in $FFRL_IFS; do
$DBG ip -4 rule add prio 1001 iif $interface table 42
$DBG ip -6 rule add prio 1001 iif $interface table 42
done
# Autostart Supernode-Konfigs
for i in ${BASE}/config/*; do
. ${i}
if [ "${AUTOSTART}" -eq 1 ]; then
${BASE}/supernode.sh start $(basename $i)
else
logger -t bgp-konz-rc "Skipping ${i}: AUTOSTART!=1"
fi
done
${DBG} logger -t bgp-konz-rc "Loading conntrack module and call sysctl"
${DBG} modprobe nf_conntrack
${DBG} modprobe nf_conntrack_ipv4
${DBG} modprobe nf_conntrack_ipv6
${DBG} sysctl --system
${DBG} logger -t bpg-konz-rc "Ende: BPG Konzentrator ${KONZENTRATOR_NAME} Setup"
exit 0