调用或删除策略标签或虚拟服务器策略库
与只能绑定一次的策略不同,您可以通过调用策略标签或虚拟服务器的策略库来多次使用它。可以从两个地方执行调用:
- 来自策略库中指定保单的绑定。
- 来自对政策银行中NOPOLICY“虚拟”条目的绑定。
通常,策略标签必须与调用策略标签的类型相同。例如,您可以从响应方策略中调用响应方策略标签。
注意:在命令行绑定或取消绑定策略库中的全局 NOPOLICY 条目时,需要指定优先级以区分一个 NOPOLICY 条目。
使用 CLI 调用重写或集成缓存策略标签
在命令提示符下,键入以下命令之一以调用重写或集成缓存策略标签并验证配置:
- bind cache global <policy> -priority <positive_integer> [-gotoPriorityExpression <expression>] -type REQ_OVERRIDE|REQ_DEFAULT|RES_OVERRIDE|RES_DEFAULT] -invoke reqvserver|resvserver|policylabel <label_name>
- bind rewrite global<policy> -priority <positive_integer> [-gotoPriorityExpression <expression>] -type REQ_OVERRIDE|REQ_DEFAULT|RES_OVERRIDE|RES_DEFAULT] -invoke reqvserver|resvserver|policylabel <label_name>
- show cache global|show rewrite global
<!--NeedCopy-->
示例:
> bind cache global _nonPostReq2 -priority 100 -type req_override -invoke
policylabel lbl-cache-pol
Done
> show cache global
1) Global bindpoint: REQ_DEFAULT
Number of bound policies: 2
2) Global bindpoint: RES_DEFAULT
Number of bound policies: 1
3) Global bindpoint: REQ_OVERRIDE
Number of bound policies: 1
Done
<!--NeedCopy-->
使用 CLI 调用响应程序策略标签
在命令提示符下,键入以下命令以调用响应程序策略标签并验证配置:
- bind responder global <policy_Name> <priority_as_positive_integer> [<gotoPriorityExpression>] -type REQ_OVERRIDE|REQ_DEFAULT|OVERRIDE|DEFAULT -invoke vserver|policylabel <label_name>
- show responder global
<!--NeedCopy-->
示例:
> bind responder global pol404Error1 300 -invoke policylabel lbl-respndr-pol
Done
> show responder global
1) Global bindpoint: REQ_DEFAULT
Number of bound policies: 2
Done
<!--NeedCopy-->
使用 CLI 调用虚拟服务器策略库
在命令提示符下,键入以下命令以调用虚拟服务器策略库并验证配置:
- bind lb vserver <vserver_name> -policyName <policy_Name> -priority <positive_integer> [-gotoPriorityExpression <expression>] -type REQUEST|RESPONSE -invoke reqvserver|resvserver|policylabel <policy_Label_Name>
- bind lb vserver <vserver_name>
<!--NeedCopy-->
示例:
> bind lb vserver lbvip -policyName ns_cmp_msapp -priority 100
Done
> show lb vserver lbvip
lbvip (8.7.6.6:80) - HTTP Type: ADDRESS
State: DOWN
Last state change was at Wed Jul 15 05:54:24 2009 (+166 ms)
Time since last state change: 28 days, 06:37:49.250
Effective State: DOWN
Client Idle Timeout: 180 sec
Down state flush: ENABLED
Disable Primary Vserver On Down : DISABLED
Port Rewrite : DISABLED
No. of Bound Services : 0 (Total) 0 (Active)
Configured Method: LEASTCONNECTION
Mode: IP
Persistence: NONE
Vserver IP and Port insertion: OFF
Push: DISABLED Push VServer:
Push Multi Clients: NO
Push Label Rule: none
1) CSPolicy: pol-cont-sw CSVserver: vs-cont-sw Priority: 100 Hits: 0
2) Policy : pol-ssl Priority:0
3) Policy : ns_cmp_msapp Priority:100
4) Policy : cf-pol Priority:1 Inherited
Done
<!--NeedCopy-->
使用 CLI 删除重写或集成缓存策略标签
在命令提示符下,键入以下命令之一以删除重写或集成缓存策略标签并验证配置:
- unbind rewrite global <policyName> -priority <positiveInteger> -type REQ_OVERRIDE|REQ_DEFAULT|RES_OVERRIDE|RES_DEFAULT
- unbind cache global <policyName> -priority <positiveInteger> -type REQ_OVERRIDE|REQ_DEFAULT|RES_OVERRIDE|RES_DEFAULT
- show rewrite global|show cache global
<!--NeedCopy-->
示例:
> unbind rewrite global NOPOLICY -priority 100 -type REQ_OVERRIDE
> show rewrite global
Done
1) Global bindpoint: REQ_DEFAULT
Number of bound policies: 1
Done
<!--NeedCopy-->
使用 CLI 删除响应程序策略标签
在命令提示符下,键入以下命令以删除响应程序策略标签并验证配置:
- unbind responder global <policyName> -priority <positiveInteger> -type OVERRIDE|DEFAULT
- show responder global
<!--NeedCopy-->
示例:
> unbind responder global NOPOLICY -priority 100 -type REQ_DEFAULT
Done
> show responder global
1) Global bindpoint: REQ_DEFAULT
Number of bound policies: 1
Done
<!--NeedCopy-->
使用 CLI 删除虚拟服务器策略标签
在命令提示符下,键入以下命令之一以删除虚拟服务器策略标签并验证配置:
- unbind lb vserver <virtualServerName> -policyName NOPOLICY-REWRITE|NOPOLICY-RESPONDER|NOPOLICY-CACHE -type REQUEST|RESPONSE -priority <positiveInteger>
- unbind cs vserver <virtualServerName> -policyName NOPOLICY-REWRITE|NOPOLICY-RESPONDER|NOPOLICY-CACHE -type REQUEST|RESPONSE -priority <positiveInteger>
- show lb vserver|show cs vserver
<!--NeedCopy-->
示例:
> unbind lb vserver lbvip -policyName ns_cmp_msapp -priority 200
Done
> show lb vserver lbvip
lbvip (8.7.6.6:80) - HTTP Type: ADDRESS
State: DOWN
Last state change was at Wed Jul 15 05:54:24 2009 (+161 ms)
Time since last state change: 28 days, 06:47:54.600
Effective State: DOWN
Client Idle Timeout: 180 sec
Down state flush: ENABLED
Disable Primary Vserver On Down : DISABLED
Port Rewrite : DISABLED
No. of Bound Services : 0 (Total) 0 (Active)
Configured Method: LEASTCONNECTION
Mode: IP
Persistence: NONE
Vserver IP and Port insertion: OFF
Push: DISABLED Push VServer:
Push Multi Clients: NO
Push Label Rule: none
1) CSPolicy: pol-cont-sw CSVserver: vs-cont-sw Priority: 100 Hits: 0
1) Policy : pol-ssl Priority:0
2) Policy : cf-pol Priority:1 Inherited
Done
<!--NeedCopy-->
使用 GUI 调用策略标签或虚拟服务器策略库
- 绑定策略,如全局绑定策略、将策略绑定到虚拟服务器或将策略绑定到策略标签中所述。或者,您可以输入一个 NOPOLICY“虚拟”条目,而不是策略名称。如果您不想在评估策略库之前评估政策,则可以这样做。
- 在 Invoke 字段中,选择要评估流量是否与绑定策略匹配的策略标签或虚拟服务器策略库的名称。状态栏中的消息表明策略标签或虚拟服务器策略库已成功调用。
使用 GUI 删除策略标签调用
- 打开策略并清除 Invoke 字段。取消绑定策略还会删除标签的调用。状态栏中的消息表明策略标签已成功删除。
已复制!
失败!