summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-vti-config.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/vyatta-vti-config.pl b/scripts/vyatta-vti-config.pl
index 57fded4..cbbde32 100755
--- a/scripts/vyatta-vti-config.pl
+++ b/scripts/vyatta-vti-config.pl
@@ -123,6 +123,11 @@ if (@peers == 0) {
print STDERR "$vti_cfg_err Invalid local-address \"$lip\".\n";
exit -1;
}
+ # Check tunName is valid.
+ if (!defined($tunName) || $tunName eq "" || ! $vcIntf->exists("vti $tunName") ) {
+ print STDERR "$vti_cfg_err Invalid tunnel name vti \"$tunName\".\n";
+ exit -1;
+ }
# Check mark is valid.
if (!defined($mark)) {
print STDERR "$vti_cfg_err mark not defined.\n";
@@ -132,11 +137,6 @@ if (@peers == 0) {
print STDERR "$vti_cfg_err Invalid mark \"$mark\".\n";
exit -1;
}
- # Check tunName is valid.
- if (!defined($tunName) || $tunName eq "" || ! $vcIntf->exists("vti $tunName") ) {
- print STDERR "$vti_cfg_err Invalid tunnel name vti \"$tunName\".\n";
- exit -1;
- }
#
# Get the tunnel parameters.
#
@@ -156,8 +156,8 @@ if (@peers == 0) {
# Set the configuration into the output string.
#
# By default we delete the tunnel...
- $gencmds .= "sudo /sbin/ip link delete $tunName type vti &> /dev/null\n";
- $gencmds .= "sudo /sbin/ip link add $tunName type vti key $mark remote $peer local $lip\n";
+ $gencmds .= "sudo /sbin/ip link delete $tunName &> /dev/null\n";
+ $gencmds .= "sudo /opt/vyatta/sbin/cfgvti add name $tunName key $mark remote $peer local $lip\n";
foreach my $tunIP (@tunIPs) {
$gencmds .= "sudo /sbin/ip addr add $tunIP dev $tunName\n";
}