Have you ever wanted to protect your offline server from griefers, especially when default user whitelisting can be easily bypassed? With this simple, config-based mod, you can now do that! This is a server-sided mod so you will only need to install it on your server.
It is really easy to set this up:
- Install the mod onto your server
- Add your IPs that should be able to join the server to the ipwhitelist.txt file
- Restart the server for changes to take effect
Important Locations:
ipwhitelist.txt: \config\ipwhitelist.txt
ipwhitelist-server.toml: \world\serverconfig\ipwhitelist-server.toml
ip_attempts.log: \logs\ip_attempts.log
Features:
Supports IP Patterns: 127.*.*.* or 127.*.10.21 or 127.0.0.*
IP Logging: Logs connection attempts to the ip_attempts.log file
Examples:
This is how the ipwhitelist.txt file can look like:
127.0.0.1
10.255.255.*
172.31.255.255
188.*.*.*
Q: How do I know if this works?
A: If you just added the mod and try to connect to the server you will get disconnected. Then the mod is working and you havent set up your IPs in the ipwhitelist.txt file and get disconnected with the following message: "Your IP is not whitelisted."
The console will also log the loaded mod state and ip patterns (if it works):
[net.cyberking42.ipwhitelist.IpWhitelistMod/]: Starting IP Whitelist Mod (Server-side)
[net.cyberking42.ipwhitelist.IpWhitelistMod/]: IP whitelist file is empty. No IPs loaded.
What would happen if two IPs were added to the ipwhitelist.txt file:
[net.cyberking42.ipwhitelist.IpWhitelistMod/]: Loaded 2 IP patterns into the whitelist.