# IPSec/Strongswan updown errors in log

**URL:** <https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645>\
**Category:** VPNs\
**Created:** [20 March 2020 18:08 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645 "2020-03-20T18:08:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![trymes](https://community.ipfire.org/user_avatar/community.ipfire.org/trymes/32/10816_2.png) [@trymes](https://community.ipfire.org/u/trymes)\
**Post date:** [20 March 2020 18:08 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/1 "2020-03-20T18:08:19Z")

</div>

While digging around in the logs for something else, I stumbled across a number of messages like this:

```
Mar 16 08:09:51 myhost charon: 15[CHD] updown: iptables: Bad rule (does a matching rule exist in that chain?).
Mar 16 08:09:51 myhost charon: 15[CHD] updown: iptables: No chain/target/match by that name.

```

Any ideas as to what’s causing this? Bad configuration on my part, or should I open a bug?

I’m guessing that the problem lies somewhere in /usr/libexec/ipsec/\_updown ?

Tom

---

<div class="post-metadata">

**Author:** ![ms](https://community.ipfire.org/user_avatar/community.ipfire.org/ms/32/16615_2.png) [@ms](https://community.ipfire.org/u/ms)\
**Post date:** [21 March 2020 11:33 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/2 "2020-03-21T11:33:54Z")

</div>

Not really a problem, because the script tries to clear rules that are no longer there anyways.

Probably the firewall chain was flushed or something else.

---

<div class="post-metadata">

**Author:** ![jon](https://community.ipfire.org/user_avatar/community.ipfire.org/jon/32/15363_2.png) [@jon](https://community.ipfire.org/u/jon)\
**Post date:** [21 May 2026 23:17 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/3 "2026-05-21T23:17:03Z")

</div>

I was trying to fix my other ipsec issue and I stumbled across this same error (and went down the rabbit hole!)

The last three items in this area are:  
`iptables --wait -D IPSECINPUT`  
and they should be:  
`iptables --wait -D IPSECOUTPUT`

in file `/usr/libexec/ipsec/_updown`:

```auto
	# Close firewall for incoming and outgoing IPinIP + AH + ESP traffic to the peers' IP
	iptables --wait -D IPSECINPUT -i $PLUTO_INTERFACE -p IPIP \
		-s $PLUTO_PEER $S_PEER_PORT \
		-d $PLUTO_ME $D_MY_PORT -j ACCEPT
	iptables --wait -D IPSECINPUT -i $PLUTO_INTERFACE -p AH \
		-s $PLUTO_PEER $S_PEER_PORT \
		-d $PLUTO_ME $D_MY_PORT -j ACCEPT
	iptables --wait -D IPSECINPUT -i $PLUTO_INTERFACE -p ESP \
		-s $PLUTO_PEER $S_PEER_PORT \
		-d $PLUTO_ME $D_MY_PORT -j ACCEPT
# iptables --wait -D IPSECINPUT -o $PLUTO_INTERFACE -p IPIP \
# -s $PLUTO_ME $D_MY_PORT \
# -d $PLUTO_PEER $S_PEER_PORT -j ACCEPT
# iptables --wait -D IPSECINPUT -o $PLUTO_INTERFACE -p AH \
# -s $PLUTO_ME $D_MY_PORT \
# -d $PLUTO_PEER $S_PEER_PORT -j ACCEPT
# iptables --wait -D IPSECINPUT -o $PLUTO_INTERFACE -p ESP \
# -s $PLUTO_ME $D_MY_PORT \
# -d $PLUTO_PEER $S_PEER_PORT -j ACCEPT
	iptables --wait -D IPSECOUTPUT -o $PLUTO_INTERFACE -p IPIP \
		-s $PLUTO_ME $D_MY_PORT \
		-d $PLUTO_PEER $S_PEER_PORT -j ACCEPT
	iptables --wait -D IPSECOUTPUT -o $PLUTO_INTERFACE -p AH \
		-s $PLUTO_ME $D_MY_PORT \
		-d $PLUTO_PEER $S_PEER_PORT -j ACCEPT
	iptables --wait -D IPSECOUTPUT -o $PLUTO_INTERFACE -p ESP \
		-s $PLUTO_ME $D_MY_PORT \
		-d $PLUTO_PEER $S_PEER_PORT -j ACCEPT
	;;

```

no more bad rule…

---

<div class="post-metadata">

**Author:** ![trymes](https://community.ipfire.org/user_avatar/community.ipfire.org/trymes/32/10816_2.png) [@trymes](https://community.ipfire.org/u/trymes)\
**Post date:** [22 May 2026 00:29 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/4 "2026-05-22T00:29:02Z")

</div>

Well…I’ll be.

Thoughts, @ms ?

---

<div class="post-metadata">

**Author:** ![bonnietwin](https://community.ipfire.org/user_avatar/community.ipfire.org/bonnietwin/32/12350_2.png) [@bonnietwin](https://community.ipfire.org/u/bonnietwin)\
**Post date:** [22 May 2026 09:03 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/5 "2026-05-22T09:03:50Z")

</div>

Not sure but does the patch mentioned here

[https://community.ipfire.org/t/firewall-rules-for-ipsec-network-apparently-generated-multiple-times/15630/6](https://community.ipfire.org/t/firewall-rules-for-ipsec-network-apparently-generated-multiple-times/15630/6)

fix that issue?

It is in CU202.

---

<div class="post-metadata">

**Author:** ![ms](https://community.ipfire.org/user_avatar/community.ipfire.org/ms/32/16615_2.png) [@ms](https://community.ipfire.org/u/ms)\
**Post date:** [22 May 2026 09:44 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/6 "2026-05-22T09:44:12Z")

</div>

I don’t know what you are asking me 🙂

So there has been a bug where every time a tunnel was brought up - or even renegotiated - a set of firewall rules were created but never removed.

This did not have any downsides apart from the table to be getting longer and longer. Eventually that could have harmed performance of the firewall slightly because it would have to consider more rules, but that is more of a theoretical problem.

The changes that you pointed have been implemented in this patch:

> **[git.ipfire.org Git - ipfire-2.x.git/commitdiff](https://git.ipfire.org/?p=ipfire-2.x.git&a=commitdiff&h=e2cafa8efa1cd25f592952e20cdd93f5e04a6bb3)**

These changes are included in Core Update 202 which we are looking to release early next week.

So, thank you for confirming that we fixed the problem 🙂

---

<div class="post-metadata">

**Author:** ![trymes](https://community.ipfire.org/user_avatar/community.ipfire.org/trymes/32/10816_2.png) [@trymes](https://community.ipfire.org/u/trymes)\
**Post date:** [22 May 2026 11:07 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/7 "2026-05-22T11:07:47Z")

</div>

I’m trying to figure out which part of this is weirder: someone replying to my six year old post with a fix, or that the issue just happens to have recently been fixed by someone else and is included in the forthcoming update.

---

<div class="post-metadata">

**Author:** ![jon](https://community.ipfire.org/user_avatar/community.ipfire.org/jon/32/15363_2.png) [@jon](https://community.ipfire.org/u/jon)\
**Post date:** [22 May 2026 17:02 UTC](https://community.ipfire.org/t/ipsec-strongswan-updown-errors-in-log/1645/8 "2026-05-22T17:02:25Z")

</div>

My bad. I didn’t realize the recent patch fixed the issue.
