Skip to content

HAΒΆ

Mikrotik hAP ax Lite - Dual WAN Active-Passive Failover Configuration

Project OverviewΒΆ

Objective: Configure a Mikrotik hAP ax Lite router to support two internet connections (Fiber and Ztel) with automatic failover in active-passive mode.

Device: Mikrotik hAP ax Lite (RouterOS 7.7) Hardware: 2.4GHz WiFi 6 radio only (AX600)

Network ArchitectureΒΆ

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                 β”‚
β”‚                     DUAL WAN SETUP                              β”‚
β”‚                                                                 β”‚
β”‚  Fiber Modem (192.168.100.0/24)    Ztel Modem (192.168.0.0/24)  β”‚
β”‚         β”‚                                    β”‚                  β”‚
β”‚    [Ethernet Cable]                   [WiFi 2.4GHz]             β”‚
β”‚         β”‚                                    β”‚                  β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                      β”‚                                          β”‚
β”‚         ╔════════════▼════════════════╗                         β”‚
β”‚         β•‘  hAP ax Lite Router         β•‘                         β”‚
β”‚         β•‘                             β•‘                         β”‚
β”‚         β•‘  β€’ ether1: Fiber WAN        β•‘                         β”‚
β”‚         β•‘  β€’ wifi1: Ztel WAN          β•‘                         β”‚
β”‚         β•‘  β€’ wlan-ap-24: WiFi AP      β•‘                         β”‚
β”‚         β•‘  β€’ bridge-local: Client LAN β•‘                         β”‚
β”‚         β•‘  β€’ Gateway: 192.168.8.1     β•‘                         β”‚
β”‚         β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•€β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•                         β”‚
β”‚                      β”‚                                          β”‚
β”‚        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                            β”‚
β”‚        β”‚             β”‚             β”‚                            β”‚
β”‚   ether2-4       wifi 2.4GHz    bridge-local                    β”‚
β”‚  (Wired LAN)    (Wireless AP)    (DHCP Server)                  β”‚
β”‚  192.168.8.x    192.168.8.x      192.168.8.10-254               β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step-by-Step ConfigurationΒΆ

STEP 1: Configure wifi1 as Station (Ztel Connection)ΒΆ

Purpose: Connect hAP ax Lite to Ztel modem wirelessly

Path: Interfaces β†’ Wireless β†’ wifi1

Configuration:

  • Band: 2GHz-ax
  • Mode: station
  • SSID: Ztel-2.4GHz (your Ztel modem WiFi name)
  • Security: WPA2 PSK
  • WPA2 Pre-Shared Key: [your-ztel-password]
  • Country: Iran
  • Transmit Power: 20
  • Disabled: NO

Result: wifi1 connects to Ztel modem and gets IP via DHCP


STEP 2: Add DHCP Client for wifi1 (Ztel)ΒΆ

Path: IP β†’ DHCP Client β†’ Add New

Configuration:

  • Interface: wifi1
  • Use Peer NTP: NO

Result: wifi1 receives IP address from Ztel modem (192.168.0.x range)


STEP 3: Add DHCP Client for ether1 (Fiber)ΒΆ

Path: IP β†’ DHCP Client β†’ Add New

Configuration:

  • Interface: ether1
  • Use Peer NTP: NO

Result: ether1 receives IP address from Fiber modem (192.168.100.x range)


STEP 4: Physical Connection & VerificationΒΆ

Physical Setup:

  1. Plug Fiber modem cable into ether1 on hAP ax Lite
  2. Verify both connections:
  3. Go to IP β†’ Addresses
  4. Should see:
    • wifi1: 192.168.0.174/24 (Ztel) βœ“
    • ether1: 192.168.100.45/24 (Fiber) βœ“

STEP 5: Create Virtual AP for Wireless ClientsΒΆ

Purpose: Allow clients to connect wirelessly to hAP ax Lite

Path: Interfaces β†’ Wireless β†’ Add New

Configuration:

  • Name: wlan-ap-24
  • Band: 2GHz-ax
  • Mode: ap-bridge
  • SSID: Home-2.4GHz
  • Security: WPA2 PSK
  • WPA2 Pre-Shared Key: client-password (your choice)
  • Country: Iran
  • Disabled: NO

