From 818b4863c1047ce597a72943dc7b4d49b6f0e4dc Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 25 Aug 2014 10:21:35 +0200 Subject: Add 'dynamic-map' option --- scripts/vyos-update-nhrp.pl | 10 ++++++++++ .../protocols/nhrp/tunnel/node.tag/dynamic-map/node.def | 8 ++++++++ .../node.tag/dynamic-map/node.tag/nbma-domain-name/node.def | 5 +++++ 3 files changed, 23 insertions(+) create mode 100644 templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.def create mode 100644 templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.tag/nbma-domain-name/node.def diff --git a/scripts/vyos-update-nhrp.pl b/scripts/vyos-update-nhrp.pl index 5741eeb..de91173 100644 --- a/scripts/vyos-update-nhrp.pl +++ b/scripts/vyos-update-nhrp.pl @@ -193,6 +193,16 @@ sub tunnel_config { } push(@conf_file, "\n"); } + if ( $tunnel_Config->exists("$tunnel_ID dynamic-map")) { + $type = "#spoke"; + my @dynmaps = $tunnel_Config->listNodes("$tunnel_ID dynamic-map"); + my $dynmap = $dynmaps[0]; + push(@conf_file, " dynamic-map", " $dynmap"); + push(@conf_file, " ", $tunnel_Config->returnValue("$tunnel_ID dynamic-map $dynmap nbma-domain-name")); + shift(@conf_file); + unshift(@conf_file, "interface $tunnel_ID $type\n"); + push(@conf_file, "\n"); + } if ($tunnel_Config->returnValue("$tunnel_ID cisco-authentication") ne "") { push(@conf_file, " cisco-authentication ", $tunnel_Config->returnValue("$tunnel_ID cisco-authentication") , "\n"); } diff --git a/templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.def b/templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.def new file mode 100644 index 0000000..281b2d5 --- /dev/null +++ b/templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.def @@ -0,0 +1,8 @@ +tag: +type: ipv4net +help: Set an HUB tunnel address + +syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" + +comp_help:Possible completions: + Set the IP address and prefix length diff --git a/templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.tag/nbma-domain-name/node.def b/templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.tag/nbma-domain-name/node.def new file mode 100644 index 0000000..c9070a6 --- /dev/null +++ b/templates-cfg/protocols/nhrp/tunnel/node.tag/dynamic-map/node.tag/nbma-domain-name/node.def @@ -0,0 +1,5 @@ +type: txt +help: Set HUB fqdn (nbma-address - fqdn) [REQUIRED] + +comp_help:Possible completions: + Set the external HUB fqdn -- cgit v1.2.3