WUI Error when adding new firewall rule

After updating to core 195 I can not create new firewall rule when src and dst is subnet it shows error message as below image (Blue network → Green network). even some existing rules not working i see DROP_FORWARD in logs. not sure if this started with core 195.

While investigating, I found in firewall.cgi (Core 195) starting from line 879 to 883, the script sets the errormessage by concatenating the source IP and CIDR with the target IP and CIDR, just before the actual check happens.

Is this the intended behavior or am I missing something?
I compared this with Core 189, and this part was not present there.

I can confirm what you are seeing.

The section that you highlight was changed in CU195.

Unfortunately it looks like no Testing user tested out the Firewall Rules WUI page as this was not flagged up at all.

EDIT:
Looking closer at the section, the only thing changed is the error message. The problem is that the same subnet for src and dst is being triggered when they are not the same.

Changes were made elsewhere in firewall.cgi related to the introduction of WireGuard. Maybe some of those changes impacted the “same subnet” check.
That will need to be looked at further.

I will raise a bug report on this.

A bug report has been raised.
https://bugzilla.ipfire.org/show_bug.cgi?id=13860

4 Likes

I have same problem from OpenVPN network to Green. network.

The fix has been created and merged into CU195.

To access the fix you need to update your CU195 install.
To do this change the value in

/opt/pakfire/db/core/mine

from 195 to 194 and then go to the pakfire page and you will find that an update from 194 to 195 is shown as available there.

Upgrade and it will install the latest updated version of CU195.

2 Likes

Sorry, Adolf, but that’s a messy solution ^^

If errors creep in that require a bug fix, we should also increase the version number → CU195.1 or CU195-1 or anything else, but not increasing the version number is a really bad idea in my opinion ^^

all users who encounter this error will open a thread about it - Maintaining the current release number only causes confusion

Don’t get me wrong but that’s my opinion

2 Likes

Hi all,

If you’re affected by the firewall rule creation error in Core Update 195 — particularly when trying to define both source and destination as subnets — a quick workaround is to manually apply the fix from the official Git repository.

Steps to manually apply the fix:

  1. Backup the Existing File
cp /srv/web/ipfire/cgi-bin/firewall.cgi /srv/web/ipfire/cgi-bin/firewall.cgi.bak
  1. Download the Updated Version
wget "https://git.ipfire.org/?p=ipfire-2.x.git;a=blob_plain;f=html/cgi-bin/firewall.cgi;h=5f1eac09e6612a7ea9db8eb39c4a2b91d0ee67f8;hb=9f082ddca54f4e44667cbb83171f2bf764633347" -O /srv/web/ipfire/cgi-bin/firewall.cgi
  1. Ensure Correct Permissions
chmod 755 /srv/web/ipfire/cgi-bin/firewall.cgi
chown root:root /srv/web/ipfire/cgi-bin/firewall.cgi
  1. Restart the Web UI
/etc/init.d/apache restart

Once that’s done, head back to the WUI and test adding your rule again. This should bypass the erroneous subnet conflict check that was causing the problem.

Cheers,
A G

1 Like