Configuring IPFire Firewall to Connect to ApexGuard
Prerequisites
- IPFire (version 2.27 or later).
- ApexGuard IKEv2 credentials:
- Server address (e.g.
ikev2.apexguard.com) - Pre-Shared Key (PSK), often listed under “Service Credentials” or “Manual Setup.”
- Server address (e.g.
- Your LAN Subnet (e.g.,
192.168.0.0/24). - Access to the IPFire Web UI (usually
https://[IP_of_IPFire]:444).
1. Log in to the IPFire Web UI
- Open a browser → go to
https://[IP_of_IPFire]:444. - Enter your admin credentials.
2. Enable IPsec on IPFire
- In the top menu, go to Firewall → IPsec.
- If the IPsec subsystem is stopped, click Start or Enable.
3. Add a New IPsec Connection
- Under IPsec, find Connection Status and Control.
- Click Add (or New IPsec connection).
4. Basic Connection Settings
- Connection name: Enter something like
ApexGuard-PSK. - Local Subnet:
- If you want all LAN traffic to go through ApexGuard, leave this as your LAN subnet (e.g.,
192.168.0.0/24).
- If you want all LAN traffic to go through ApexGuard, leave this as your LAN subnet (e.g.,
- Remote Subnet:
- If ApexGuard supports sending “all traffic,” you might set it to
0.0.0.0/0. - Some providers just require
0.0.0.0/0for a full-tunnel.
- If ApexGuard supports sending “all traffic,” you might set it to
- Gateway (Remote host/IP):
ikev2.apexguard.com(or whichever server domain or IP your account shows).
5. Authentication Method: Pre-Shared Key
- Under Authentication Method, select PSK (Pre-Shared Key).
- Pre-Shared Key: Copy/paste your key from ApexGuard.
(If ApexGuard also gave you a username/password for XAUTH/EAP, see Guide 2.)
6. Phase 1 & Phase 2 (IKE & ESP) Settings
- Phase 1 (IKE proposal): For a typical setup, pick a strong cipher set like
aes256-sha256-modp2048or as recommended by ApexGuard. - Phase 2 (ESP proposal): Similar approach (e.g.
aes256-sha256). - Key lifetime: Common defaults: 28800s (IKE), 3600s (ESP). Match ApexGuard’s suggestions if they have them.
7. Save & Start the Connection
- Click Save.
- On the IPsec overview, your new connection
ApexGuard-PSKappears. - Toggle it Enabled and click Save or Start to bring it up.
8. Verify the Tunnel
- Check the Connection Status under IPsec → Connection Status and Control.
- A successful tunnel typically shows Established or Connected.
- Go to Logs → System Logs → IPsec to see “IKE negotiation successfully completed” or similar.
9. NAT (If Needed)
- Many home setups have the LAN behind IPFire using Masquerading on the RED/WAN interface.
If ApexGuard requires all LAN traffic be NATed through the VPN, you may add a custom firewall rule:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ipsec0 -j MASQUERADE
- Replace:
192.168.0.0/24with your LAN.ipsec0with the actual IPsec interface name (sometimesipsec1or similar).
10. Test Your Connection
- From a LAN device (e.g., a PC at
192.168.0.x), go to “What’s my IP” or the ApexGuard dashboard. - If everything is correct, you’ll see your public IP is the ApexGuard IP, confirming all traffic is going through the tunnel.
Was this article helpful?
Thank you, you're making us better!