Situation
John Smith Ltd has two lines with failover (see Two internet lines with
automatic failover): the fibre on eth0, priority 10, carries
the traffic; the FWA on eth2, priority 20, is the backup and stays idle almost
all the time. Two flows, though, would be better off on the FWA:
- The video archive. The CCTV NVR (192.168.10.30) keeps uploading its recordings to the security company’s cloud, which answers from the network 198.51.100.160/28. It is a constant flow, day and night, and it must not take up the offices’ fibre.
- The guest network. The guest Wi-Fi (192.168.20.0/24, VLAN 20 on
eth1, see A separate guest network on a VLAN) must not use up the offices’ line: it must go out through the FWA.
The tool is the policy route, in Network and uplinks → Routing: a criterion — where the traffic goes (the destination), where it comes from (the source: a client or an internal network) or both — and the gateway it leaves through instead of the default route. The video archive is a destination rule, the guests a source rule. Everything else, the VoIP PBX included, keeps going out through the fibre.
What you need
- Two active, confirmed gateways in Network and uplinks → Gateways: with fewer than two active gateways the policy routes section does not appear, or its button for adding one is greyed out.
- Masquerade on the second line’s zone: the traffic that leaves through
eth2must take the FWA’s address.eth2is in the WAN zone, which does this by default; if you put the second line in another zone, switch on “Masquerade (SNAT)” in that zone. - The network (or the addresses) of the security company’s cloud, as its documentation gives it: 198.51.100.160/28 in the example.
- An FWA contract without a traffic cap, or with a cap that can take a month of recordings: many FWA offers slow down or charge extra past a threshold.
Steps
Check the gateways
- Open Network and uplinks → Gateways.
eth0is “Primary”,eth2“Standby”; no row shows “To apply”. If the FWA’s gateway is saved but not applied yet, apply it first from the header and confirm: a policy route towards a gateway not yet applied reaches the kernel only with the firewall’s apply.
The video archive: a destination rule
-
Open Network and uplinks → Routing without selecting any static route. Below the list, after the page’s introduction, is the “Policy routing” section: a text that sums up how it works and, until you have created any, the line “No policy routes. Traffic follows the gateways’ priority.”.
-
Press “Add policy route”, to the right of the section’s title. The “New policy route” dialog opens.
-
Fill in:
- “Source”: leave it empty (any source);
- “Destination”:
198.51.100.160/28; - “Via gateway”:
eth2; - “Comment”:
Video archive to the cloud on the backup line; - “Enabled”: on.
The “Source” and “Destination” labels are bold while the other one is empty: at least one of the two is needed. “Via gateway” is always required.
-
Press “Create”. “Policy route applied” appears and the list gets the row “any source → 198.51.100.160/28”, with “via eth2 · Video archive to the cloud on the backup line” beneath it.
Tip You can fill in both the source and the destination: with “Source”
192.168.10.30only the NVR would go through the FWA towards that cloud, and a PC looking at the archive would stay on the fibre.
The guests: a source rule
-
Press “Add policy route” again and fill in:
- “Source”:
192.168.20.0/24; - “Destination”: leave it empty (any destination);
- “Via gateway”:
eth2; - “Comment”:
Guests on the backup line; - “Enabled”: on.
- “Source”:


- Press “Create”. The list gets the row “192.168.20.0/24 → any destination”, with “via eth2 · Guests on the backup line” beneath it. Now that there are two policy routes, the section adds: “When several rules match the same traffic, the one with the most specific destination wins, then the one with the most specific source: the list is in that order.”


