summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-05-29 09:12:39 -0700
committerDaniil Baturin <daniil@baturin.org>2014-05-29 09:12:39 -0700
commit9d556bd960086e60b997a60fd3a94499755d87c8 (patch)
tree2292a8101ff3babc772725f4787eeb2b0e73fbd1 /scripts
parentd152b56e4ea84a1bdcd79f2619bcd5d7dd7a0aff (diff)
parentf3131ceca70e295b455fc9dd9f97842339a84d26 (diff)
downloadvyatta-cfg-vpn-hydrogen.tar.gz
vyatta-cfg-vpn-hydrogen.zip
Merge pull request #7 from m-asama/hydrogen-ipv4idhydrogen
Add support for IPsec phase 1 ID of IPv4 address format
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vpn-config.pl24
1 files changed, 20 insertions, 4 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index 4870d48..bda6318 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -591,7 +591,13 @@ if ( $vcVPN->exists('ipsec') ) {
$genout .= "\tleft=$lip\n";
$leftsourceip = "\tleftsourceip=$lip\n";
}
- $genout .= "\tleftid=$authid\n" if defined $authid;
+ if ( defined($authid) ) {
+ if ( $authid =~ m/^\@/ ) {
+ $genout .= "\tleftid=\"$authid\"\n";
+ } else {
+ $genout .= "\tleftid=$authid\n";
+ }
+ }
}
# @SM Todo: must have explicit settings for VTI.
@@ -601,9 +607,13 @@ if ( $vcVPN->exists('ipsec') ) {
if ( $peer =~ /^\@/ ) {
# peer is an "ID"
- $rightid = $peer;
+ if ( defined($authremoteid) ) {
+ $rightid = $authremoteid;
+ } else {
+ $rightid = $peer;
+ }
$any_peer = 1;
- } elsif ($authremoteid) {
+ } elsif ( defined($authremoteid) ) {
$rightid = $authremoteid;
}
if ( ( $peer eq 'any' )
@@ -621,7 +631,13 @@ if ( $vcVPN->exists('ipsec') ) {
$right = $peer;
}
$genout .= "\tright=$right\n";
- $genout .= "\trightid=\"$rightid\"\n" if ( defined($rightid) );
+ if ( defined($rightid) ) {
+ if ( $rightid =~ m/^\@/ ) {
+ $genout .= "\trightid=\"$rightid\"\n";
+ } else {
+ $genout .= "\trightid=$rightid\n";
+ }
+ }
if ($any_peer) {
$genout .= "\trekey=no\n";
}