[strongSwan] Problem with mark_out on re-marked packets

Felipe Arturo Polanco felipeapolanco at gmail.com
Mon Oct 22 17:19:10 CEST 2018


We are facing a strange issue where if a packet is re-marked by
iptables Strongswan doesn't allow it to go out to the tunnel.

myvpn1 (site to site)
mark_in = 1
mark_out = 1
local_ts =
remote_ts =

myvpn2 (site to site)
mark_in = 2
mark_out = 2

The traffic is to be forwarded between myvpn1 and myvpn2: Src dst
We mark the traffic coming from myvpn1 with :
iptables -t mangle -I PREROUTING -s a.a.a.a/32 -j MARK --set-xmark 1
a.a.a.a is the public IP of myvpn1.

That way we satisfy the condition of mark_in for myvpn1.
We see the packet coming in as the 'in' counter increases and TCPdump shows
the decapsulated packet.

We have this other rule in iptables:
iptables -t mangle -I POSTROUTING -d -j MARK --set-xmark 2
With this we mark all traffic destined to with a mark of 2.

The problem is that the packets remarked from 1 to 2 are not going through
the tunnel at all, the 'out' counter of myvpn2 doesn't increase.

We do see the packet being correctly remarked to '2' using Iptables trace
in the raw table.

If we change mark_out to 1 in myvpn2 and remove the set-xmark 2 from
iptables it works fine and the packet gets forwarded.

Any idea what could be the trouble in here?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20181022/363d1ec4/attachment.html>

More information about the Users mailing list