[RESOLVED] Destination NAT also changes source IP?


I’ve installed a Vyos VM, and outbound loadbalancing works fine.

Inbound connections have a weird behavior though… When an inbound connection comes in, the destination is correctly translated, but the SOURCE is translated as well, and Vyos uses the WAN IP for that…

WAN host
LAN server:
WAN gateway:
Vyos WAN IP:
Vyos LAN IP:

When I tcpdump the incoming connection on both WAN and LAN interfaces (-i any), I see the following for every packet: -> -> -> ->

What I’d expect to see: -> -> -> ->

I’ve attached the config.boot (scrubbed and IP subnet-addresses anonymized) to the post.

Can anyone tell me what is wrong with this config, or is this a bug?


I would try switching eth+ to eth1 in your DNAT rules. Also your SNAT rule 50 doesn’t look necessary to me.


Tried eth1, eth+, doesn’t make a difference! :frowning:
I added SNAT rule 50 to try resolve the problem, but that didn’t make a difference either!


what about using tcpdump on each individual interface to split up the viewing of the flow. it might help narrow down where exactly the problem is happening. you could also check iptables to make sure the VyOS config layer matches the underlying firewall sets.


I did the ‘-i any’ to see both flows to be able to correlate, but also did the individual ones…

When I did the individual ones, I’d see:
Eth0 (LAN side): -> ->

Eth1 (WAN side): -> ->

However, your suggestion to look at the iptables helped resolve my problem, as ‘iptables -L -t nat’ does show IMHO the problem:

Chain WANLOADBALANCE (1 references)
pkts bytes target prot opt in out source destination
89264 5356K SNAT all – any any anywhere anywhere connmark match 0x1 to:
3916 235K SNAT all – any any anywhere anywhere connmark match 0x2 to:

So I started looking in to the load-balancing section and found:
set load-balancing wan disable-source-nat

This resolved the SNAT on onbound connections issue…

Now onward with testing!