} else { ipsecPeerConfigBuilder.setSourceInterface(externalInterface.getName()); ipsecPeerConfigBuilder.setLocalAddress(localAddress);
ipsecStaticConfigBuilder.setLocalAddress(ikeGateway.getLocalAddress()); } else if (ikeGateway.getExternalInterface() != null && ikeGateway.getExternalInterface().getPrimaryAddress() != null) { ipsecStaticConfigBuilder.setLocalAddress( ikeGateway.getExternalInterface().getPrimaryAddress().getIp()); } else {
.setIpsecPolicy(vpnId) .setSourceInterface(externalInterfaceName) .setLocalAddress(ipsecTunnel.getVgwOutsideAddress()) .setDestinationAddress(ipsecTunnel.getCgwOutsideAddress()) .build());
_ipsecStaticPeerConfigBuilder .setSourceInterface("Test_interface") .setLocalAddress(Ip.parse("1.2.3.4")) .setTunnelInterface("Tunnel_interface"); _graph = ValueGraphBuilder.directed().allowsSelfLoops(false).build();
/** Converts a {@link Tunnel} to an {@link IpsecPeerConfig} */ static IpsecPeerConfig toIpsecPeerConfig( Tunnel tunnel, String tunnelIfaceName, CiscoConfiguration oldConfig, Configuration newConfig) { IpsecStaticPeerConfig.Builder ipsecStaticPeerConfigBuilder = IpsecStaticPeerConfig.builder() .setTunnelInterface(tunnelIfaceName) .setDestinationAddress(tunnel.getDestination()) .setLocalAddress(tunnel.getSourceAddress()) .setSourceInterface(tunnel.getSourceInterfaceName()) .setIpsecPolicy(tunnel.getIpsecProfileName()); IpsecProfile ipsecProfile = null; if (tunnel.getIpsecProfileName() != null) { ipsecProfile = oldConfig.getIpsecProfiles().get(tunnel.getIpsecProfileName()); } if (ipsecProfile != null && ipsecProfile.getIsakmpProfile() != null) { ipsecStaticPeerConfigBuilder.setIkePhase1Policy(ipsecProfile.getIsakmpProfile()); } else { ipsecStaticPeerConfigBuilder.setIkePhase1Policy( getIkePhase1Policy( newConfig.getIkePhase1Policies(), tunnel.getDestination(), tunnel.getSourceInterfaceName())); } return ipsecStaticPeerConfigBuilder.build(); }