Skip to content

CLI Reference ​

The tcp-warden binary provides built-in subcommands for starting the proxy, validating YAML configuration, installing modular protocol plugins, and managing active IP bans.

Unified CLI Available

All commands documented below can be executed directly using either the standalone tcp-warden binary or via the unified Routewarden CLI as rwarden tcp <subcommand> (e.g. rwarden tcp up, rwarden tcp reload, rwarden tcp plugins list).


Global Syntax ​

rwarden tcp [command] [flags]rwarden status tcprwarden stop tcp

Commands ​

run (Default) ​

Starts the TCP proxy daemon and binds configured service listeners.

# Run in foreground (auto-resolves tcp-warden.yaml)rwarden tcp up# Run in background daemon mode (detached)rwarden tcp up -d# Run with custom config file and verbose loggingrwarden tcp up -c /etc/routewarden/custom.yaml -v -d# Reload configuration on running daemon without dropping connections (zero-downtime)rwarden tcp reload# Stop running background proxy daemonrwarden tcp stop
FlagShorthandDescriptionDefault
--config-cPath to YAML configuration filetcp-warden.yaml

validate ​

Validates YAML syntax, port collisions, CIDR format, and protocol dependencies without starting listeners.

# Validate TCP Warden configuration YAMLrwarden tcp validate -c tcp-warden.yaml# or universal validaterwarden validate tcp-warden.yaml

Exit Codes:

  • 0: Configuration is valid.
  • 1: Syntax or rule validation error (details printed to stderr).

plugins ​

Subcommands for discovering, installing, testing, and managing modular protocol inspectors.

plugins list ​

Displays all installed modular plugins, versions, protocols, and current activation status:

rwarden tcp plugins list

plugins install ​

Pulls a plugin from a Git repository or local folder, runs pre-flight tests, and registers the plugin:

# Install official plugin by short name or repositoryrwarden tcp plugins install httprwarden tcp plugins install redisrwarden tcp plugins install postgresrwarden tcp plugins install https://github.com/routewarden/plugins/postgres
FlagDescriptionDefault
--forceOverwrite existing installation and purge cachefalse
--no-buildSkip rebuilding the tcp-warden binaryfalse
--cache-dirPath to plugin cache directory$ROUTEWARDEN_PLUGINS_CACHE

plugins enable ​

Tests the plugin using synthetic net.Pipe self-tests and enables it in tcp-warden.yaml:

Terminalbash
tcp-warden plugins enable postgres

plugins disable ​

Disables an active plugin and sets enabled: false in tcp-warden.yaml:

Terminalbash
tcp-warden plugins disable postgres

plugins test ​

Executes in-memory self-tests across all registered plugins:

rwarden tcp plugins test

plugins create ​

Scaffolds a new custom protocol inspector plugin with manifest (plugin.yaml), lifecycle code (plugin.go), unit tests, and automatic registration in plugins/all/all.go:

Terminalbash
# Scaffold a new custom protocol plugin with manifest, tests, and auto-registrationtcp-warden plugins create custom_guard --protocol custom --listen :9500 --upstream 127.0.0.1:9000
FlagDescriptionDefault
--protocolTarget protocol name<plugin-name>
--listenDefault ingress port""
--upstreamDefault upstream target""
--dirDestination directoryplugins/<plugin-name>
--no-serviceSkip adding default service to tcp-warden.yamlfalse

plugins uninstall ​

Removes plugin source, unregisters import, and rebuilds the binary:

Terminalbash
tcp-warden plugins uninstall postgres

status ​

Queries metrics from a running daemon via the management API:

# Check running proxy daemon statusrwarden tcp status# orrwarden status tcp

banlist ​

Displays active IP bans, offending services, and remaining expiration times:

Terminalbash
tcp-warden banlist --api http://127.0.0.1:9091

ban ​

Manually ban an IP address across all services:

Terminalbash
tcp-warden ban 198.51.100.55 --duration 24h --reason "manual audit block"
FlagDescriptionDefault
--durationBan expiration duration (e.g. 1h, 24h, 7d)1h
--reasonHuman-readable reason for the banmanual ban
--apiManagement API base URLhttp://127.0.0.1:9091

unban ​

Removes an active ban for a specific IP address:

Terminalbash
tcp-warden unban 198.51.100.55

version ​

Displays the compiled version, Git commit hash, and build timestamp:

rwarden tcp version

Released under the MIT License.