Skip to main content
Glama
Jambozx

OnlineCyberTools MCP (280+ filterable tools)

by Jambozx

linux_iptables_rule_generator

Read-onlyIdempotent

Generate iptables and nftables firewall scripts from a structured rule description. Validates inputs and outputs rule text with explanations and warnings.

Instructions

Iptables And Nftables Firewall Rule Generator. Generate iptables-restore (rules.v4) and nftables (nft.conf) firewall scripts from a structured firewall description: default INPUT/FORWARD/OUTPUT chain policies, an ordered rule list (protocol, source/destination IP plus CIDR, ports, interface, action), NAT and port forwarding (DNAT/SNAT/MASQUERADE), and the common conveniences (allow loopback, allow established/related, rate-limited log-drops). Use this to author Linux netfilter rulesets; use linux_ssh_config_generator instead for ssh_config and sshd_config. It only emits rule TEXT and never runs iptables, touches no network, and reads no database: read-only, non-destructive, and rate-limited (30 requests/minute for anonymous callers). Validates IPs, CIDR suffixes, and port specs, and emits lockout warnings (such as a DROP policy without an SSH allow rule). Set operation to presets to list the 9 ready-made templates. Returns both scripts plus per-rule explanations, warnings, and target file paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationNogenerate builds firewall scripts from the input fields below; presets ignores all other fields and returns the 9 built-in templates.generate
defaultsNoDefault chain policies applied when generating (defaults: input ACCEPT, forward DROP, output ACCEPT).
rulesNoOrdered firewall rules. Each rule maps to one iptables -A line (and an nftables equivalent). Invalid rows are silently skipped.
allowEstablishedNoPrepend an INPUT rule accepting ESTABLISHED and RELATED connections via conntrack.
allowLoopbackNoPrepend an INPUT rule accepting all traffic on the loopback interface.
logDropsNoAppend a rate-limited LOG rule on INPUT before the default policy applies.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNoWhether the request succeeded.
operationNoThe operation performed (generate or presets).
resultNoFor generate: the produced scripts. For presets: a presets array of named templates.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed37 schema fields changedv0.5.1
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / allowEstablished / default
      Added value: +false
    • addedInput schema / properties / allowEstablished / description
      Added value: +"Prepend an INPUT rule accepting ESTABLISHED and RELATED connections via conntrack."
    • addedInput schema / properties / allowLoopback / default
      Added value: +false
    • addedInput schema / properties / allowLoopback / description
      Added value: +"Prepend an INPUT rule accepting all traffic on the loopback interface."
    • addedInput schema / properties / defaults / additionalProperties
      Added value: +false
    • addedInput schema / properties / defaults / description
      Added value: +"Default chain policies applied when generating (defaults: input ACCEPT, forward DROP, output ACCEPT)."
    • addedInput schema / properties / defaults / properties / forward / default
      Added value: +"DROP"
    • addedInput schema / properties / defaults / properties / forward / description
      Added value: +"Default policy for the FORWARD chain."
    • addedInput schema / properties / defaults / properties / forward / enum
      Added value: +[
      +  "ACCEPT",
      +  "DROP",
      +  "REJECT"
      +]
    • addedInput schema / properties / defaults / properties / input / default
      Added value: +"ACCEPT"
    • addedInput schema / properties / defaults / properties / input / description
      Added value: +"Default policy for the INPUT chain."
    • addedInput schema / properties / defaults / properties / input / enum
      Added value: +[
      +  "ACCEPT",
      +  "DROP",
      +  "REJECT"
      +]
    • addedInput schema / properties / defaults / properties / output / default
      Added value: +"ACCEPT"
    • addedInput schema / properties / defaults / properties / output / description
      Added value: +"Default policy for the OUTPUT chain."
    • addedInput schema / properties / defaults / properties / output / enum
      Added value: +[
      +  "ACCEPT",
      +  "DROP",
      +  "REJECT"
      +]
    • removedInput schema / properties / defaults / required
      Removed value: -[
      -  "input",
      -  "forward",
      -  "output"
      -]
    • addedInput schema / properties / logDrops
      Added value: +{
      +  "default": false,
      +  "description": "Append a rate-limited LOG rule on INPUT before the default policy applies.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / operation
      Added value: +{
      +  "default": "generate",
      +  "description": "generate builds firewall scripts from the input fields below; presets ignores all other fields and returns the 9 built-in templates.",
      +  "enum": [
      +    "generate",
      +    "presets"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rules / description
      Added value: +"Ordered firewall rules. Each rule maps to one iptables -A line (and an nftables equivalent). Invalid rows are silently skipped."
    • addedInput schema / properties / rules / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / rules / items / properties / action / description
      Added value: +"Jump target for matched packets. SNAT and DNAT need natTarget; MASQUERADE needs an interface."
    • addedInput schema / properties / rules / items / properties / action / enum
      Added value: +[
      +  "ACCEPT",
      +  "DROP",
      +  "REJECT",
      +  "LOG",
      +  "SNAT",
      +  "DNAT",
      +  "MASQUERADE"
      +]
    • addedInput schema / properties / rules / items / properties / chain / description
      Added value: +"Target chain. PREROUTING and POSTROUTING route into the nat table."
    • addedInput schema / properties / rules / items / properties / chain / enum
      Added value: +[
      +  "INPUT",
      +  "OUTPUT",
      +  "FORWARD",
      +  "PREROUTING",
      +  "POSTROUTING"
      +]
    • addedInput schema / properties / rules / items / properties / destination
      Added value: +{
      +  "description": "Destination IPv4/IPv6 address or CIDR. An invalid value produces a warning.",
      +  "type": "string"
      +}
    • addedInput schema / properties / rules / items / properties / destinationPort / description
      Added value: +"Destination port: single, range, or comma list."
    • addedInput schema / properties / rules / items / properties / interface
      Added value: +{
      +  "description": "Network interface. Bound with -i on INPUT/FORWARD/PREROUTING and -o on OUTPUT/POSTROUTING.",
      +  "type": "string"
      +}
    • addedInput schema / properties / rules / items / properties / natTarget
      Added value: +{
      +  "description": "Rewrite target for DNAT (host and port) or SNAT (source address).",
      +  "type": "string"
      +}
    • addedInput schema / properties / rules / items / properties / protocol / description
      Added value: +"Layer-4 protocol match. Omit or use all to match any protocol."
    • addedInput schema / properties / rules / items / properties / protocol / enum
      Added value: +[
      +  "tcp",
      +  "udp",
      +  "icmp",
      +  "all"
      +]
    • addedInput schema / properties / rules / items / properties / ruleComment / description
      Added value: +"Free-text note emitted as an iptables comment match and an nftables comment."
    • addedInput schema / properties / rules / items / properties / source
      Added value: +{
      +  "description": "Source IPv4/IPv6 address or CIDR (such as 10.0.0.0/8). An invalid value produces a warning, not an error.",
      +  "type": "string"
      +}
    • addedInput schema / properties / rules / items / properties / sourcePort
      Added value: +{
      +  "description": "Source port: single (80), range (1000 colon 2000), or comma list (80 then 443). A list emits an -m multiport match.",
      +  "type": "string"
      +}
    • changedInput schema / properties / rules / items / required
      Previous value: -[
      -  "chain",
      -  "protocol",
      -  "destinationPort",
      -  "action",
      -  "ruleComment"
      -]New value: +[
      +  "chain",
      +  "action"
      +]
    • removedInput schema / required
      Removed value: -[
      -  "defaults",
      -  "allowLoopback",
      -  "allowEstablished",
      -  "rules"
      -]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "operation": {
      +      "description": "The operation performed (generate or presets).",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "For generate: the produced scripts. For presets: a presets array of named templates.",
      +      "properties": {
      +        "explanation": {
      +          "description": "Per-line breakdown pairing each emitted rule with a plain-English meaning.",
      +          "items": {
      +            "properties": {
      +              "meaning": {
      +                "description": "Plain-English description of what the line does.",
      +                "type": "string"
      +              },
      +              "rule": {
      +                "description": "The emitted iptables line.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "files": {
      +          "description": "Suggested target file name and install path for each generated script.",
      +          "items": {
      +            "properties": {
      +              "name": {
      +                "description": "Suggested file name (rules.v4 or nft.conf).",
      +                "type": "string"
      +              },
      +              "path": {
      +                "description": "Conventional install path for the script.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "iptables": {
      +          "description": "Complete iptables-restore script (filter table, plus nat table when NAT rules exist).",
      +          "type": "string"
      +        },
      +        "nftables": {
      +          "description": "Equivalent nftables script (table inet filter, plus table ip nat when NAT rules exist).",
      +          "type": "string"
      +        },
      +        "warnings": {
      +          "description": "Human-readable lockout and validation warnings (invalid IP, SNAT in wrong chain, SSH open to the world, and similar).",
      +          "items": {
      +            "description": "A warning message.",
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "success": {
      +      "description": "Whether the request succeeded.",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds value beyond annotations: explains it is read-only, non-destructive, rate-limited, validates IPs/ports, emits lockout warnings. Annotations already indicate readOnlyHint true and destructiveHint false, but description enriches with specific details about rate limiting and validation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is thorough but somewhat dense. It front-loads the purpose and key characteristics, then covers usage, limitations, and return values. Could be slightly more concise, but no redundant sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given complexity (6 parameters, nested objects, output schema), the description is complete. It covers return format (scripts plus explanations, warnings, file paths), validation, lockout warnings, and presets. Output schema exists but description supplements it well.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with clear property descriptions. The description adds context like silent skip of invalid rows, presets operation behavior, and lockout warnings, which enhance understanding beyond the schema. Baseline 3 due to high coverage, plus extra context justifies 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool generates iptables-restore and nftables firewall scripts from a structured description, with specific verb 'Generate' and resource 'firewall scripts'. Distinguishes from sibling linux_ssh_config_generator by explicitly mentioning what it does not do.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use ('author Linux netfilter rulesets') and when not ('use linux_ssh_config_generator instead for ssh_config and sshd_config'). Provides context that it only emits text and never runs iptables, with rate limits and validation behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools