Forum Discussion
Sharon_Lucas_55
Nimbostratus
Apr 28, 2010Problem creating a SNAT
Hi, we're using the F5's iControl SDK to create a Java application that automates configuring the F5 Proxy. Everything is working except for when we try to create a SNAT.
When using a web browser and the BIG-IP configuration utility GUI, we click on "Local Traffic", hover over "SNATs", and click on "Create". We specify a snat name of snat1, and in the Translation field, we click Automap and then click on Finished.
To automate this via Java, here's a snippet of our code. There is no exception raised when creating the SNAT, but the SNAT is not created. We have made sure that the SNAT does not exist -- in fact, no SNATs exist on our BIG-IP. But, it does not fail, but does not create the SNAT either. Please advise on what we're doing wrong.
String snatName = "snat1";
iControlLocalLBSNATBindingStub m_snat = (iControl.LocalLBSNATBindingStub)
new iControl.LocalLBSNATLocator().getLocalLBSNATPort(
new java.net.URL(m_endpoint));
// Removed the code we use to verify that the snat does not already exist
// Set translation_object to empty string since type is AutoMap
iControl.LocalLBSNATTranslation snat_translation =
new iControl.LocalLBSNATTranslation(
iControl.LocalLBSnatType.SNAT_TYPE_AUTOMAP, "");
iControl.LocalLBSNATSNATDefinition snat_definition =
new iControl.LocalLBSNATSNATDefinition(snat_name, snat_translation);
iContol LocalLBSNATSNATDefinition[] snats = { snat_definition };
// Specify null to indicate all addresses
// Specify null to indicate all VLANs
msnat.create(snats, null, null);
// Check if the SNAT was really created
snat_list = m_snat.get_list();
boolean snat_created = false;
for (int i = 0; i < snat_list.length; i++)
{
if (snat_list.equals(snat_name))
{
snat_created = true;
break;
}
}
if (!snat_created)
{
System.out.println("\nERROR: SNAT " + snat_name +
" was not created");
}
1 Reply
- Sharon_Lucas_55
Nimbostratus
I fiigured this out. Using the following code to set the original_addresses and vlans when creating the SNAT works.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects