Skip to content

Commit 5fdc77e

Browse files
committed
Merge pull request #1276 from michaelandersen/fix/site2sitevpn
[4.7] FIX Site2SiteVPN on redundant VPCThis PR: - fixes the inability to setup more than one Site2Site VPN connection from a VPC - fixes starting of Site2Site VPN on redundant VPC - fixes Site2Site VPN state checking on redundant VPC - improves the vpc_vpn test to allow multple hypervisors - adds an integration test for Site2Site VPN on redundant VPC Tested it on 4.7 single Xen server zone: command: ``` nosetests --with-marvin --marvin-config=/data/shared/marvin/mct-zone1-xen1.cfg -a tags=advanced,required_hardware=true /tmp/test_vpc_vpn.py ``` results: ``` Test Site 2 Site VPN Across redundant VPCs ... === TestName: test_01_redundant_vpc_site2site_vpn | Status : SUCCESS === ok Test Remote Access VPN in VPC ... === TestName: test_01_vpc_remote_access_vpn | Status : SUCCESS === ok Test Site 2 Site VPN Across VPCs ... === TestName: test_01_vpc_site2site_vpn | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 3 tests in 1490.076s OK ``` also performed numerous manual inspections of state of VPN connections and connectivity between VPC's * pr/1276: Fix unable to setup more than one Site2Site VPN Connection FIX S2S VPN rVPC: Check only redundant routers in state MASTER PEP8 of integration/smoke/test_vpc_vpn Add S2S VPN test for Redundant VPC Make integration/smoke/test_vpc_vpn Hypervisor independant FIX VPN: non-working ipsec commands Signed-off-by: Remi Bergsma <github@remi.nl>
2 parents 450db8c + 435a98c commit 5fdc77e

File tree

4 files changed

+505
-55
lines changed

4 files changed

+505
-55
lines changed

server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,9 @@ protected void updateSite2SiteVpnConnectionState(final List<DomainRouterVO> rout
907907
if (conns == null || conns.isEmpty()) {
908908
continue;
909909
}
910+
if (router.getIsRedundantRouter() && router.getRedundantState() != RedundantState.MASTER){
911+
continue;
912+
}
910913
if (router.getState() != VirtualMachine.State.Running) {
911914
for (final Site2SiteVpnConnectionVO conn : conns) {
912915
if (conn.getState() != Site2SiteVpnConnection.State.Error) {

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)