summaryrefslogtreecommitdiff
path: root/templates/interfaces/l2tpv3/node.def
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/l2tpv3/node.def')
-rw-r--r--templates/interfaces/l2tpv3/node.def56
1 files changed, 0 insertions, 56 deletions
diff --git a/templates/interfaces/l2tpv3/node.def b/templates/interfaces/l2tpv3/node.def
deleted file mode 100644
index 6a1109b2..00000000
--- a/templates/interfaces/l2tpv3/node.def
+++ /dev/null
@@ -1,56 +0,0 @@
-tag:
-priority: 800
-type: txt
-help: L2TPv3 interface
-val_help: <l2tpethN>; L2TPv3 interface name
-syntax:expression: pattern $VAR(@) "^l2tpeth[0-9]+$" \
- ; "tunnel must be (l2tpeth0-l2tpeth999)"
-
-commit:expression: $VAR(./local-ip/) != "" ; \
- "Must configure the l2tpv3 local-ip for $VAR(@)"
-commit:expression: $VAR(./remote-ip/) != "" ; \
- "Must configure the l2tpv3 remote-ip for $VAR(@)"
-commit:expression: $VAR(./tunnel-id/) != "" ; \
- "Must configure the l2tpv3 tunnel-id for $VAR(@)"
-commit:expression: $VAR(./peer-tunnel-id/) != "" ; \
- "Must configure the l2tpv3 peer-tunnel-id for $VAR(@)"
-commit:expression: $VAR(./session-id/) != "" ; \
- "Must configure the l2tpv3 session-id for $VAR(@)"
-commit:expression: $VAR(./peer-session-id/) != "" ; \
- "Must configure the l2tpv3 peer-session-id for $VAR(@)"
-
-begin:
- [ -d /sys/module/l2tp_eth ] || sudo modprobe l2tp_eth
- [ -d /sys/module/l2tp_netlink ] || sudo modprobe l2tp_netlink
- if [ "$VAR(./encapsulation/@)" = "ip" ]; then
- if [ ! -d /sys/module/l2tp_ip ]; then
- sudo modprobe l2tp_ip
- fi
-
- if [ ! -d /sys/module/l2tp_ip6 ]; then
- sudo modprobe l2tp_ip6
- fi
- fi
-
-create:
- sudo ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) \
- peer_tunnel_id $VAR(./peer-tunnel-id/@) \
- udp_sport $VAR(./source-port/@) \
- udp_dport $VAR(./destination-port/@) \
- encap $VAR(./encapsulation/@) \
- local $VAR(./local-ip/@) \
- remote $VAR(./remote-ip/@)
- sudo ip l2tp add session session_id $VAR(./session-id/@) \
- tunnel_id $VAR(./tunnel-id/@) \
- peer_session_id $VAR(./peer-session-id/@) \
- name $VAR(@)
- sudo ip link set $VAR(@) up
-
-delete:
- sudo ip link set $VAR(@) down
- if [ -n "$VAR(./tunnel-id/@)" ] && [ -n "$VAR(./session-id/@)" ] ; then
- sudo ip l2tp del session tunnel_id $VAR(./tunnel-id/@) session_id $VAR(./session-id/@)
- fi
- if [ -n "$VAR(./tunnel-id/@)" ] ; then
- sudo ip l2tp del tunnel tunnel_id $VAR(./tunnel-id/@)
- fi