Install NetworkLock
Set up NetworkLock on Velocity, BungeeCord or Waterfall and on Paper, Folia, Spigot, Sponge or Paper fork game servers.
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.
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.jarfrom the 1.0.1 release. SHA-256:dac1de11bfee44c9a2a6b5a37e8bf67552f4e584c505626559438eeb2afeb51e.
Where the files go#
| Platform | Jar goes in | Config file |
|---|---|---|
| Velocity | plugins/ | plugins/networklock/config.yml and messages.yml |
| BungeeCord, Waterfall | plugins/ | plugins/NetworkLock/config.yml and messages.yml |
| Paper, Folia, Spigot and their forks | plugins/ | plugins/NetworkLock/config.yml |
| Sponge | mods/ | config/networklock/config.yml |
Proxies have a messages.yml. Game servers only have config.yml.
Step 1: set up the proxy#
-
Stop the proxy and put
NetworkLock.jarin itspluginsfolder. -
Start the proxy once. NetworkLock creates
config.ymlandmessages.yml, generates a random key, and logs: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. -
Open the proxy's
config.yml. Note thenetwork.id(defaultproxy-1) and copy the value ofsecurity.key. Keep the key private. -
If you run more than one proxy, give each one its own
network.id, for exampleproxy-1andproxy-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:
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#
-
Stop the server and put
NetworkLock.jarinplugins/(on Sponge, inmods/). -
Start the server once. NetworkLock creates its
config.yml. Until you fill it in, the server lets nobody join and logs aLOCKDOWNline. That is expected. -
Open the server's
config.ymland fill in two things: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"] -
If players come through more than one proxy, add one entry per proxy, each with its own
idand key. -
Run
/networklock reloadin the server console. You should seeConfiguration reloaded. -
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#
-
Run
/networklock doctoron the proxy and on each game server. Every line should start withOKorINFO. -
Run
/networklock proxieson the proxy and on a game server. The key fingerprints must match. -
Join through the proxy. You should get in normally.
-
Try to connect straight to a game server's address. You should be refused with:
Unable to verify your connection. Please join through the network. [NL-01]
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:
chmod 600 plugins/NetworkLock/config.ymlInstead 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#
- Download the new
NetworkLock.jar. - Stop the server or proxy, replace the jar, and start it again.
- 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#
- Stop the server or proxy.
- Delete
NetworkLock.jarand, if you want, its config folder. - 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#
- Remove BungeeGuard from the proxy and the game servers.
- Install NetworkLock on both, as above.
- 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.