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
This commit is contained in:
Murali reddy 2012-01-25 17:58:49 +05:30
parent 52485a3fef
commit a3bbda8075
1 changed files with 5 additions and 2 deletions

View File

@ -459,6 +459,8 @@ public class NetscalerResource implements ServerResource {
newService.set_servername(nsServerName);
newService.set_state("ENABLED");
newService.set_servicetype(lbProtocol);
newService.set_usip("ON");
apiCallResult = com.citrix.netscaler.nitro.resource.config.basic.service.add(_netscalerService, newService);
if (apiCallResult.errorcode != 0) {
throw new ExecutionException("Failed to create service " + nsServiceName + " using server " + nsServerName + " due to" + apiCallResult.message);
@ -799,8 +801,8 @@ public class NetscalerResource implements ServerResource {
iNatRule.set_name(iNatRuleName);
iNatRule.set_publicip(srcIp);
iNatRule.set_privateip(dstIP);
iNatRule.set_usnip("ON");
iNatRule.set_usip("OFF");
iNatRule.set_usnip("OFF");
iNatRule.set_usip("ON");
try {
apiCallResult = inat.add(_netscalerService, iNatRule);
} catch (nitro_exception e) {
@ -821,6 +823,7 @@ public class NetscalerResource implements ServerResource {
s_logger.debug("Deleted Inat rule on the Netscaler device " + _ip + " to remove static NAT from " + srcIp + " to " + dstIP);
}
saveConfiguration();
results[i++] = "Static nat rule from " + srcIp + " to " + dstIP + " successfully " + (rule.revoked() ? " revoked.":" created.");
}
} catch (Exception e) {