mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add support for multiple VPN tunnels.
This commit is contained in:
parent
7ac955047f
commit
8902341086
2 changed files with 33 additions and 32 deletions
|
@ -47,37 +47,38 @@ module Fog
|
|||
|
||||
xml.GatewayIpsecVpnService {
|
||||
xml.IsEnabled vpn_config[:IsEnabled] if vpn_config.key?(:IsEnabled)
|
||||
tunnel_config = vpn_config[:Tunnel]
|
||||
xml.Tunnel {
|
||||
xml.Name tunnel_config[:Name]
|
||||
xml.Description tunnel_config[:Description]
|
||||
xml.IpsecVpnLocalPeer {
|
||||
xml.Id tunnel_config[:IpsecVpnLocalPeerId]
|
||||
xml.Name tunnel_config[:IpsecVpnLocalPeerName]
|
||||
}
|
||||
xml.PeerIpAddress tunnel_config[:PeerIpAddress]
|
||||
xml.PeerId tunnel_config[:PeerId]
|
||||
xml.LocalIpAddress tunnel_config[:LocalIpAddress]
|
||||
xml.LocalId tunnel_config[:LocalId]
|
||||
tunnel_config[:LocalSubnet].each do |subnet|
|
||||
xml.LocalSubnet {
|
||||
xml.Name subnet[:Name]
|
||||
xml.Gateway subnet[:Gateway]
|
||||
xml.Netmask subnet[:Netmask]
|
||||
vpn_config[:Tunnel].each do |tunnel_config|
|
||||
xml.Tunnel {
|
||||
xml.Name tunnel_config[:Name]
|
||||
xml.Description tunnel_config[:Description]
|
||||
xml.IpsecVpnLocalPeer {
|
||||
xml.Id tunnel_config[:IpsecVpnLocalPeerId]
|
||||
xml.Name tunnel_config[:IpsecVpnLocalPeerName]
|
||||
}
|
||||
end
|
||||
peer_subnet_config = tunnel_config[:PeerSubnet]
|
||||
xml.PeerSubnet {
|
||||
xml.Name peer_subnet_config[:Name]
|
||||
xml.Gateway peer_subnet_config[:Gateway]
|
||||
xml.Netmask peer_subnet_config[:Netmask]
|
||||
xml.PeerIpAddress tunnel_config[:PeerIpAddress]
|
||||
xml.PeerId tunnel_config[:PeerId]
|
||||
xml.LocalIpAddress tunnel_config[:LocalIpAddress]
|
||||
xml.LocalId tunnel_config[:LocalId]
|
||||
tunnel_config[:LocalSubnet].each do |subnet|
|
||||
xml.LocalSubnet {
|
||||
xml.Name subnet[:Name]
|
||||
xml.Gateway subnet[:Gateway]
|
||||
xml.Netmask subnet[:Netmask]
|
||||
}
|
||||
end
|
||||
peer_subnet_config = tunnel_config[:PeerSubnet]
|
||||
xml.PeerSubnet {
|
||||
xml.Name peer_subnet_config[:Name]
|
||||
xml.Gateway peer_subnet_config[:Gateway]
|
||||
xml.Netmask peer_subnet_config[:Netmask]
|
||||
}
|
||||
xml.SharedSecret tunnel_config[:SharedSecret]
|
||||
xml.SharedSecretEncrypted tunnel_config[:SharedSecretEncrypted] if tunnel_config.key?(:SharedSecretEncrypted)
|
||||
xml.EncryptionProtocol tunnel_config[:EncryptionProtocol]
|
||||
xml.Mtu tunnel_config[:Mtu]
|
||||
xml.IsEnabled tunnel_config[:IsEnabled]
|
||||
}
|
||||
xml.SharedSecret tunnel_config[:SharedSecret]
|
||||
xml.SharedSecretEncrypted tunnel_config[:SharedSecretEncrypted] if tunnel_config.key?(:SharedSecretEncrypted)
|
||||
xml.EncryptionProtocol tunnel_config[:EncryptionProtocol]
|
||||
xml.Mtu tunnel_config[:Mtu]
|
||||
xml.IsEnabled tunnel_config[:IsEnabled]
|
||||
}
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -217,7 +218,7 @@ module Fog
|
|||
|
||||
xml.Protocols {
|
||||
rule[:Protocols].each do |key, value|
|
||||
xml.send(key.to_s.capitalize, value)
|
||||
xml.send(key.to_s.capitalize, value)
|
||||
end
|
||||
}
|
||||
xml.IcmpSubType rule[:IcmpSubType] if rule.key?(:IcmpSubType)
|
||||
|
|
|
@ -20,7 +20,7 @@ Shindo.tests('Compute::VcloudDirector | edge gateway requests', ['vclouddirector
|
|||
:GatewayIpsecVpnService =>
|
||||
{
|
||||
:IsEnabled => "true",
|
||||
:Tunnel => {
|
||||
:Tunnel => [{
|
||||
:Name => "test vpn",
|
||||
:PeerIpAddress => "110.110.110.110",
|
||||
:PeerId => "1223-123UDH-12321",
|
||||
|
@ -41,7 +41,7 @@ Shindo.tests('Compute::VcloudDirector | edge gateway requests', ['vclouddirector
|
|||
:Gateway => "192.168.90.254",
|
||||
:Netmask => "255.255.255.0"
|
||||
}]
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue