From 559d2cc19598269c3a294def0382bca05a2950ad Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Wed, 18 May 2016 00:36:33 +0200 Subject: [PATCH] Tunneldigger Backup Config --- files/l2tp_broker.cfg-backup.j2 | 51 +++++++++++++++++++++++++++++++ files/start-broker-backup.sh | 9 ++++++ files/tunneldigger-backup.service | 9 ++++++ 3 files changed, 69 insertions(+) create mode 100644 files/l2tp_broker.cfg-backup.j2 create mode 100644 files/start-broker-backup.sh create mode 100644 files/tunneldigger-backup.service diff --git a/files/l2tp_broker.cfg-backup.j2 b/files/l2tp_broker.cfg-backup.j2 new file mode 100644 index 0000000..debcd1d --- /dev/null +++ b/files/l2tp_broker.cfg-backup.j2 @@ -0,0 +1,51 @@ +[broker] +; IP address the broker will listen and accept tunnels on +address={{ ansible_default_ipv4.address }} +; Ports where the broker will listen on +port={{ sn_l2tp_tb_backup_port }} +; Interface with that IP address +interface=eth0 +; Maximum number of cached cookies, required for establishing a +; session with the broker +max_cookies=1024 +; Maximum number of tunnels that will be allowed by the broker +max_tunnels=150 +; Tunnel port base +port_base=25000 +; Tunnel id base +tunnel_id_base=500 +; Tunnel timeout interval in seconds +tunnel_timeout=60 +; Should PMTU discovery be enabled +pmtu_discovery=false +; Namespace (for running multiple brokers); note that you must also +; configure disjunct ports, and tunnel identifiers in order for +; namespacing to work +namespace=backup + +[log] +; Log filename +filename=/var/log/tunneldigger-broker-backup.log +; Verbosity +verbosity=DEBUG +; Should IP addresses be logged or not +log_ip_addresses=false + +[hooks] +; Arguments to the session.{up,pre-down,down} hooks are as follows: +; +; +; +; Arguments to the session.mtu-changed hook are as follows: +; +; +; + +; Called after the tunnel interface goes up +session.up=/srv/tunneldigger/bataddif.sh +; Called just before the tunnel interface goes down +session.pre-down=/srv/tunneldigger/batdelif.sh +; Called after the tunnel interface goes down +session.down= +; Called after the tunnel MTU gets changed because of PMTU discovery +session.mtu-changed= diff --git a/files/start-broker-backup.sh b/files/start-broker-backup.sh new file mode 100644 index 0000000..8f05c33 --- /dev/null +++ b/files/start-broker-backup.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +WDIR=/srv/tunneldigger +VIRTUALENV_DIR=/srv/tunneldigger + +cd $WDIR +source $VIRTUALENV_DIR/bin/activate + +bin/python broker/l2tp_broker.py l2tp_broker-backup.cfg diff --git a/files/tunneldigger-backup.service b/files/tunneldigger-backup.service new file mode 100644 index 0000000..afa351b --- /dev/null +++ b/files/tunneldigger-backup.service @@ -0,0 +1,9 @@ +[Unit] +Description = Start tunneldigger L2TPv3 broker +After = network.target + +[Service] +ExecStart = /srv/tunneldigger/start-broker-backup.sh + +[Install] +WantedBy = multi-user.target