This script is designed to help you set up basic DDoS protection for your FiveM server with txAdmin
. It configures IPTables, Fail2Ban, and installs necessary tools like iftop
and nload
for monitoring.
- DDoS Protection: Rate limits UDP and TCP traffic on FiveM ports.
- Fail2Ban Setup: Protects against brute-force attacks on txAdmin and SSH.
- MySQL Access Control: Allows you to restrict MySQL access to specific IPs (e.g., home IP or VPN).
- SSH Access: Ensures that SSH access is always available, preventing server lockouts.
- Monitoring Tools: Installs
iftop
andnload
for real-time network traffic monitoring.
- A server running Linux (Debian-based systems like Ubuntu recommended)
- Python 3 installed
IF NOT INSTALLED RUN:
apt-get install python3
Clone or download the script to your server.
Run the following command to make the script executable:
chmod +x main.py
Execute the script with:
sudo python3 main.py
The script will ask if you want to secure MySQL access to specific IP addresses. You can enter your home IP or VPN IP to restrict access.
After the script runs, you can monitor your server's traffic in real-time using the following commands:
- iftop: Displays active network connections
sudo iftop
- nload: Shows incoming and outgoing traffic rates
sudo nload
- FiveM port (default: 30120) and txAdmin port (default: 40120) are rate-limited to prevent DDoS attacks.
- MySQL port (3306) is secured to allow access only from trusted IPs if chosen during setup.
- SSH (default: 22) is always allowed, ensuring you don’t lose server access.
- Protects txAdmin login by banning IPs after multiple failed login attempts.
- SSH brute-force protection is enabled by default.