Skip to content

upctl server firewall create

Create a new firewall rule

To edit the default rule of the firewall, set only --direction and --action parameters. This creates catch-all rule that will take effect when no other rule matches. Note that the default rule must be positioned after all other rules. Use --position parameter or create default rule after other rules.

upctl server firewall create <UUID/Title/Hostname...> [flags]

Examples

upctl server firewall create 00038afc-d526-4148-af0e-d2f1eeaded9b --direction in --action drop
upctl server firewall create 00038afc-d526-4148-af0e-d2f1eeaded9b --direction in --action accept --family IPv4
upctl server firewall create 00038afc-d526-4148-af0e-d2f1eeaded9b --direction in --action drop --family IPv4 --src-ipaddress-block 10.11.0.88/24

Options

Option Description
--direction Rule direction. Available: in / out
--action Rule action. Available: accept / drop
--family IP family. Available: IPv4, IPv6
--position Position in relation to other rules. Available: 1-1000
Default: 0
--protocol Protocol. Available: tcp, udp, icmp
--icmp-type ICMP type. Available: 0-255
--dest-ipaddress-block Destination IP address block.
--destination-port-start Destination port range start. Available: 1-65535
--destination-port-end Destination port range end.
--src-ipaddress-block Source IP address block.
--source-port-start Source port range start.
--source-port-end Destination port range end.
--comment Freeform comment that can include 0-250 characters.
--help, -h help for create
Default: false

Global options

Option Description
--client-timeout, -t Client timeout to use in API calls.
Default: 0s
--config Configuration file path.
--debug Print out more verbose debug logs.
Default: false
--force-colours Force coloured output despite detected terminal support.
--no-colours Disable coloured output despite detected terminal support. Colours can also be disabled by setting NO_COLOR environment variable.
--output, -o Output format (supported: json, yaml and human)
Default: human
Command Description
upctl server firewall Manage server firewall rules. Enabling or disabling the firewall is done in server modify.