<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->

# Configuring Firewall Rules — API & Tool Reference

> Quick reference for tools, commands, and APIs used in configuring-firewall-rules.

## Tools


### `iptables`

Linux IPv4 packet filter administration

**Usage:**
```bash
iptables -A <chain> -s <src> -d <dst> -p <proto> --dport <port> -j <target>
```

**Key Flags:**
  - `-A: append`
  - `-I: insert`
  - `-D: delete`
  - `-L: list`
  - `-P: policy`
  - `-F: flush`
  - `--line-numbers: show numbers`
  - `-n: numeric`
  - `-v: verbose`

---

### `nft`

nftables administration tool

**Usage:**
```bash
nft add rule inet filter input <match> <action>
```

**Key Flags:**
  - `list ruleset: show all`
  - `flush ruleset: clear all`
  - `add table/chain/rule: create`
  - `delete: remove`

---

### `iptables-save`

Dump iptables rules for persistence

**Usage:**
```bash
iptables-save > /etc/iptables/rules.v4
```

**Key Flags:**
  - `-t: specific table`
  - `-c: include counters`

---


## Integration Notes

- All tools should be run with least-privilege access appropriate to the task
- Log all tool invocations for audit trail
- Validate tool output before acting on results
- Cross-reference findings with multiple tools where possible

## See Also

- Parent skill: [Network Security](../../../SKILL.md)
- Technique SKILL.md: [../SKILL.md](../SKILL.md)