Result: Virtual AP created on same 2.4GHz radio as wifi1 (station)


STEP 6: Create Bridge for Local NetworkΒΆ

Purpose: Bridge all client ports together

Path: Interfaces β†’ Bridges β†’ Add New

Configuration:

  • Name: bridge-local
  • Protocol Mode: rstp
  • Disabled: NO

Result: Bridge created for LAN clients


STEP 7-8: Add Bridge PortsΒΆ

Purpose: Connect wired and wireless clients to bridge

Path: Bridges β†’ Ports (in Bridge menu on left sidebar)

Add These Ports:

  1. ether2 β†’ bridge-local (wired client)
  2. ether3 β†’ bridge-local (wired client)
  3. ether4 β†’ bridge-local (wired client)
  4. wlan-ap-24 β†’ bridge-local (wireless clients)

Important: DO NOT add ether1 or wifi1 to bridge (they are WAN!)


STEP 9: Assign IP to Bridge (Client Gateway)ΒΆ

Path: IP β†’ Addresses β†’ Add New

Configuration:

  • Address: 192.168.8.1/24
  • Interface: bridge-local

Result: bridge-local becomes gateway for all clients


STEP 10: Create IP Pool for DHCPΒΆ

Path: IP β†’ Pool β†’ Add New

Configuration:

  • Name: pool-clients
  • Addresses: 192.168.8.10-192.168.8.254

Result: DHCP pool defined


STEP 11: Create DHCP ServerΒΆ

Path: IP β†’ DHCP Server β†’ Add New

Configuration:

  • Name: dhcp-local
  • Interface: bridge-local
  • Address Pool: pool-clients
  • Disabled: NO

Result: DHCP server created


STEP 12: Configure DHCP NetworkΒΆ

Path: IP β†’ DHCP Server β†’ Networks tab β†’ Add New

Configuration:

  • Address: 192.168.8.0/24
  • Gateway: 192.168.8.1
  • DNS Servers: 8.8.8.8, 1.1.1.1

Result: DHCP network configured


STEP 13: Add Primary Route (Fiber - Active)ΒΆ

Path: IP β†’ Routes β†’ Add New

Configuration:

  • Dst. Address: 0.0.0.0/0
  • Gateway: 192.168.100.1 (Fiber modem gateway)
  • Distance: 1 (PRIMARY)
  • Check Gateway: ping

Result: Primary route to Fiber created


STEP 14: Add Secondary Route (Ztel - Failover)ΒΆ

Path: IP β†’ Routes β†’ Add New

Configuration:

  • Dst. Address: 0.0.0.0/0
  • Gateway: 192.168.0.1 (Ztel modem gateway)
  • Distance: 2 (SECONDARY)
  • Check Gateway: ping

Result: Secondary failover route to Ztel created


STEP 15: Configure Health Monitoring (Netwatch)ΒΆ

Path: Tools β†’ Netwatch

Monitor 1 - Fiber Gateway:

  • Host: 192.168.100.1
  • Type: icmp
  • Timeout: 5s
  • Up Script: :log info "Fiber online"
  • Down Script: :log warning "Fiber down, switching to Ztel"

Monitor 2 - Ztel Gateway:

  • Host: 192.168.0.1
  • Type: icmp
  • Timeout: 5s
  • Up Script: :log info "Ztel online"
  • Down Script: :log warning "Ztel down"

Result: Gateway health monitoring configured


STEP 16: Configure NAT Rule 1 (Fiber)ΒΆ

Path: IP β†’ Firewall β†’ NAT β†’ Add New

Configuration:

  • Chain: srcnat
  • Out. Interface: ether1
  • Action: masquerade
  • Comment: NAT Fiber WAN

Result: Clients can access internet via Fiber


STEP 17: Configure NAT Rule 2 (Ztel)ΒΆ

Path: IP β†’ Firewall β†’ NAT β†’ Add New

Configuration:

  • Chain: srcnat
  • Out. Interface: wifi1
  • Action: masquerade
  • Comment: NAT Ztel WAN

