< Back

New-GceFirewallProtocol

Mon Jan 13, 2020 11:25 pm

NAME New-GceFirewallProtocol



SYNOPSIS

Creates a new object that tells a firewall to allow a protocol.





SYNTAX

New-GceFirewallProtocol [-IPProtocol] <string> [-Port <List`1>] [-Pipeline <object>] [<CommonParameters>]





DESCRIPTION

Creates a new AllowedData object which can be passed through the pipeline too the Allowed parameter of the

Add-GceFirewall cmdlet.





PARAMETERS

-IPProtocol <string>

The IP protocol that is allowed for this rule. This value can either be one of the following well known

protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Protocol <string>

The IP protocol that is allowed for this rule. This value can either be one of the following well known

protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number.



This is an alias of the IPProtocol parameter.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Port <List`1>

The ports which are allowed. This parameter is only applicable for UDP or TCP protocol. Each entry must be

either an integer or a range. If not specified, connections through any port are allowed. Example inputs

include: "22", "80","443", "12345-12349" and "80..443".



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Pipeline <object>

The Pipeline to append the new AllowedData to.



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Object

The Pipeline to append the new AllowedData to.





OUTPUTS

Google.Apis.Compute.v1.Data.Firewall+AllowedData





---------- EXAMPLE 1 ----------



New-GceFirewallProtocol tcp -Port 80, 443 |

New-GceFirewallProtocol esp |

Add-GceFirewall -Project "your-project" -Name "firewall-name"



Creates two GceFirewallProtocol objects, and sends them to the Add-GceFirewall cmdlet.

---------- EXAMPLE 2 ----------



New-GceFirewallProtocol tcp -Port 80..443 |

Add-GceFirewall -Project "your-project" -Name "firewall-name"



Creates a GceFirewallProtocol object with port range 80 to 443, and sends them to the Add-GceFirewall cmdlet.



RELATED LINKS

[Firewall resource definition] (https://cloud.google.com/compute/docs/r ... s#resource)