Information: Minecraft Server: I started working on my old Minecraft server called Terona. Join our discord if you want :D Join

Install NetworkLock

Set up NetworkLock on Velocity, BungeeCord or Waterfall and on Paper, Folia, Spigot, Sponge or Paper fork game servers.

NetworkLockChecked

On this page

You put the same NetworkLock.jar on the proxy and on every game server. The proxy creates a key, and each game server trusts that key. The whole setup takes a few minutes.

Animation of the NetworkLock setup order: put the jar on the proxy and start it once, copy security.key and note network.id proxy-1, turn on player forwarding on both sides, put the jar on each game server, which stays in LOCKDOWN, fill in its config.yml with server-id lobby and the proxy's id and key, reload, then run /networklock doctor on both until every line is OK or INFO

Illustration generated with AI and checked by Maj Kovačič.

Before you start#

  • Java 8 or newer on game servers (your Minecraft version may need a newer one, for example Java 25 for 26.x). Proxies need whatever Java their proxy software needs.
  • A game server on Paper or a Paper fork, Folia or a Folia fork, Spigot (Minecraft 1.8.8 to 26.3) or Sponge (1.21.10 to 26.3). CraftBukkit is not supported.
  • The name of each game server exactly as it appears in your proxy config, for example lobby.
  • Download NetworkLock.jar from the 1.0.1 release. SHA-256: dac1de11bfee44c9a2a6b5a37e8bf67552f4e584c505626559438eeb2afeb51e.

Where the files go#

PlatformJar goes inConfig file
Velocityplugins/plugins/networklock/config.yml and messages.yml
BungeeCord, Waterfallplugins/plugins/NetworkLock/config.yml and messages.yml
Paper, Folia, Spigot and their forksplugins/plugins/NetworkLock/config.yml
Spongemods/config/networklock/config.yml

Proxies have a messages.yml. Game servers only have config.yml.

Step 1: set up the proxy#

  1. Stop the proxy and put NetworkLock.jar in its plugins folder.

  2. Start the proxy once. NetworkLock creates config.yml and messages.yml, generates a random key, and logs:

    text
    Generated a new proxy key in config.yml. Add this proxy's id and key to every backend's authentication.trusted-proxies list, then run /networklock reload there.
  3. Open the proxy's config.yml. Note the network.id (default proxy-1) and copy the value of security.key. Keep the key private.

  4. If you run more than one proxy, give each one its own network.id, for example proxy-1 and proxy-2, and run /networklock reload.

Step 2: turn on player forwarding#

NetworkLock needs proxy forwarding on both sides. Turn on one mode only.

Velocity: in velocity.toml, set:

text
player-info-forwarding-mode = "modern"

legacy and bungeeguard also work, but modern is recommended. On the game servers, set proxies.velocity.enabled: true and the Velocity secret in config/paper-global.yml (on Paper 1.13 to 1.18: settings.velocity-support in paper.yml), as Paper describes for Velocity. Spigot and old servers without Velocity support need legacy (or bungeeguard) and settings.bungeecord: true in spigot.yml.

BungeeCord or Waterfall: in the proxy's config.yml, set ip_forward: true. On the game servers, set settings.bungeecord: true in spigot.yml.

Sponge: in config/sponge/sponge.conf, set modules.ip-forwarding=true and ip-forwarding.mode to LEGACY (BungeeCord, or Velocity legacy) or MODERN (Velocity modern).

On Paper, do not turn on both settings.bungeecord and Velocity forwarding. Paper then refuses Velocity players. /networklock doctor warns about this.

Step 3: set up each game server#

  1. Stop the server and put NetworkLock.jar in plugins/ (on Sponge, in mods/).

  2. Start the server once. NetworkLock creates its config.yml. Until you fill it in, the server lets nobody join and logs a LOCKDOWN line. That is expected.

  3. Open the server's config.yml and fill in two things:

    yaml
    network:
      server-id: "lobby"        # this server's name in your proxy config
    
    authentication:
      trusted-proxies:
        - id: "proxy-1"         # network.id of the proxy
          keys: ["paste the proxy key here"]
  4. If players come through more than one proxy, add one entry per proxy, each with its own id and key.

  5. Run /networklock reload in the server console. You should see Configuration reloaded.

  6. Repeat for every game server. Each one needs its own server-id, matching its name in the proxy config.

server-id must match the server name in your proxy config exactly. If it does not, players are refused with reason WRONG_TARGET.

Step 4: check the setup#

  1. Run /networklock doctor on the proxy and on each game server. Every line should start with OK or INFO.

  2. Run /networklock proxies on the proxy and on a game server. The key fingerprints must match.

  3. Join through the proxy. You should get in normally.

  4. Try to connect straight to a game server's address. You should be refused with:

    text
    Unable to verify your connection. Please join through the network. [NL-01]

Console output of /networklock proxies on the proxy and on a game server. The proxy shows proxy-1 with key fingerprint 1a2b:3c4d:5e6f:7a8b, and the game server lists proxy-1 with the same fingerprint, so the keys match

Illustration generated with AI and checked by Maj Kovačič.

If something does not work, see Troubleshooting.

Keep the key files private#

The proxy's config.yml holds its key, and each game server's config.yml holds the keys it trusts. On Linux, NetworkLock creates these files readable only by their owner where the file system allows it. If doctor says a config is readable by other users, run:

bash
chmod 600 plugins/NetworkLock/config.yml

Instead of writing a key in the file, you can use env:VARIABLE_NAME or file:/path/to/keyfile. See Configuration.

Firewall your game servers#

NetworkLock refuses direct logins, but you should still allow connections to your game servers' ports only from your proxies. If the game server listens on all interfaces, doctor reminds you with a WARN line.

Update#

  1. Download the new NetworkLock.jar.
  2. Stop the server or proxy, replace the jar, and start it again.
  3. Your config files and keys keep working. New options use their defaults until you add them.

Update the proxies and the game servers together where you can. Restarting is required. Do not reload the plugin with a plugin manager: on a game server, disabling NetworkLock while the server runs removes the protection until the next restart.

From 1.0.0 to 1.0.1: a network.server-id with spaces at the start or end, or longer than 64 characters, is now a config error at startup. It could never match the proxy's server name anyway.

Uninstall#

  1. Stop the server or proxy.
  2. Delete NetworkLock.jar and, if you want, its config folder.
  3. Start it again.

Once NetworkLock is gone from a game server, that server no longer checks where players come from. Make sure your firewall only lets your proxies reach it.

Switching from BungeeGuard#

  1. Remove BungeeGuard from the proxy and the game servers.
  2. Install NetworkLock on both, as above.
  3. Copy each proxy's key into the game servers' trusted-proxies.

If Velocity is set to bungeeguard forwarding, you can keep it, but modern is recommended.

Your likes

Only what this browser did. Your data on this device