Warning A policy route reaches the kernel when you save it: it does not go through “Apply” and has no 60-second confirmation window. It cannot take the console away from you on the LAN (the interfaces’ networks always win, see below), but a wrong source or destination changes the traffic’s path at once: a source such as
192.168.0.0/16would send the offices over the FWA too. Check the two fields again before pressing “Create”.
Move the NVR’s open connections
- Connections already open do not change path by themselves: each one keeps
the route and the address translation it had when it started, and the NVR’s
upload can keep its own open for a long time. Open Events and diagnostics →
Diagnostics, block “Connection tracking”, type
192.168.10.30in “Address”, press “Show” and then “Delete these connections”. The list also holds the security company’s sessions on the published NVR: they reopen by themselves. The NVR’s next packet towards the cloud opens a new connection, which leaves through the FWA. The precautions are in After a line change the phones stay on the old one.
The guests need nothing: their connections (web pages, apps) are short, and the new ones already leave through the FWA.
Which rule wins
A connection can match several policy routes: the security company’s technician on a visit who looks at the archive from the guest Wi-Fi (towards 198.51.100.160/28) falls under both the archive’s rule and the guests’. The kernel looks at them in order and the first that matches decides. Argos sets the order, not the order in which you created them:
- first the most specific destination: an address before a network, a small network before a large one, “any destination” last;
- with the same destination, the most specific source, by the same measure;
- with both the same, the order of creation.
The security company’s technician, then, follows the archive’s rule: the destination wins (here the line is the same). The list in the “Policy routing” section is already in this order, and so are the kernel’s rules: the archive has preference 3300, the guests 3301 (see “Verification”). The destination comes first because a destination tied to a line is usually a constraint that holds for every client: a service that accepts a single address, a flow that has to stay on one line.
The order really matters when two rules send traffic over different lines. The
partner’s technician, when on site, uses the guest Wi-Fi and has to reach the
systems of their office (198.51.100.25), which accept only the fibre’s fixed
address. So add a third policy route, “any source → 198.51.100.25” via eth0.
Even though you created it last, the list becomes:
| Position | Policy route | Why there |
|---|---|---|
| 1 | any source → 198.51.100.25, via eth0 | destination: an address |
| 2 | any source → 198.51.100.160/28, via eth2 | destination: a network |
| 3 | 192.168.20.0/24 → any destination, via eth2 | no destination |
With these rules:
- a guest opening any website matches only rule 3: it leaves through the FWA;
- the partner technician’s laptop, on the guest network, towards 198.51.100.25 matches rules 1 and 3: rule 1 wins, and it leaves through the fibre;
- the NVR uploading its recordings matches rule 2: FWA;
- an office PC opening a website, or a phone calling the PBX, matches none: it follows the default route, the fibre.
The same holds between two sources: a policy route for a single client of the guest network (its address) comes ahead of the one for the whole network, and that is how you make an exception. And between two overlapping destinations the more specific one decides, as in the routing table.
What a policy route decides, and what it does not
A policy route chooses the line only in place of the default route: it applies to the traffic that, without it, would go to the internet through the primary line. In practice:
-
It decides the line of the new connections that match. The traffic leaves through
eth2and takes the FWA’s address thanks to the WAN zone’s masquerade. It opens nothing in the firewall: the guests go out because theguestszone (the guests’) may already go to the WAN; the policy route only chooses which line. -
Destination rules apply to the appliance too: the Diagnostics traceroute towards the security company’s cloud leaves through the FWA as well. Source rules do not: the appliance’s own traffic (its DNS queries, the updates, the gateways’ probes) starts from its own addresses and falls under no source. With forced DNS on the guests, the names they look up are resolved by the appliance, over the fibre; their connections then leave through the FWA.
-
It does not touch the networks attached to the interfaces, the static routes (the test lab’s network, 172.16.0.0/16) and the VPN tunnels’ networks (the branch, 192.168.50.0/24): those always keep their own path. A policy route towards one of these networks changes nothing, and the appliance’s replies to the LAN’s clients never leave through a WAN.
-
It does not change the replies: with two or more active gateways, a connection that came in through a line gets its replies through the same line, ahead of any policy route. The security company’s sessions on the NVR, published on the fibre (see Publishing an internal server to authorised addresses only), stay on the fibre even if a source rule covered 192.168.10.30.
-
It follows the gateway’s state:
- line withdrawn by the monitor (the health check has declared it “Down”): its policy routes are lifted while the line is down, and the traffic they steered goes over the default route, that is the fibre; they come back by themselves when the line returns. If the FWA loses its link as well, the kernel stops using it at once, without waiting for the probes;
- gateway switched off (“Active” off in Network and uplinks → Gateways): the policy route stays saved but is not installed, and the list says so with “Gateway off: not installed until it is back on”;
- gateway deleted: the policy route is switched off and the list says “Gateway deleted: choose another one”. Open it with “Edit policy route”, choose another gateway in “Via gateway” and switch it back on.
-
It does not move connections already open, neither when you create it nor when the line fails or returns: see step 8.
For the technician Each gateway has a table of its own (1000 for the fibre, 1001 for the FWA) with its own default route. A policy route becomes
ip rule pref 3300+n [from <source>] [to <destination>] lookup <the gateway's table>, where n is its position in the order described above, counted over all policy routes, switched-off ones included (switching one off does not move the others). Ahead of them comepref 2999 lookup main suppress_prefixlength 0— the main table without its default routes: connected networks, static routes and tunnels win — and, with two active gateways, the reply rules (pref 3000+n fwmark … lookup <table>). The appliance’s traffic starts from sockets without an address, and nofromrule catches it. The rules reach the kernel when saved, live in the interfaces file’s hooks and the network’s boot pass puts them back; the nftables ruleset does not change, and the firewall button does not show “Unapplied changes”. The WAN monitor lifts the rules of a line it withdraws and puts them back when it returns; in the journal ofargos-wan-monitor:uplink eth2: withdrawn — the policy route from 192.168.20.0/24 is lifted, the default route carries itanduplink eth2: back — the policy route from 192.168.20.0/24 steers through it again. From the shell:ip rule show,ip route show table 1001,ip route get 9.9.9.9 from 192.168.20.150 iif eth1.20. With argos-cli:argos network routing policies add --source 192.168.20.0/24 --uplink eth2.
Verification
- In Network and uplinks → Routing, below the list of policy routes, is
the list of the kernel’s rules as they stand now. It must hold
2999: from all lookup main suppress_prefixlength 0and then the lines3300: from all to 198.51.100.160/28 lookup 1001and3301: from 192.168.20.0/24 lookup 1001(1001 is the table ofeth2’s gateway; the numbers may differ). The same list is in Events and diagnostics → Diagnostics, block “Policy rules”. - In Events and diagnostics → Diagnostics, tool “Traceroute”, type
198.51.100.161(an address in the security company’s cloud) in “Host” and press “Run”. The first hop is the FWA’s router, 192.168.8.1 (the same one the Gateways page shows as “via the lease’s router”). Repeat with9.9.9.9: the first hop is the fibre’s gateway, 203.0.113.9. The traceroute starts from the appliance: it checks the archive’s rule, not the guests’.


