---
title: 'firewall:portknocking'
url: 'https://docs.danami.com/juggernaut/command-line-interface/firewall/firewall-portknocking'
markdown: 'https://docs.danami.com/juggernaut/command-line-interface/firewall/firewall-portknocking.md'
date: '2026-09-24'
description: 'Configure port knocking ports, protocols, and timeouts. juggernaut --task=firewall:portknocking Option Value Default Description --PORTKNOCKING <string> Enable port knocking to be on multiple ports with a variable number of knocked ports and a timeout. There must be a minimum of 3 ports …'
taxonomy:
  category:
    - docs
  tag:
    - portknocking
---

[](#)  [ Basics ](https://docs.danami.com/juggernaut/)     [ Command Line Interface ](https://docs.danami.com/juggernaut/command-line-interface)      Firewall       firewall:portknocking    

# firewall:portknocking

Configure port knocking ports, protocols, and timeouts.

```
juggernaut --task=firewall:portknocking
```

| Option | Value | Default | Description |
|---|---|---|---|
| `--PORTKNOCKING` | <string> |  | Enable port knocking to be on multiple ports with a variable number of knocked ports and a timeout. There must be a minimum of 3 ports to knock for an entry to be valid. e.g.: `22;TCP;20;100;200;300;400` |
| `--PORTKNOCKING_LOG` | <1\|0> | 0 | Enable PORTKNOCKING logging by iptables. |
| `--default` | <yes> |  | Reset all settings to their default values. |
| `--default_option` | <option> |  | Reset a specific setting to its default value. |
| `--restart` | <yes> |  | Restart the service after saving settings. |

## Examples

```
// enable PORTKNOCKING_LOG
juggernaut --task=firewall:portknocking --PORTKNOCKING_LOG=1 --restart=yes

// reset PORTKNOCKING_LOG back to default
juggernaut --task=firewall:portknocking ---default_option=PORTKNOCKING_LOG --restart=yes

// reset all settings back to default
juggernaut --task=firewall:portknocking ---default=yes --restart=yes
```

## Related Pages

- [Port Knocking](https://docs.danami.com/juggernaut/user-guide/port-knocking "Port Knocking")
- [Portknocking Settings](https://docs.danami.com/juggernaut/settings/firewall/portknocking-settings "Portknocking Settings")

 [ ](https://docs.danami.com/juggernaut/user-guide/port-knocking) [](https://docs.danami.com/juggernaut/settings/firewall/portknocking-settings)

---

## Navigation

- Previous: [firewall:portipredirection](https://docs.danami.com/juggernaut/command-line-interface/firewall/firewall-portipredirection.md)
- Next: [firewall:smtp](https://docs.danami.com/juggernaut/command-line-interface/firewall/firewall-smtp.md)
