Skip to content

Commit a3bbda8

Browse files
Murali reddyMurali reddy
authored andcommitted
bug 13276: Static NAT on Elastic Ip does not respect the Ingress rules that are set on the VM
Reviewed-by:Prasanna.Santhanam@citrix.com This fix configures Inat and LB rules on the NetScaler device to send the source IP recived on the packets as is, so that security groups configured can take affect
1 parent 52485a3 commit a3bbda8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

core/src/com/cloud/network/resource/NetscalerResource.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ private synchronized Answer execute(LoadBalancerConfigCommand cmd, int numRetrie
459459
newService.set_servername(nsServerName);
460460
newService.set_state("ENABLED");
461461
newService.set_servicetype(lbProtocol);
462+
newService.set_usip("ON");
463+
462464
apiCallResult = com.citrix.netscaler.nitro.resource.config.basic.service.add(_netscalerService, newService);
463465
if (apiCallResult.errorcode != 0) {
464466
throw new ExecutionException("Failed to create service " + nsServiceName + " using server " + nsServerName + " due to" + apiCallResult.message);
@@ -799,8 +801,8 @@ private synchronized Answer execute(SetStaticNatRulesCommand cmd, int numRetries
799801
iNatRule.set_name(iNatRuleName);
800802
iNatRule.set_publicip(srcIp);
801803
iNatRule.set_privateip(dstIP);
802-
iNatRule.set_usnip("ON");
803-
iNatRule.set_usip("OFF");
804+
iNatRule.set_usnip("OFF");
805+
iNatRule.set_usip("ON");
804806
try {
805807
apiCallResult = inat.add(_netscalerService, iNatRule);
806808
} catch (nitro_exception e) {
@@ -821,6 +823,7 @@ private synchronized Answer execute(SetStaticNatRulesCommand cmd, int numRetries
821823
s_logger.debug("Deleted Inat rule on the Netscaler device " + _ip + " to remove static NAT from " + srcIp + " to " + dstIP);
822824
}
823825

826+
saveConfiguration();
824827
results[i++] = "Static nat rule from " + srcIp + " to " + dstIP + " successfully " + (rule.revoked() ? " revoked.":" created.");
825828
}
826829
} catch (Exception e) {

0 commit comments

Comments
 (0)