Skip to content

Commit

Permalink
Fix unable to setup more than one Site2Site VPN Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Andersen committed Jan 12, 2016
1 parent 4aad57c commit d1e5230
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions systemvm/patches/debian/config/opt/cloud/bin/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,20 @@ def process(self):
if m:
self.confips.append(m.group(1))

for public_ip in self.dbag:
if public_ip == "id":
for vpn in self.dbag:
if vpn == "id":
continue
dev = CsHelper.get_device(public_ip)

local_ip = self.dbag[vpn]['local_public_ip']
dev = CsHelper.get_device(local_ip)

if dev == "":
logging.error("Request for ipsec to %s not possible because ip is not configured", public_ip)
logging.error("Request for ipsec to %s not possible because ip is not configured", local_ip)
continue

CsHelper.start_if_stopped("ipsec")
self.configure_iptables(dev, self.dbag[public_ip])
self.configure_ipsec(self.dbag[public_ip])
self.configure_iptables(dev, self.dbag[vpn])
self.configure_ipsec(self.dbag[vpn])

# Delete vpns that are no longer in the configuration
for ip in self.confips:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def merge(dbag, vpn):
key = vpn['local_public_ip']
key = vpn['peer_gateway_ip']
op = vpn['create']
if key in dbag.keys() and not op:
del(dbag[key])
Expand Down

0 comments on commit d1e5230

Please sign in to comment.