mirror of https://github.com/apache/cloudstack.git
Don't need to specify source NAT IP address and public VLAN tag in interface NAT mode.
This commit is contained in:
parent
536a93d16a
commit
58a09e00a7
|
|
@ -570,7 +570,7 @@ public class JuniperSrxResource implements ServerResource {
|
|||
String guestVlanSubnet = NetUtils.getCidrSubNet(guestVlanGateway, cidrSize);
|
||||
|
||||
Long publicVlanTag = null;
|
||||
if (!ip.getVlanId().equals("untagged")) {
|
||||
if (ip.getVlanId() != null && !ip.getVlanId().equals("untagged")) {
|
||||
try {
|
||||
publicVlanTag = Long.parseLong(ip.getVlanId());
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -324,15 +324,19 @@ public class JuniperSrxManagerImpl extends ExternalNetworkManagerImpl implements
|
|||
long guestVlanTag = Long.parseLong(network.getBroadcastUri().getHost());
|
||||
String guestVlanGateway = network.getGateway();
|
||||
String guestVlanCidr = network.getCidr();
|
||||
String sourceNatIpAddress = sourceNatIp.getAddress().addr();
|
||||
String sourceNatIpAddress = null;
|
||||
String publicVlanTag = null;
|
||||
|
||||
if (sourceNatIp != null) {
|
||||
sourceNatIpAddress = sourceNatIp.getAddress().addr();
|
||||
VlanVO publicVlan = _vlanDao.findById(sourceNatIp.getVlanId());
|
||||
publicVlanTag = publicVlan.getVlanTag();
|
||||
}
|
||||
|
||||
VlanVO publicVlan = _vlanDao.findById(sourceNatIp.getVlanId());
|
||||
String publicVlanTag = publicVlan.getVlanTag();
|
||||
|
||||
// Get network rate
|
||||
Integer networkRate = _networkMgr.getNetworkRate(network.getId(), null);
|
||||
|
||||
IpAddressTO ip = new IpAddressTO(account.getId(), sourceNatIpAddress, add, false, !sharedSourceNat, publicVlanTag, null, null, null, null, networkRate, sourceNatIp.isOneToOneNat());
|
||||
IpAddressTO ip = new IpAddressTO(account.getId(), sourceNatIpAddress, add, false, !sharedSourceNat, publicVlanTag, null, null, null, null, networkRate, false);
|
||||
IpAddressTO[] ips = new IpAddressTO[1];
|
||||
ips[0] = ip;
|
||||
IpAssocCommand cmd = new IpAssocCommand(ips);
|
||||
|
|
|
|||
Loading…
Reference in New Issue