Forum Discussion
iControl REST curl command to create VLAN
I figured it out. You have to do it in 2 steps, create the vlan, then modify it and assign an interface. Why? I have no idea.
Create VLAN external
Tagged:
curl -sk -u admin:admin https://192.168.153.140/mgmt/tm/net/vlan/ -H 'Content-Type: application/json' -X POST -d '{"name":"vlan33","tag":"33"}'
Untagged:
curl -sk -u admin:admin https://192.168.153.140/mgmt/tm/net/vlan/ -H 'Content-Type: application/json' -X POST -d '{"name":"vlan34"}'
Associate an interface with VLAN external and use the tag
curl -k -u "admin:admin" https://192.168.153.140/mgmt/tm/net/vlan/vlan33 -H "Content-Type:application/json" -X PUT -d '{"name":"interfaces", "interfaces":[{"name":"1.3","tagged":null}]}'
Associate an interface with VLAN external and make it untagged
curl -k -u "admin:admin" https://192.168.153.140/mgmt/tm/net/vlan/vlan34 -H "Content-Type:application/json" -X PUT -d '{"name":"interfaces", "interfaces":[{"name":"1.3"}]}'
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