summaryrefslogtreecommitdiff
path: root/templates/interfaces/l2tpv3
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-31 13:05:37 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-31 13:05:37 +0100
commitbb9885f898dcdc3a9e6d6465fb3e2138da8b1ebf (patch)
treef31a3cf0ee48a840256480797dff04e343513215 /templates/interfaces/l2tpv3
parentc7f7bb3e7182782cd904d5c2908f1fd08c0bb8e9 (diff)
downloadvyatta-cfg-system-bb9885f898dcdc3a9e6d6465fb3e2138da8b1ebf.tar.gz
vyatta-cfg-system-bb9885f898dcdc3a9e6d6465fb3e2138da8b1ebf.zip
l2tpv3: T1923: migrate to vyos-1x
Diffstat (limited to 'templates/interfaces/l2tpv3')
-rw-r--r--templates/interfaces/l2tpv3/node.def56
-rw-r--r--templates/interfaces/l2tpv3/node.tag/address/node.def12
-rw-r--r--templates/interfaces/l2tpv3/node.tag/description/node.def8
-rw-r--r--templates/interfaces/l2tpv3/node.tag/destination-port/node.def6
-rw-r--r--templates/interfaces/l2tpv3/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/l2tpv3/node.tag/encapsulation/node.def7
-rw-r--r--templates/interfaces/l2tpv3/node.tag/local-ip/node.def8
-rw-r--r--templates/interfaces/l2tpv3/node.tag/mtu/node.def14
-rw-r--r--templates/interfaces/l2tpv3/node.tag/peer-session-id/node.def5
-rw-r--r--templates/interfaces/l2tpv3/node.tag/peer-tunnel-id/node.def5
-rw-r--r--templates/interfaces/l2tpv3/node.tag/remote-ip/node.def4
-rw-r--r--templates/interfaces/l2tpv3/node.tag/session-id/node.def5
-rw-r--r--templates/interfaces/l2tpv3/node.tag/source-port/node.def6
-rw-r--r--templates/interfaces/l2tpv3/node.tag/tunnel-id/node.def5
14 files changed, 0 insertions, 145 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
diff --git a/templates/interfaces/l2tpv3/node.tag/address/node.def b/templates/interfaces/l2tpv3/node.tag/address/node.def
deleted file mode 100644
index 04612379..00000000
--- a/templates/interfaces/l2tpv3/node.tag/address/node.def
+++ /dev/null
@@ -1,12 +0,0 @@
-multi:
-type: ipv4net,ipv6net
-val_help: ipv4net; IPv4 address and prefix length
-val_help: ipv6net; IPv6 address and prefix length
-help: IP address
-
-syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)"
-
-create: sudo /opt/vyatta/sbin/vyatta-address add $VAR(../@) $VAR(@)
-
-delete: sudo /opt/vyatta/sbin/vyatta-address delete $VAR(../@) $VAR(@)
-
diff --git a/templates/interfaces/l2tpv3/node.tag/description/node.def b/templates/interfaces/l2tpv3/node.tag/description/node.def
deleted file mode 100644
index c6d2789d..00000000
--- a/templates/interfaces/l2tpv3/node.tag/description/node.def
+++ /dev/null
@@ -1,8 +0,0 @@
-type: txt
-help: Description
-
-syntax:expression: pattern $VAR(@) "^.{1,256}$" \
- ; "interface description is too long (limit 256 characters)"
-
-update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias"
-delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias"
diff --git a/templates/interfaces/l2tpv3/node.tag/destination-port/node.def b/templates/interfaces/l2tpv3/node.tag/destination-port/node.def
deleted file mode 100644
index 5f4d9435..00000000
--- a/templates/interfaces/l2tpv3/node.tag/destination-port/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-help: UDP destination port
-type: u32
-default: 5000
-syntax:expression: ($VAR(@) >= 1 && $VAR(@) <= 65535) ; "must between 1-65535"
-
-val_help: u32:1-65535; Numbered port
diff --git a/templates/interfaces/l2tpv3/node.tag/disable/node.def b/templates/interfaces/l2tpv3/node.tag/disable/node.def
deleted file mode 100644
index 8c580c95..00000000
--- a/templates/interfaces/l2tpv3/node.tag/disable/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-help: Disable interface
-update: sudo ip link set $VAR(../@) down
-
-delete: sudo ip link set $VAR(../@) up
diff --git a/templates/interfaces/l2tpv3/node.tag/encapsulation/node.def b/templates/interfaces/l2tpv3/node.tag/encapsulation/node.def
deleted file mode 100644
index 2bd8e63a..00000000
--- a/templates/interfaces/l2tpv3/node.tag/encapsulation/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-help: Encapsulation type
-type: txt
-default: "udp"
-syntax:expression: $VAR(@) in "ip", "udp"; "must be ip or udp"
-
-val_help: udp; UDP encapsulation (default)
-val_help: ip; IP encapsulation
diff --git a/templates/interfaces/l2tpv3/node.tag/local-ip/node.def b/templates/interfaces/l2tpv3/node.tag/local-ip/node.def
deleted file mode 100644
index 603f5066..00000000
--- a/templates/interfaces/l2tpv3/node.tag/local-ip/node.def
+++ /dev/null
@@ -1,8 +0,0 @@
-type: ipv4, ipv6
-help: Local IP address for this L2TPv3 tunnel [REQUIRED]
-val_help: ipv4; Local IPv4 address for this L2TPv3 [REQUIRED]
-val_help: ipv6; Local IPv6 address for this L2TPv3 [REQUIRED]
-
-syntax:expression: exec \
- "/opt/vyatta/sbin/local_ip $VAR(@) || \
- echo Warning! IP address $VAR(@) doesn\\'t exist on this system"
diff --git a/templates/interfaces/l2tpv3/node.tag/mtu/node.def b/templates/interfaces/l2tpv3/node.tag/mtu/node.def
deleted file mode 100644
index 71d2a12f..00000000
--- a/templates/interfaces/l2tpv3/node.tag/mtu/node.def
+++ /dev/null
@@ -1,14 +0,0 @@
-type: u32
-priority: 461
-help: Maximum Transmission Unit (MTU)
-syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "Must be between 68-9000"
-val_help: u32:68-9000; Maximum Transmission Unit (MTU)
-
-update:
- if [ -d /sys/class/net/$VAR(../@) ] ; then
- sudo ip link set $VAR(../@) mtu $VAR(@)
- fi
-delete:
- if [ -d /sys/class/net/$VAR(../@) ] ; then
- sudo ip link set $VAR(../@) mtu 1488
- fi
diff --git a/templates/interfaces/l2tpv3/node.tag/peer-session-id/node.def b/templates/interfaces/l2tpv3/node.tag/peer-session-id/node.def
deleted file mode 100644
index ca6d9c2e..00000000
--- a/templates/interfaces/l2tpv3/node.tag/peer-session-id/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-help: L2TPv3 peer session identifier [REQUIRED]
-type: u32
-
-syntax:expression: ($VAR(@) >= 1 && $VAR(@) <= 429496729) ; "must between 1-429496729"
-val_help: u32:1-429496729; L2TPv3 peer session identifier [REQUIRED]
diff --git a/templates/interfaces/l2tpv3/node.tag/peer-tunnel-id/node.def b/templates/interfaces/l2tpv3/node.tag/peer-tunnel-id/node.def
deleted file mode 100644
index d2913534..00000000
--- a/templates/interfaces/l2tpv3/node.tag/peer-tunnel-id/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-help: L2TPv3 peer tunnel identifier [REQUIRED]
-type: u32
-
-syntax:expression: ($VAR(@) >= 1 && $VAR(@) <= 429496729) ; "must between 1-429496729"
-val_help: u32:1-429496729; L2TPv3 peer tunnel identifier [REQUIRED]
diff --git a/templates/interfaces/l2tpv3/node.tag/remote-ip/node.def b/templates/interfaces/l2tpv3/node.tag/remote-ip/node.def
deleted file mode 100644
index 63397cd5..00000000
--- a/templates/interfaces/l2tpv3/node.tag/remote-ip/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: ipv4, ipv6
-help: Remote IP address for this L2TPv3 tunnel [REQUIRED]
-val_help: ipv4; Remote IPv4 address for this L2TPv3 [REQUIRED]
-val_help: ipv6; Remote IPv6 address for this L2TPv3 [REQUIRED]
diff --git a/templates/interfaces/l2tpv3/node.tag/session-id/node.def b/templates/interfaces/l2tpv3/node.tag/session-id/node.def
deleted file mode 100644
index 168af02f..00000000
--- a/templates/interfaces/l2tpv3/node.tag/session-id/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-help: L2TPv3 session identifier [REQUIRED]
-type: u32
-
-syntax:expression: ($VAR(@) >= 1 && $VAR(@) <= 429496729) ; "must between 1-429496729"
-val_help: u32:1-429496729; L2TPv3 session identifier [REQUIRED]
diff --git a/templates/interfaces/l2tpv3/node.tag/source-port/node.def b/templates/interfaces/l2tpv3/node.tag/source-port/node.def
deleted file mode 100644
index f0fdb66b..00000000
--- a/templates/interfaces/l2tpv3/node.tag/source-port/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-help: UDP source port
-type: u32
-default: 5000
-syntax:expression: ($VAR(@) >= 1 && $VAR(@) <= 65535) ; "must between 1-65535"
-
-val_help: u32:1-65535; Numbered port
diff --git a/templates/interfaces/l2tpv3/node.tag/tunnel-id/node.def b/templates/interfaces/l2tpv3/node.tag/tunnel-id/node.def
deleted file mode 100644
index 367e95fe..00000000
--- a/templates/interfaces/l2tpv3/node.tag/tunnel-id/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-help: L2TPv3 tunnel identifier [REQUIRED]
-type: u32
-
-syntax:expression: ($VAR(@) >= 1 && $VAR(@) <= 429496729) ; "must between 1-429496729"
-val_help: u32:1-429496729; L2TPv3 tunnel identifier