Firewalls

Add firewall rule to firewall

Creates a firewall rule and adds it to an existing firewall. Include the firewall ID in the path, and provide the firewall rule configuration in the request body.

post/core/firewalls/{firewall_id}/firewall-rules

Request

  • Base URL: https://infrahub-api.nexgencloud.com/v1
  • URL: https://infrahub-api.nexgencloud.com/v1/core/firewalls/{firewall_id}/firewall-rules
  • Auth: API key in header api_key

Path parameters

firewall_idinteger required

ID of the firewall.

Request body

directionstring required

The direction of traffic that the firewall rule applies to.

ethertypestring required

The Ethernet type associated with the rule.

protocol'any' | 'ah' | 'dccp' | 'egp' | 'esp' | 'gre' | 'hopopt' | 'icmp' | 'igmp' | 'ip' | 'ipip' | 'ipv6-encap' | 'ipv6-frag' | 'ipv6-icmp' | 'icmpv6' | 'ipv6-nonxt' | 'ipv6-opts' | 'ipv6-route' | 'ospf' | 'pgm' | 'rsvp' | 'sctp' | 'tcp' | 'udp' | 'udplite' | 'vrrp' required

The network protocol associated with the rule. Call the List firewall rule protocols endpoint to retrieve a list of permitted network protocols.

remote_ip_prefixstring required

The IP address range that is allowed to access the specified port. Use "0.0.0.0/0" to allow any IP address.

port_range_mininteger

The minimum port number in the range of ports to be allowed by the firewall rule.

port_range_maxinteger

The maximum port number in the range of ports to be allowed by the firewall rule.

Example request

{
  "protocol": "any"
}

Response

Success

statusboolean

Whether the request succeeded.

messagestring

Human-readable description of the result.

Example response

{
  "status": true,
  "message": "Firewall Rule created successfully",
  "firewall_rule": {
    "id": 7613,
    "direction": "egress",
    "protocol": "any",
    "port_range_min": 1,
    "port_range_max": 65535,
    "ethertype": "IPv4",
    "remote_ip_prefix": "0.0.0.0/0",
    "status": "SUCCESS",
    "created_at": "2026-05-06T15:18:42Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.