diff options
author | Daniil Baturin <daniil@baturin.org> | 2014-03-24 04:16:00 -0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-03-24 04:16:00 -0700 |
commit | df793cfe0ffe587c1a24c50e24eca0acba2574d3 (patch) | |
tree | e59d4956ffde57eb52be78e5f7bf57b708b4484b | |
parent | 0faf71f7427935c815e88f1a036ee96251db3f91 (diff) | |
parent | a9fd82114e9373a7b9a620a4a650bea20942807b (diff) | |
download | vyatta-cfg-system-df793cfe0ffe587c1a24c50e24eca0acba2574d3.tar.gz vyatta-cfg-system-df793cfe0ffe587c1a24c50e24eca0acba2574d3.zip |
Merge pull request #6 from higebu/fix-support-for-l2tpv3
Fix support for l2tpv3
5 files changed, 14 insertions, 19 deletions
diff --git a/templates/interfaces/l2tpv3/node.def b/templates/interfaces/l2tpv3/node.def index 4ee4cc17..d609cb65 100644 --- a/templates/interfaces/l2tpv3/node.def +++ b/templates/interfaces/l2tpv3/node.def @@ -10,10 +10,6 @@ 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(./endpoint/local-ip/) != "" ; \ - "Must configure the l2tpv3 endpoint local-ip for $VAR(@)" -commit:expression: $VAR(./endpoint/remote-ip/) != "" ; \ - "Must configure the l2tpv3 endpoint remote-ip for $VAR(@)" commit:expression: $VAR(./tunnel-id/) != "" ; \ "Must configure the l2tpv3 tunnel-id for $VAR(@)" commit:expression: $VAR(./peer-tunnel-id/) != "" ; \ @@ -39,8 +35,6 @@ create: ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) peer_tunnel_id $VAR(./peer-tunnel-id/@) udp_sport $VAR(./sport/@) udp_dport $VAR(./dport/@) encap $VAR(./encap/@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) || echo "ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) peer_tunnel_id $VAR(./peer-tunnel-id/@) udp_sport $VAR(./sport/@) udp_dport $VAR(./dport/@) encap $VAR(./encap/@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@)" ip l2tp add session tunnel_id $VAR(./tunnel-id/@) session_id $VAR(./session-id/@) peer_session_id $VAR(./peer-session-id/@) || echo "ip l2tp add session tunnel_id $VAR(./tunnel-id/@) session_id $VAR(./session-id/@) peer_session_id $VAR(./peer-session-id/@)" - ip addr add $VAR(./endpoint/local-ip/@) peer $VAR(./endpoint/remote-ip/@) dev $VAR(@) || echo "ip addr add $VAR(./endpoint/local-ip/@) peer $VAR(./endpoint/remote-ip/@) dev $VAR(@)" - ip link set $VAR(@) up mtu 1500 delete: ip link set $VAR(@) down diff --git a/templates/interfaces/l2tpv3/node.tag/endpoint/local-ip/node.def b/templates/interfaces/l2tpv3/node.tag/endpoint/local-ip/node.def deleted file mode 100644 index f443d9ec..00000000 --- a/templates/interfaces/l2tpv3/node.tag/endpoint/local-ip/node.def +++ /dev/null @@ -1,6 +0,0 @@ -type: ipv4net, ipv6net -help: Endpoint IP address for this l2tpv3 [REQUIRED] -val_help: ipv4net; Endpoint IPv4 address for this l2tpv3 [REQUIRED] -val_help: ipv6net; Endpoint IPv6 address for this l2tpv3 [REQUIRED] - -syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" diff --git a/templates/interfaces/l2tpv3/node.tag/endpoint/node.def b/templates/interfaces/l2tpv3/node.tag/endpoint/node.def deleted file mode 100644 index d199b6f6..00000000 --- a/templates/interfaces/l2tpv3/node.tag/endpoint/node.def +++ /dev/null @@ -1 +0,0 @@ -help: l2tpv3 of Endpoint IP address diff --git a/templates/interfaces/l2tpv3/node.tag/endpoint/remote-ip/node.def b/templates/interfaces/l2tpv3/node.tag/endpoint/remote-ip/node.def deleted file mode 100644 index 6e1bcf80..00000000 --- a/templates/interfaces/l2tpv3/node.tag/endpoint/remote-ip/node.def +++ /dev/null @@ -1,6 +0,0 @@ -type: ipv4net, ipv6net -help: Peer Endpoint IP address for this l2tpv3 [REQUIRED] -val_help: ipv4net; Peer Endpoint IPv4 address for this l2tpv3 [REQUIRED] -val_help: ipv6net; Peer Endpoint IPv6 address for this l2tpv3 [REQUIRED] - -syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" diff --git a/templates/interfaces/l2tpv3/node.tag/mtu/node.def b/templates/interfaces/l2tpv3/node.tag/mtu/node.def new file mode 100644 index 00000000..57cbe3ad --- /dev/null +++ b/templates/interfaces/l2tpv3/node.tag/mtu/node.def @@ -0,0 +1,14 @@ +type: u32 +priority: 381 +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 + ip link set $VAR(../@) mtu $VAR(@) + fi +delete: + if [ -d /sys/class/net/$VAR(../@) ] ; then + ip link set $VAR(../@) mtu 1488 + fi |