Skip to content
Contents
GuidesOpenWrt

Why does mwan3 ping from a different address than the OpenWrt route src?

With two IPv4 addresses on one WAN, route src is a preference. A program can bind another local address. Compare src with the SRCIP printed by mwan3 before editing routes.

With two IPv4 addresses on one WAN, route src is a preference. A program can bind another local address. Compare src with the SRCIP printed by mwan3 before editing routes.

Compare the same target

In the router SSH session, replace wan with the logical interface and 192.0.2.8 with an approved tracking target. Check that both addresses are valid. These commands read state and send probes.

ifstatus wan
ip -4 addr show
ip -4 rule show
ip -4 route get 192.0.2.8
ping -c 3 192.0.2.8
mwan3 use wan ping -c 3 192.0.2.8

On the 23.05 branch, LuCI’s Ping tracking IP uses mwan3 use, which first asks netifd for the interface address. Compare DEVICE, SRCIP and FWMARK. Check local output on 23.05.4 or custom builds. A plain lookup does not reproduce the mark automatically.

Two replies, two sources

In this isolated VM capture the target is 192.168.1.2. Plain ping used the preferred .50. The second used ping -I to select .1. Both received replies.

13:09:00.244072 IP 192.168.1.50 > 192.168.1.2: ICMP echo request, id 3099, seq 0, length 64
13:09:01.977297 IP 192.168.1.1 > 192.168.1.2: ICMP echo request, id 3100, seq 0, length 64

OpenWrt 25.12.6 · SSH · 192.168.1.50 → 192.168.1.1

The temporary address and route in the screenshot were removed at the end. Do not copy those changes to a live network. This OpenWrt 25.12.6 test demonstrates source selection only. It did not run the older LuCI.

Check background probes separately

In another SSH session run tcpdump -ni eth1 icmp on the actual exit. Separate plain ping, diagnostics and the next background probe by time. With SNAT the outgoing source is already translated.

If the exit matches but only one source gets replies, check return routing and allowed sources upstream. If exits differ, follow FWMARK to the policy table. Undo temporary changes, confirm tracking stays online and check the exit of a fresh application connection.

mwan3 · fwmark

Verify mwan3 failover and per-connection balancing across two WANs

Explore hardware

Comments