- NAME
-
- gcloud compute network-firewall-policies mirroring-rules create - creates a Compute Engine network firewall policy packet mirroring rule
- SYNOPSIS
-
-
gcloud compute network-firewall-policies mirroring-rules createPRIORITY--action=ACTION--firewall-policy=FIREWALL_POLICY--global-firewall-policy--layer4-configs=[LAYER4_CONFIG,…] [--description=DESCRIPTION] [--dest-ip-ranges=[DEST_IP_RANGE,…]] [--direction=DIRECTION] [--[no-]disabled] [--security-profile-group=SECURITY_PROFILE_GROUP] [--src-ip-ranges=[SRC_IP_RANGE,…]] [--target-secure-tags=[TARGET_SECURE_TAGS,…]] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
gcloud compute network-firewall-policies mirroring-rules createis used to create network firewall policy packet mirroring rules. - EXAMPLES
-
To create a rule with priority
in a global network firewall policy with name10and descriptionmy-policy, run:example rulegcloud compute network-firewall-policies mirroring-rules create 10 --firewall-policy=my-policy --action=do_not_mirror --description="example rule" --global-firewall-policy - POSITIONAL ARGUMENTS
-
PRIORITY- Priority of the rule to be inserted. Valid in [0, 2147483547].
- REQUIRED FLAGS
-
--action=ACTION-
Action to take if the request matches the match condition.
ACTIONmust be one of:mirror,do_not_mirror,goto_next. --firewall-policy=FIREWALL_POLICY-
Name of the existing network firewall policy where the new mirroring rule is
created (for example,
my-policy). This flag requires a single text string identifying the target policy and does not accept a list, map, configuration object, or file path. --global-firewall-policy-
Indicate that the targeted network firewall policy operates at the global scope.
When specified, this flag directs the command to create the mirroring rule
within the global network firewall policy specified by
--firewall-policy. --layer4-configs=[LAYER4_CONFIG,…]-
Comma-separated list of destination protocols and optional port ranges to which
the firewall rule applies. Each entry specifies a network protocol (such as
tcp,udp, oricmp) and an optional port or continuous port range separated by a colon (for example,tcp:80,udp,sctp:1000-2000).
- OPTIONAL FLAGS
-
--description=DESCRIPTION- An optional, textual description for the rule.
--dest-ip-ranges=[DEST_IP_RANGE,…]- Destination IP ranges to match for this rule.
--direction=DIRECTION-
Direction of the traffic the rule is applied. The default is to apply on
incoming traffic.
DIRECTIONmust be one of:INGRESS,EGRESS. --[no-]disabled-
Use this flag to disable the rule. Disabled rules will not affect traffic. Use
--disabledto enable and--no-disabledto disable. --security-profile-group=SECURITY_PROFILE_GROUP-
Relative resource name or full URL of the security profile group to be used with
the
mirroraction. This flag specifies the threat inspection or packet mirroring configuration that processes the mirrored traffic (for example,organizations/123456789/locations/global/securityProfileGroups/my-profile-groupor//networksecurity.googleapis.com/organizations/123456789/locations/global/securityProfileGroups/my-profile-group). --src-ip-ranges=[SRC_IP_RANGE,…]- A list of IP address blocks that are allowed to make inbound connections that match the firewall rule to the instances on the network. The IP address blocks must be specified in CIDR format: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing.Either --src-ip-ranges or --src-secure-tags must be specified for INGRESS traffic. If both --src-ip-ranges and --src-secure-tags are specified, the rule matches if either the range of the source matches --src-ip-ranges or the secure tag of the source matches --src-secure-tags.Multiple IP address blocks can be specified if they are separated by commas.
- An optional, list of target secure tags with a name of the format tagValues/ or full namespaced name
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - NOTES
-
These variants are also available:
gcloud alpha compute network-firewall-policies mirroring-rules creategcloud beta compute network-firewall-policies mirroring-rules creategcloud preview compute network-firewall-policies mirroring-rules create
gcloud compute network-firewall-policies mirroring-rules create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-17 UTC.
[null,null,["Last updated 2026-11-17 UTC."],[],[]]