Description
The 'fw sam_policy get
' and 'fw6 sam_policy get
' commands let you:
Notes:
fw sam_policy get add
' and 'fw samp get
'.$FWDIR/database/sam_policy.db
file.$FWDIR/database/sam_policy.mng
.Important:
In Gaia Clish, run: set virtual-system <
VSID>
In Expert mode, run: vsenv <
VSID>
Syntax for IPv4
|
Syntax for IPv6
|
Parameters
Note - All these parameters are optional.
Parameter |
Description |
---|---|
|
Runs the command in debug mode. Use only if you troubleshoot the command itself. |
|
Controls how to print the rules:
|
|
Prints the rule specified by its Rule UID or its zero-based rule index. The quote marks and angle brackets ('<...>') are mandatory. |
|
Prints the rules with the specified predicate key. The quote marks are mandatory. |
|
Prints the rules with the specified predicate type. For Rate Limiting rules, you must always use " |
|
Prints the rules with the specified predicate values. The quote marks are mandatory. |
|
Negates the condition specified by these predicate parameters:
|
Example 1 - Output in the default format
[Expert@GW:0]# fw samp get
operation=add uid=<5ac3965f,00000000,3403a8c0,0000264a> target=all timeout=300 action=notify log=log name=Test\ Rule comment=Notify\ about\ traffic\ from\ 1.1.1.1 originator=John\ Doe src_ip_addr=1.1.1.1 req_tpe=ip |
Example 2 - Output in the list format
[Expert@GW:0]# fw samp get -l
uid <5ac3965f,00000000,3403a8c0,0000264a> target all timeout 2147483647 action notify log log name Test\ Rule comment Notify\ about\ traffic\ from\ 1.1.1.1 originator John\ Doe src_ip_addr 1.1.1.1 req_type ip |
Example 3 - Printing a rule by its Rule UID
[Expert@GW:0]# fw samp get -u '<5ac3965f,00000000,3403a8c0,0000264a>' 0 operation=add uid=<5ac3965f,00000000,3403a8c0,0000264a> target=all timeout=300 action=notify log=log name=Test\ Rule comment=Notify\ about\ traffic\ from\ 1.1.1.1 originator=John\ Doe src_ip_addr=1.1.1.1 req_tpe=ip |
Example 4 - Printing rules that match the specified filters
[Expert@MyGW:0]# fw samp get no corresponding SAM policy requests [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp add -a d -l r -t 3600 quota service any source range:172.16.7.11-172.16.7.13 new-conn-rate 5 flush true [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp add -a n -l r quota service 1,50-51,6/443,17/53 service-negated true source cc:QQ byte-rate 0 [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp add -a b quota source range:172.16.8.17-172.16.9.121 service 6/80 [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp add -a d quota service any source-negated true source cc:QQ concurrent-conns-ratio 655 track source [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get operation=add uid=<5bab3acf,00000000,3503a8c0,00003ddc> target=all timeout=indefinite action=drop service=any source-negated=true source=cc:QQ concurrent-conns-ratio=655 track=source req_type=quota operation=add uid=<5bab3ac6,00000000,3503a8c0,00003dbf> target=all timeout=3586 action=drop log=log service=any source=range:172.16.7.11-172.16.7.13 new-conn-rate=5 flush=true req_type=quota operation=add uid=<5bab3acc,00000000,3503a8c0,00003dd7> target=all timeout=indefinite action=bypass source=range:172.16.8.17-172.16.9.121 service=6/80 req_type=quota operation=add uid=<5bab3ac9,00000000,3503a8c0,00003dd5> target=all timeout=indefinite action=notify log=log service=1,50-51,6/443,17/53 service-negated=true source=cc:QQ byte-rate=0 req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k 'service' -t in -v '6/80' operation=add uid=<5bab3acc,00000000,3503a8c0,00003dd7> target=all timeout=indefinite action=bypass source=range:172.16.8.17-172.16.9.121 service=6/80 req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k 'service-negated' -t in -v 'true' operation=add uid=<5bab3ac9,00000000,3503a8c0,00003dd5> target=all timeout=indefinite action=notify log=log service=1,50-51,6/443,17/53 service-negated=true source=cc:QQ byte-rate=0 req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k 'source' -t in -v 'cc:QQ' operation=add uid=<5bab3acf,00000000,3503a8c0,00003ddc> target=all timeout=indefinite action=drop service=any source-negated=true source=cc:QQ concurrent-conns-ratio=655 track=source req_type=quota operation=add uid=<5bab3ac9,00000000,3503a8c0,00003dd5> target=all timeout=indefinite action=notify log=log service=1,50-51,6/443,17/53 service-negated=true source=cc:QQ byte-rate=0 req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k source -t in -v 'cc:QQ' -n operation=add uid=<5bab3ac6,00000000,3503a8c0,00003dbf> target=all timeout=3291 action=drop log=log service=any source=range:172.16.7.11-172.16.7.13 new-conn-rate=5 flush=true req_type=quota operation=add uid=<5bab3acc,00000000,3503a8c0,00003dd7> target=all timeout=indefinite action=bypass source=range:172.16.8.17-172.16.9.121 service=6/80 req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k 'source-negated' -t in -v 'true' operation=add uid=<5baa94e0,00000000,860318ac,00003016> target=all timeout=indefinite action=drop service=any source-negated=true source=cc:QQ concurrent-conns-ratio=655 track=source req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k 'byte-rate' -t in -v '0' operation=add uid=<5baa9431,00000000,860318ac,00002efd> target=all timeout=indefinite action=notify log=log service=1,50-51,6/443,17/53 service-negated=true source=cc:QQ byte-rate=0 req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k 'flush' -t in -v 'true' operation=add uid=<5baa9422,00000000,860318ac,00002eea> target=all timeout=2841 action=drop log=log service=any source=range:172.16.7.11-172.16.7.13 new-conn-rate=5 flush=true req_type=quota [Expert@MyGW:0]# [Expert@MyGW:0]# fw samp get -k 'concurrent-conns-ratio' -t in -v '655' operation=add uid=<5baa94e0,00000000,860318ac,00003016> target=all timeout=indefinite action=drop service=any source-negated=true source=cc:QQ concurrent-conns-ratio=655 track=source req_type=quota [Expert@MyGW:0]# |