diff options
author | higebu <yuya.kusakabe@gmail.com> | 2014-03-20 08:10:12 +0900 |
---|---|---|
committer | higebu <yuya.kusakabe@gmail.com> | 2014-03-20 08:10:12 +0900 |
commit | a9fd82114e9373a7b9a620a4a650bea20942807b (patch) | |
tree | 37fa0f294c3fdeb15c7eb9b7efd87d1dedf83520 /templates | |
parent | 189a8f7f3bb1ed5a8eb94010c212e4c4bfc25a42 (diff) | |
download | vyatta-cfg-system-a9fd82114e9373a7b9a620a4a650bea20942807b.tar.gz vyatta-cfg-system-a9fd82114e9373a7b9a620a4a650bea20942807b.zip |
Remove endpoint, and add mtu support
Diffstat (limited to 'templates')
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 |