Skip to content

Commit 435a98c

Browse files
author
Michael Andersen
committed
Fix unable to setup more than one Site2Site VPN Connection
1 parent 230c9cf commit 435a98c

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

systemvm/patches/debian/config/opt/cloud/bin/configure.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,20 @@ def process(self):
462462
if m:
463463
self.confips.append(m.group(1))
464464

465-
for public_ip in self.dbag:
466-
if public_ip == "id":
465+
for vpn in self.dbag:
466+
if vpn == "id":
467467
continue
468-
dev = CsHelper.get_device(public_ip)
468+
469+
local_ip = self.dbag[vpn]['local_public_ip']
470+
dev = CsHelper.get_device(local_ip)
471+
469472
if dev == "":
470-
logging.error("Request for ipsec to %s not possible because ip is not configured", public_ip)
473+
logging.error("Request for ipsec to %s not possible because ip is not configured", local_ip)
471474
continue
475+
472476
CsHelper.start_if_stopped("ipsec")
473-
self.configure_iptables(dev, self.dbag[public_ip])
474-
self.configure_ipsec(self.dbag[public_ip])
477+
self.configure_iptables(dev, self.dbag[vpn])
478+
self.configure_ipsec(self.dbag[vpn])
475479

476480
# Delete vpns that are no longer in the configuration
477481
for ip in self.confips:

systemvm/patches/debian/config/opt/cloud/bin/cs_site2sitevpn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def merge(dbag, vpn):
22-
key = vpn['local_public_ip']
22+
key = vpn['peer_gateway_ip']
2323
op = vpn['create']
2424
if key in dbag.keys() and not op:
2525
del(dbag[key])

0 commit comments

Comments
 (0)