Forum Discussion
How to remove config from LTM policy using CLI?
Hi all,
We have following policy on one of our LTMs.
ltm policy /Common/Test { controls { forwarding } requires { http } rules { Test-Client1 { actions { 0 { forward select pool /Common/CLient1_Pool } } conditions { 0 { http-uri contains values { 0099/ } } } ordinal 1 }
We need to remove the "ordinal 1" part of the config from this policy. We can't find any option in GUI. How do we remove this using the CLI?
Thanks,
- PeteWhiteEmployee
This is added automatically when you add the entry to your policy. Why do you want to remove it?
- Humair_167681Nimbostratus
Hi Pete,
We need to remove it because there are other rules in the same policy but they do not have any ordinal value set.
Test-Client2 { actions { 0 { forward select pool /Common/Client2_Pool } } conditions { 0 { http-uri contains values { 0098/ } } } }
Hope this makes sense.
- PeteWhiteEmployee
The rules are given an ordinal value when they are added. See below - a single policy with two rules. "rule2" is matched first and "Test-Client2" is matched second. These can be reordered via the GUI or by setting the ordinal value.
root@(B3600-R20-S13)(cfg-sync Standalone)(Active)(/Common)(tmos) list ltm policy Test ltm policy Test { controls { forwarding } requires { http } rules { Test-Client1 { actions { 0 { forward select pool test_pool } } ordinal 2 } rule2 { actions { 0 { log write message test } } ordinal 1 } } strategy first-match }
I can then change this using modify:
root@(B3600-R20-S13)(cfg-sync Standalone)(Active)(/Common)(tmos) modify ltm policy Test rules modify { rule2 { ordinal 3 } }
Which gives me this: root@(B3600-R20-S13)(cfg-sync Standalone)(Active)(/Common)(tmos) list ltm policy Test { controls { forwarding } requires { http } rules { Test-Client1 { actions { 0 { forward select pool test_pool } }
} rule2 { actions { 0 { log write message test } }ordinal 2
} } strategy first-match }ordinal 3
- Humair_167681Nimbostratus
Thanks Pete.
Basically we have 5 functions/rules in the policy and only one of them has ordinal value set. The rest of them do not have any ordinal value set. All the other 4 rules match the traffic and send it to pools configured but the rule that has extra config of "ordinal 1" just drops the traffic. Is it mandatory to have "ordinal" value for each rule? Is there any way we can remove the "ordinal" config from the policy.
Thanks,
Humair
- PeteWhiteEmployeeI suspect you have an issue with your config, can you PM me with your actual config so I can take a look.Each rule has an ordinal set, but each rule can have a number of matches/actions.
- PeteWhiteEmployee
You can see here that there are 2 rules but rule 2 has 2 conditions/actions:
ltm policy Test { controls { forwarding } requires { http } rules { 1 { actions { 0 { forward select pool dns } } conditions { 0 { http-uri values { /1 } } } ordinal 1 } 2 { actions { 0 { forward select pool syslog } 1 { forward select pool dns } } conditions { 0 { http-uri values { 2 } } 1 { http-uri values { 3 } } } ordinal 2 } } strategy first-match }
- Humair_167681Nimbostratus
Hi Pete,
Please have a look at the config below.
ltm policy /Common/Test {
- Humair_167681Nimbostratus
Sorry - Can't get to format the text properly!
- PeteWhiteEmployee
OK, I see that there are a number of rules and only one has an ordinal set which seems strange. Did you configure them via the GUI or via tmsh?
As far as I understand, you need to have an ordinal set per rule, hence why you have the option to reorder them in the GUI. I'd be inclined to go to the GUI, hit Reorder then Update and it should setthe ordinal based on the order of the rules in the GUI. Or use tmsh:
modify ltm policy /Common/Test rules modify { Client6 { ordinal 6 } Client1 { ordinal 1 } Client2 { ordinal 2 } Client3 { ordinal 3 } Client4 { ordinal 4 } Client5 { ordinal 5 } }
- Humair_167681Nimbostratus
The rules were configured via tmsh.
Thank you very much for your help Pete.
Much appreciated!
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