Hands-on tutorial
Tutorials · Routing & Internet
How to Use Policy-Based Routing to Send Traffic Over Different Internet Links
Send VoIP and business apps over the fibre link, guests over the backup line, and keep failover working, with policy-based routing rules on the gateway.
Before you start
- A gateway with two WAN links
- The subnets or VLANs of each user group
- The addresses or ports of the applications you want to steer
Step by step
Decide the policy
Write it as plain rules first: staff VLAN uses WAN1, guest VLAN uses WAN2, VoIP to the provider's servers uses WAN1, backups at night use WAN2.
Create one routing table per link
Each WAN gets its own route table with its own default route, so rules can point at a table.
Add rules from specific to general
Rules are checked in order. Put application rules first, then per-VLAN rules, then the default.
ip rule add from 192.168.50.0/24 table wan2 priority 100 ip rule add to 203.0.113.10/32 table wan1 priority 90
Keep failover
Each rule must fall back to the other link if its link is down. Use the gateway's link monitoring so a dead link is removed from all tables.
Handle NAT and return traffic
Each link needs its own NAT. Sessions must leave and return on the same link, or remote servers will drop them.
Test each rule
From a client in each group, check the public IP address and run a traceroute. Then unplug one link and check that everything moves to the other.
curl -s https://ifconfig.co traceroute 9.9.9.9
Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.
Pro tips
- Keep the rule list short and commented.
- Steering by domain name is less reliable than by address or port, because cloud services change addresses.
- Remember that VPN tunnels should follow the link they were built on.
FAQ
Frequently asked questions
Is this the same as load balancing?
No. Load balancing spreads sessions across links automatically; policy-based routing decides by rule. Many gateways combine both.
Will one download use both links?
No. Each session uses one link; total throughput rises only with many sessions.
Keep learning
Related guides
Dual-WAN and 4G failover
Read more →NAT and port forwarding safely
Read more →Monitor WAN latency and loss
Read more →How to Set Up Dual-WAN Failover With a 4G LTE Backup
Keep a branch online when the fibre fails: add a 4G LTE link as a backup WAN with health checks and automatic failover.
Read more →How to Plan IP Addressing and Subnets for a Business Network
A clean IP plan makes networks easier to secure, troubleshoot and grow. Learn a simple scheme you can reuse on every site.
Read more →How to Configure DHCP Scopes, Reservations and Options
Hand out addresses reliably: one scope per VLAN, reservations for printers and cameras, the right DNS and gateway options and sensible lease times.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.