Skip to content

ezgh compute firewalls rules add

Add rules to a firewall.

Updated View as Markdown
ezgh compute firewalls rules add <firewall> (-f rules.json | --direction d --protocol p [--ports 22|8000-8100] [--icmp-type t [--icmp-code c]] (--cidr c|--peer-firewall f) [--description d]) [flags]

Add one rule, from the flags, or 1 to 50 rules from -f (a file, or - for stdin: a JSON array of rules, or an object with “rules”; ezgh compute firewalls create --help shows a rule’s shape). A rule the firewall already has is refused (rule_duplicate).

Part of ezgh compute firewalls rules.

Examples

ezgh compute firewalls rules add web --direction inbound --protocol tcp --ports 443 --cidr 0.0.0.0/0
ezgh compute firewalls rules add db --direction inbound --protocol tcp --ports 5432 --peer-firewall web
ezgh compute firewalls rules add web -f rules.json

Flags

Flag Type Default Description
--cidr string allow this IPv4 or IPv6 prefix, such as 0.0.0.0/0
--description string what the rule is for
--direction string inbound or outbound
-f, --file string rules to add: a JSON file, or - for stdin
--icmp-code int with --icmp-type: the ICMP code; default every code
--icmp-type int icmp and icmpv6: the ICMP type; default every type
--peer-database string allow this database (dbi_…)
--peer-firewall string allow the members of this firewall (ID, UUID or name)
--peer-load-balancer string allow this load balancer (lbr_…)
--peer-sandbox-subnet string allow the sandboxes started in this subnet (sbn_…)
--ports string tcp and udp: a port (22) or range (8000-8100); default every port
--protocol string tcp, udp, icmp, icmpv6, all, or an IANA protocol number

This command also takes the global flags.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close