summaryrefslogtreecommitdiff
path: root/scripts/vyatta-vti-config.pl
diff options
context:
space:
mode:
authorSaurabh Mohan <saurabh.mohan@vyatta.com>2012-07-16 14:09:32 -0700
committerSaurabh Mohan <saurabh.mohan@vyatta.com>2012-07-16 14:09:32 -0700
commitf6bf877bf5a90c342dcc8f4ce6a2fdd5e597c4d7 (patch)
treecfd60add63211102af43d76d1b698e046db88cf0 /scripts/vyatta-vti-config.pl
parente353a74f6206c818de93f0ee8c3549c06e223c96 (diff)
downloadvyatta-cfg-vpn-f6bf877bf5a90c342dcc8f4ce6a2fdd5e597c4d7.tar.gz
vyatta-cfg-vpn-f6bf877bf5a90c342dcc8f4ce6a2fdd5e597c4d7.zip
Workaround to setup vti ko and cleaner error message.
Diffstat (limited to 'scripts/vyatta-vti-config.pl')
-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";
}