Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

Create snat failed using rest api

Resquest - POST https://{{F5-LB}}/mgmt/tm/ltm/snat 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 }

0
Rate this Question
Comments on this Question
Comment made 05-Apr-2018 by RAHUL_AM88 2

Any clues on how to use rest api of f5 big-ip to create snat ?

0

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Any luck with this? I am seeing the same

0
Comments on this Answer
Comment made 1 month ago by jaikumar_f5 1929

Hey Vsundararaj

Refer below article.

Creating and deleting a SNAT or a SNAT pool

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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"
        }
      ]
    }'
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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.

0
Comments on this Answer
Comment made 1 month ago by Patrik Jonsson 3524

Sure, I can help you. But then please create your own question so you have the ability to mark as the right answer.

0