Result: Clients can access internet via Ztel


STEP 18: Configure Firewall Input RuleΒΆ

Path: IP β†’ Firewall β†’ Filter

Rule 0 - INPUT chain:

  • Chain: input
  • Connection State: Check established, related, untracked, new
  • Action: accept
  • Comment: Allow input

Result: Router can receive packets


STEP 19: Configure Firewall Output RuleΒΆ

Path: IP β†’ Firewall β†’ Filter β†’ Add New

Rule 1 - OUTPUT chain:

  • Chain: output
  • Connection State: Check established, related, untracked, new
  • Action: accept
  • Comment: Allow output

Result: Router can send packets


STEP 20: Configure Firewall Return Traffic RulesΒΆ

CRITICAL: These rules allow response packets to return from internet to clients

Path: IP β†’ Firewall β†’ Filter β†’ Add New

Rule 2 - ether1 β†’ bridge-local (Fiber return):

  • Chain: forward
  • In. Interface: ether1
  • Out. Interface: bridge-local
  • Connection State: Check established, related, untracked (NO new!)
  • Action: accept
  • Comment: Allow Fiber return traffic

Rule 3 - wifi1 β†’ bridge-local (Ztel return):

  • Chain: forward
  • In. Interface: wifi1
  • Out. Interface: bridge-local
  • Connection State: Check established, related, untracked (NO new!)
  • Action: accept
  • Comment: Allow Ztel return traffic

Result: Internet responses can reach clients


STEP 21: Configure Firewall Forward Traffic RulesΒΆ

Purpose: Allow clients to send traffic to internet

Path: IP β†’ Firewall β†’ Filter β†’ Add New

Rule 4 - bridge-local β†’ ether1 (Fiber forward):

  • Chain: forward
  • In. Interface: bridge-local
  • Out. Interface: ether1
  • Connection State: Check new, established, related, untracked
  • Action: accept
  • Comment: Allow to Fiber

Rule 5 - bridge-local β†’ wifi1 (Ztel forward):

  • Chain: forward
  • In. Interface: bridge-local
  • Out. Interface: wifi1
  • Connection State: Check new, established, related, untracked
  • Action: accept
  • Comment: Allow to Ztel

Result: Clients can send packets to internet


STEP 22: Configure DNSΒΆ

Path: IP β†’ DNS

Configuration:

  • Servers: 8.8.8.8, 1.1.1.1
  • Allow Remote Requests: YES

Result: DNS queries work


TestingΒΆ

Test 1: Verify WiFi AP is BroadcastingΒΆ

  1. On phone/laptop, scan WiFi networks
  2. Look for Home-2.4GHz SSID
  3. Expected: SSID visible βœ“

Test 2: Connect Wireless ClientΒΆ

  1. Connect to Home-2.4GHz
  2. Enter password: client-password
  3. Check IP address: Should be 192.168.8.x
  4. Expected: Client gets IP from DHCP βœ“

Test 3: Test Internet Access (Fiber Primary)ΒΆ

ping 8.8.8.8

Expected: Responses from Fiber connection βœ“


Test 4: Test Failover (Fiber β†’ Ztel)ΒΆ

  1. Client is connected and internet working
  2. Unplug Fiber cable from ether1
  3. Wait 5-10 seconds (netwatch timeout)
  4. Try ping 8.8.8.8 again
  5. Expected: Internet continues via Ztel βœ“

Test 5: Test Failover Recovery (Ztel β†’ Fiber)ΒΆ

  1. Plug Fiber cable back into ether1
  2. Wait 5-10 seconds
  3. Verify internet still works
  4. Expected: Traffic switches back to Fiber βœ“

Test 6: Test Wired Client (Optional)ΒΆ

  1. Plug ethernet cable into ether2, ether3, or ether4
  2. Should receive 192.168.8.x IP from DHCP
  3. Internet should work
  4. Expected: Wired client works βœ“

Final Configuration SummaryΒΆ