- In the same “Connection tracking” block as in step 8, with
192.168.10.30in “Address”, the NVR’s connections towards 198.51.100.160/28 show “as 192.168.8.100:…” under “Translation”, the FWA’s address. In System status → Status the card ofeth2shows the constant outbound upload. - For the guests, try from a device connected to the guest Wi-Fi: a page that shows the visitor’s public IP shows the FWA’s address. From an office PC the same page shows 203.0.113.10, the fibre.
If something goes wrong
The “Policy routing” section is missing, or “Add policy route” is greyed out. You need at least two active gateways. Check Network and uplinks → Gateways.
“Enter a source, a destination or both”. You left both fields empty: a rule like that would take all the traffic. Fill in at least one of the two.
“Not a valid IPv4 address or CIDR” under “Source” or “Destination”. The
value must be an address (192.168.10.30) or a network in CIDR form
(198.51.100.160/28); names are not allowed.
“A policy route for this source and destination already exists”. Edit the existing one with “Edit policy route” instead of creating another.
“Choose an active gateway”. The chosen gateway is switched off or no longer exists. Choose an active one.
“Applying the policy route failed — …”. The kernel refused the rule; the text after the dash is its message. The policy route is saved all the same: check that the gateways are applied and confirmed, then open it again and save it again to retry.
The NVR still uploads over the fibre. Its old connections are still in the connection tracking table: repeat step 8. If after the clean-up they go back to the fibre, the cloud uses addresses outside 198.51.100.160/28 (its name resolves to other networks): look in “Connection tracking” at which addresses the NVR goes to, ask the security company for the complete network and use that as the destination. If the FWA is “Down” in Network and uplinks → Gateways, its policy routes are lifted until it comes back: that is intended.
The guests still go out through the fibre. Check that the device has an address in 192.168.20.0/24 (is it connected to the guest Wi-Fi?) and that the policy route’s row carries no warnings. Here too, if the FWA is “Down” its policy routes are lifted until it comes back. Connections opened before the rule stay on the fibre until they end.
An office PC goes out through the FWA. There is a policy route whose source covers it (a network that is too wide) or a destination rule towards the service it is using. Look at the list: it is in the order the kernel evaluates them, and the first that matches decides.
The row says “Gateway off: not installed until it is back on”. The gateway
of eth2 is switched off: switch it back on in Network and uplinks →
Gateways and apply, or point the policy route at another gateway.
With the FWA down, the video archive takes up the fibre. That is intended: while the monitor keeps the FWA withdrawn the policy route is lifted, so that the recordings keep reaching the cloud. If the flow weighs on the offices, reduce the upload’s bandwidth from the NVR’s panel until the FWA comes back. When it does, the upload’s connections stay on the fibre: repeat step 8.
The policy route towards a LAN or VPN network does nothing. That is intended: attached networks, static routes and tunnels always keep their own path.