summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-04-15 11:06:42 -0700
committerStig Thormodsrud <stig@vyatta.com>2008-04-15 11:06:42 -0700
commit43ad36dade936db85613914a9a852cc1a56409aa (patch)
tree13bfca2f7fdc00f696d10c36781123ad62e24f54 /scripts
parent6a6742a12c5412c50d6f1ad773e08a19d585cf96 (diff)
downloadvyatta-cfg-vpn-43ad36dade936db85613914a9a852cc1a56409aa.tar.gz
vyatta-cfg-vpn-43ad36dade936db85613914a9a852cc1a56409aa.zip
Fix 3046: vpn: transport mode not working with current vyatta config
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vpn-config.pl14
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index 925b234..b82ebfd 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -424,10 +424,6 @@ if ($vcVPN->exists('ipsec')) {
# Write tunnel configuration
#
my $leftsubnet = $vcVPN->returnValue("ipsec site-to-site peer $peer tunnel $tunnel local-subnet");
- if (!defined($leftsubnet) || $leftsubnet eq "") {
- $error = 1;
- print STDERR "VPN configuration error. No 'local-subnet' specified for peer \"$peer\" tunnel $tunnel.\n";
- }
if (defined($leftsubnet) && $leftsubnet eq 'any') {
$leftsubnet = '0.0.0.0/0';
}
@@ -462,10 +458,6 @@ if ($vcVPN->exists('ipsec')) {
$rightsubnet .= ",%no";
}
} else {
- if (!defined($remotesubnet) || $remotesubnet eq '') {
- $error = 1;
- print STDERR "VPN configuration error. The 'remote-subnet' has not been specified while 'allow-nat-networks' has not been enabled for peer \"$peer\" tunnel $tunnel. Either one required.\n";
- }
$rightsubnet = $remotesubnet;
if (defined($rightsubnet) && $rightsubnet eq 'any') {
$rightsubnet = '0.0.0.0/0';
@@ -615,6 +607,12 @@ if ($vcVPN->exists('ipsec')) {
if (!defined($espmode) || $espmode eq '') {
$espmode = "tunnel";
}
+ if ($espmode eq "transport") {
+ if (defined $leftsubnet or defined $rightsubnet) {
+ $error = 1;
+ print STDERR "VPN configuration error. Can not use local-subnet or remote-subnet when using transport mode\n";
+ }
+ }
$genout .= "\ttype=$espmode\n";
#