WireGuard VPN with MikroTik IP Management -- 3

Job ID: 39206535

Budget: $10 – $30 USD

Objective
The goal of this project is to set up a dual-server WireGuard VPN system with a MikroTik router handling IP address assignment and traffic routing. This setup will allow clients to connect to the VPN and dynamically receive an IP address from a predefined pool, ensuring that previously assigned IPs are not reused.

1️⃣ WireGuard VPN Dual-Server Setup
Two Ubuntu servers (Server 1 as the entry point, Server 2 as the exit point) will be configured to work with a MikroTik router, which will manage IP allocation.

1.1 WireGuard Installation & Configuration
Install WireGuard on both Ubuntu servers.
Configure WireGuard interfaces with persistent settings.
Enable IP forwarding for traffic routing.
Apply firewall rules for security.
Ensure WireGuard starts automatically on reboot.
1.2 Traffic Forwarding & NAT Configuration
Server 1: Accepts client connections and forwards traffic to Server 2.
Server 2: Routes outgoing traffic while hiding the original client’s identity.
Configure MikroTik Router as the traffic handler between servers.
Implement Masquerading (NAT) on MikroTik for efficient IP masking.
Prevent DNS leaks by routing all traffic securely through WireGuard.
1.3 Connectivity Testing & Validation
Verify active WireGuard peers using wg show.
Ensure IP forwarding is enabled (sysctl net.ipv4.ip_forward).
Confirm correct external IP assignment using curl ifconfig.me.
Test ping responses between VPN clients and servers.
Ensure VPN automatically restarts on reboot (systemctl status wg-quick@wg0).
? Deliverables: ✅ Screenshots/logs of WireGuard installation & configuration.
✅ Output of wg show verifying active peers.
✅ Results of curl ifconfig.me showing correct routing.
✅ MikroTik NAT & firewall configuration files.
✅ VPN auto-start verification.

2️⃣ MikroTik Router Integration for Dynamic IP Allocation
A MikroTik router will be integrated into the VPN system to dynamically assign IP addresses to VPN clients from a predefined pool.

2.1 MikroTik Router Configuration
Configure MikroTik as an intermediary router between VPN servers.
Set up IP pools for dynamic allocation.
Implement DHCP server or manual IP mapping for WireGuard clients.
Assign public IPs from the pool when a new client connects.
2.2 Dynamic IP Assignment & Rotation
Clients receive a new IP address when they reconnect.
Used IPs are marked as unavailable to prevent duplication.
The system ensures at least 50 simultaneous connections.
2.3 Security & Optimization
Implement Fail2Ban on MikroTik to prevent unauthorized access.
Enable firewall rules to allow only VPN and SSH traffic.
Optimize routing for better connection speeds.
2.4 Testing & Validation
Test client IP assignment to confirm dynamic allocation.
Verify IP rotation logic using MikroTik logs.
Conduct load testing for at least 50 concurrent connections.
? Deliverables: ✅ MikroTik configuration files for dynamic IP assignment.
✅ Proof of successful IP allocation & rotation.
✅ Security settings (firewall, Fail2Ban) logs.
✅ Screenshots/logs verifying connection handling for multiple clients.

3️⃣ Documentation & User Guide
A detailed setup and management guide for WireGuard with MikroTik will be provided.

3.1 Deployment & Setup Guide
Step-by-step installation instructions for WireGuard.
Configuring MikroTik for IP management.
Connecting VPN clients and verifying IP assignments.
3.2 Troubleshooting & Optimization
Fixing common VPN connectivity issues.
Debugging MikroTik IP assignment issues.
Performance optimization for better speeds.
? Deliverables: ✅ PDF or Markdown documentation with step-by-step setup.
✅ Annotated screenshots explaining the configuration.
✅ A troubleshooting guide for debugging issues.