# IP Banning

Staff++ added a simple ip banning system to ensure players with certain ip addresses cannot join the server.

{% hint style="warning" %}
NOTE: An IP ban is not player based! Banning an IP will most probably impact more than one player. If you want to block a specific player by username use the normal banning of staff++.\
\
If you still want to proceed with banning a player based on his IP, realize you might impact other players as well.

Luckily staff++ will always warn you what players will be impacted when banning unbanning an IP.
{% endhint %}

### Configuration

```yaml
ban-module:
  # Whether or not the plugin will use "/ban-player" features.
  enabled: true
  permban-template: ''
  tempban-template: ''
  ipban:
      enabled: true
      # Type of confirmation when banning an IP
      # Possible values: CHAT | GUI | DISABLED
      confirmation: CHAT
      permban-template: ''
      tempban-template: ''
```

### Permissions

View [permissions](/permissions-and-commands/permissions.md) page

### Commands

| Command                                                    | Description                                             |
| ---------------------------------------------------------- | ------------------------------------------------------- |
| /ipban \[player/ip-address/cidr]                           | Add an ip ban based on a player, ip or cidr             |
| /iptempban \[player/ip-address/cidr] \[amount] \[timeunit] | Temporarily add an ip ban based on a player, ip or cidr |
| /ipunban \[player/ip-address/cidr]                         | Remove a ban based on a player, ip or cidr              |
| /ipban-check \[playername]                                 | Check if the given player's ip is banned                |
| /ipbans \[-players]                                        | List all active IP-bans or list all banned players      |

## Examples

### Permanent banning

`/ipban [player/ip-address/cidr]`

```
# By playername 
/ipban player1

# By specific IP
/ipban 20.15.62.15

# By CIDR
/ipban 20.15.62.0/24
```

Ip banning will always ask for a confirmation when executed from in game. An ip ban can impact multiple players. Staff++ will check the last known IP of on- and offline players and list players the will be impacted. Of course there is no 100% certainty other players might not be impacted. But at least this gives an indication.

![](/files/-MdxzgGXTvW_k-ZNFS4B)

### Temporary banning

`/tempban [player/ip-address/cidr] [amount] [unit]`

```
# By playername 
/iptempban player1 15 MINUTE

# By specific IP
/iptempban 20.15.62.15 15 MINUTE

# By CIDR
/iptempban 20.15.62.0/24 15 MINUTE
```

The duration of the tempban is specified by \[amount] \[unit]

Amount must be a positive number > 0 and unit must be one of the following:

* SECOND
* MINUTE
* HOUR
* DAY
* WEEK
* MONTH
* YEAR

### Unbanning

`/ipunban [player]`

```
# By playername 
/ipunban player1

# By specific IP
/ipunban 20.15.62.15

# By CIDR
/ipunban 20.15.62.0/24
```

### Silent banning

The `-silent` can be used to ban/tempban/unban ips without sending out a notification to anyone.

```
/ipban playername -silent
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.staffplusplus.org/features/banning/ip-banning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
