Forum Discussion
Create snat failed using rest api
Resquest - $1 payload-
{
"items": [
{
"name": "Test",
"partition": "Common",
"fullPath": "/Common/Test",
"autoLasthop": "enabled",
"mirror": "disabled",
"sourcePort": "preserve",
"translation": "/Common/192.168.1.3",
"vlansEnabled": true,
"vlans": [
"/Common/vlan.outside"
],
"origins": [
{
"name": "0.0.0.0/0"
}
]
}
]
}
Response - { "code": 403, "message": "Operation is not supported on component /ltm/snat.", "errorStack": [], "apiError": 1 }
6 Replies
- RAHUL_AM88_3527
Nimbostratus
Any clues on how to use rest api of f5 big-ip to create snat ?
- vsundararaj_296
Nimbostratus
Any luck with this? I am seeing the same
- jaikumar_f5
Noctilucent
I believe this seems to do what you are asking.
curl -sku admin:admin https://192.168.10.23/mgmt/tm/ltm/snat -H "content-type:application/json" -d '{ "name": "test2", "partition": "Common", "autoLasthop": "enabled", "mirror": "disabled", "sourcePort": "preserve", "translation": "/Common/192.168.1.3", "vlansEnabled": true, "vlans": [ "/Common/EXTERNAL" ], "origins": [ { "name": "::/0" }, { "name": "0.0.0.0/0" } ] }'- vsundararaj_296
Nimbostratus
Thank you
This works from F5 directly. But, I am trying to do the exact command from Windows with Curl it doesn't understand the JSON format.
Do you have any reference on how I can add a loop statement or custom script with F5? I need to create about 500+ SNAT entries.
Sure, I can help you. But then please create your own question so you have the ability to mark as the right answer.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
