ansible.fftdf.supernode/files/l2tp_backbone.sh.exit.j2
2016-06-11 17:55:25 +02:00

30 lines
1.2 KiB
Django/Jinja

#!/bin/sh
# Version 9
sleep 60
batctl=/usr/local/sbin/batctl
ip=/sbin/ip
communitymacaddress="a2:8c:ae:6f:f6"
localserver=$(/bin/hostname)
communityname=troisdorf
# L2tp to Map
$ip l2tp add tunnel remote 138.201.70.103 local $(/bin/hostname -I | /usr/bin/cut -f1 -d' ') tunnel_id {{ sn_number }}0 peer_tunnel_id 0{{ sn_number }} encap udp udp_sport 300{{ sn_number }}0 udp_dport 3000{{ sn_number }}
$ip l2tp add session name l2tp-map tunnel_id {{ sn_number }}0 session_id 1{{ sn_number }}0 peer_session_id 2{{ sn_number }}0
$ip link set dev l2tp-map mtu 1312
$ip link set up l2tp-map
$batctl if add l2tp-map
# Rest Starten
$ip link set address $communitymacaddress:0${localserver#$communityname} dev bat0
$ip link set up dev bat0
$ip addr add {{ sn_mesh_IPv4 }}/19 broadcast {{ sn_mesh_IPv4_brcast }} dev bat0
$ip -6 addr add {{ sn_mesh_IPv6 }}/64 dev bat0
$ip route add 10.188.0.0/16 via {{ sn_mesh_IPv4_xfer }} table 42
$ip route add 10.188.0.0/16 via {{ sn_mesh_IPv4_xfer }}
$ip -6 route add 2a03:2260:121::/56 via {{ sn_mesh_IPv6_xfer }} table 42
$ip -6 route add 2a03:2260:121::/56 via {{ sn_mesh_IPv6_xfer }}
/usr/bin/killall batadv-vis
/bin/sleep 15
$batadv -i bat0 -s > /dev/null 2>&1 &