---
title: "Create a new firewall config"
method: POST
path: "/config/firewall"
---

# Create a new firewall config

`POST /config/firewall`

Create a new firewall config for security.

## Request body

- FirewallEntry
  - `ruleArguments` FirewallRuleEntry, required
    - `sourceIP` string — Source IP in CIDR notation
    - `destinationIP` string — Destination IP in CIDR notation
    - `minSourcePort` integer — Minimum source port range
    - `maxSourcePort` integer — Maximum source port range
    - `minDestinationPort` integer — Minimum destination port range
    - `maxDestinationPort` integer — Maximum destination port range
    - `protocol` integer — the protocol
    - `portName` string — the incoming port
    - `preference` integer — User preference for ordering
  - `opts` FirewallOptionEntry, required
    - `drop` boolean — Drop any matching rule
    - `trap` boolean — Trap anything matching rule
    - `redirect` boolean — Redirect any matching rule
    - `allow` boolean — Allow any matching rule
    - `record` boolean — Record or dump for matching rule
    - `redirectPortName` string — Redirect any matching rule
    - `fwMark` integer — Set a fwmark for any matching rule
    - `doSnat` boolean — Do SNAT on matching rule
    - `toIP` string — Modify to given IP in CIDR notation
    - `toPort` integer — Modify to given Port (Zero if port is not to be modified)
    - `onDefault` boolean — Trigger only on default cases
    - `counter` string — traffic counters

## Response `204`

OK

## Other responses

- `400` — Malformed arguments for API call
- `401` — Invalid authentication credentials
- `403` — Capacity insufficient
- `404` — Resource not found
- `409` — Resource Conflict. VLAN already exists OR dependency VRF/VNET not found
- `500` — Internal service error
- `503` — Maintenance mode

---

[API](https://skmtc.net/loxilb-io/apis/loxilb-rest-api.md) · [All operations](https://skmtc.net/loxilb-io/apis/loxilb-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loxilb-io/loxilb-rest-api/versions/45e9f0a95af0/schema)