Component Configuration Status
WAN - Fiber ether1 (DHCP) 192.168.100.x
WAN - Ztel wifi1 (Station) 192.168.0.x
Wireless AP wlan-ap-24 Home-2.4GHz
LAN Bridge bridge-local 192.168.8.1/24
DHCP Server dhcp-local 192.168.8.10-254
Routing Distance 1 (Fiber) Primary
Routing Distance 2 (Ztel) Failover
Health Check Netwatch Fiber & Ztel
NAT srcnat ether1 Fiber masquerade
NAT srcnat wifi1 Ztel masquerade
Firewall Input/Output Allow all
Firewall Forward rules Bidirectional

Key Lessons LearnedΒΆ

1. Firewall Rule Order MattersΒΆ

  • Rules are evaluated top-to-bottom
  • First matching rule wins
  • General rules block specific rules below them

2. Return Traffic Must Be AllowedΒΆ

  • Clients need TWO rules for each WAN:
  • One for sending traffic (client β†’ WAN)
  • One for receiving responses (WAN β†’ client)
  • Without return rules, traffic gets stuck

3. Connection State Is CriticalΒΆ

  • New traffic: Use new, established, related, untracked
  • Return traffic: Use established, related, untracked (NO new!)
  • Wrong settings = packets get dropped

4. No In. Interface in NAT srcnatΒΆ

  • RouterOS doesn't support In. Interface in srcnat chain
  • NAT rules only need Out. Interface

5. Don't Bridge WAN InterfacesΒΆ

  • WAN interfaces (ether1, wifi1) should stay independent
  • Only LAN ports should be bridged
  • Bridging WANs causes conflicts with routing

6. Hardware LimitationsΒΆ

  • hAP ax Lite has only 2.4GHz (no 5GHz)
  • Must use same radio for station + AP
  • Both run simultaneously via virtual interfaces

Troubleshooting ChecklistΒΆ

  • Both modems have IPs in Addresses list (IP β†’ Addresses)
  • Routes show correct distances (IP β†’ Routes)
  • NAT rules have correct Out. Interface (IP β†’ Firewall β†’ NAT)
  • Firewall rules have correct Chain and Connection State (IP β†’ Firewall β†’ Filter)
  • Bridge ports include wlan-ap-24 (Bridges β†’ Ports)
  • DHCP server is enabled (IP β†’ DHCP Server)
  • wifi1 is in station mode (Interfaces β†’ Wireless)
  • wlan-ap-24 is in ap-bridge mode (Interfaces β†’ Wireless)

Performance NotesΒΆ

Bandwidth Sharing:

  • Both Fiber and Ztel are independent WAN connections
  • No bandwidth sharing during normal operation
  • Failover is automatic and transparent to clients

Latency:

  • Primary (Fiber): Direct route via ether1
  • Failover (Ztel): Direct route via wifi1
  • Both routes are low-latency (same physical location)

Failover Time:

  • Detection: 5-10 seconds (netwatch timeout)
  • Switching: Automatic via distance-based routing
  • Client impact: None (connection stays alive during switch)

Additional NotesΒΆ

Why This Architecture WorksΒΆ

  1. Active-Passive: Fiber is always primary (distance=1), Ztel is standby (distance=2)
  2. Automatic Failover: When Fiber unreachable, netwatch triggers, routes switch automatically
  3. No Split-Tunneling: All clients use single gateway (192.168.8.1)
  4. NAT Handles Both WANs: Each WAN interface has its own masquerade rule
  5. Firewall Protects Both Routes: Rules allow traffic in both directions

Future ImprovementsΒΆ

  • Add redundant AP (second hAP ax Lite) for client coverage
  • Configure traffic limiting per client (QoS)
  • Add DNS failover (local DNS server)
  • Monitor link status with SNMP
  • Configure automatic backup via second Fiber modem

ConclusionΒΆ

Your Mikrotik hAP ax Lite is now configured for dual WAN active-passive failover with:

βœ“ Two independent internet connections βœ“ Automatic failover from Fiber to Ztel βœ“ Automatic recovery when Fiber returns βœ“ Wireless and wired client support βœ“ Full internet access on both WANs

The system is ready for production use!


Configuration Date: January 2, 2026 RouterOS Version: 7.7 (stable) Device: Mikrotik hAP ax Lite