# urbestack-ban-add

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-ban-add --address ADDRESS --jail RULE --seconds N [--line 'the log line that caught it']
```

## Description

Records a timed ban on an IP address and enforces it in the firewall. The ban uses the scope of the rule named by --jail. An unknown rule applies the ban to all services. Loopback IP addresses and IP addresses covered by the Allow list are exempt.

Use --address for one IPv4 or IPv6 IP address. Set --seconds to a duration from 1 second to 366 days. Give the duration in seconds or use a unit suffix, as in 10m, 1h, 2d or 1w. Repeating an active ban for the same IP address and rule keeps the later expiry.

Use --line to record the log line that triggered the ban. If you pass several lines, UrbeStack keeps up to 500 characters from the last nonblank line.

## Command family: ban

- [urbestack-ban-allow](https://urbestack.com/docs/commands/urbestack-ban-allow.md): Adds individual IP addresses from matching bans to the Allow list.
- [urbestack-ban-clear](https://urbestack.com/docs/commands/urbestack-ban-clear.md): Lifts every active ban and empties the firewall's ban set.
- [urbestack-ban-del](https://urbestack.com/docs/commands/urbestack-ban-del.md): Lifts one active ban by ID or every active ban that matches the filters.
- [urbestack-ban-list](https://urbestack.com/docs/commands/urbestack-ban-list.md): Lists one page of matching bans within UrbeStack's retention period, newest first.
