diff options
-rw-r--r-- | templates/interfaces/tunnel/node.def | 8 | ||||
-rw-r--r-- | templates/interfaces/tunnel/node.tag/6rd-prefix/node.def | 3 | ||||
-rw-r--r-- | templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def index c6e3b447..de5431a3 100644 --- a/templates/interfaces/tunnel/node.def +++ b/templates/interfaces/tunnel/node.def @@ -16,7 +16,13 @@ commit:expression: exec " if [ $VAR(./encapsulation/@) = gre ] && [ ! -n \"$VAR(./remote-ip/)\" ]; then \ echo \"No remote-ip configured for $VAR(@), tunnel can only be used for mGRE.\"; \ - fi; \ + fi; \ + if [ -n \"$VAR(./6rd-prefix/)\" ]; then \ + if [ $VAR(./encapsulation/@) != sit ]; then \ + echo \"6rd-prefix can only be set for SIT tunnels\"; \ + exit 1; \ + fi \ + fi; \ if [ $VAR(./encapsulation/@) != gre ] && [ ! -n \"$VAR(./remote-ip/)\" ]; then \ echo \"Must configure the tunnel remote-ip for $VAR(@)\"; \ exit 1; \ diff --git a/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def b/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def index 7e899d5d..c5f7f02c 100644 --- a/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def +++ b/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def @@ -1,9 +1,8 @@ -multi: type: ipv6net val_help: ipv6net; IPv6 address and prefix length help: 6rd network prefix -syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" +syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)" create:expression: "true" update:expression: "false" ; \ diff --git a/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def b/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def index 0f877e2d..224c3b7e 100644 --- a/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def +++ b/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def @@ -1,9 +1,8 @@ -multi: type: ipv4net val_help: ipv4net; IPv4 prefix of interface for 6rd help: 6rd relay prefix -syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" +syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)" create:expression: "true" update:expression: "false" ; \ |