Policy-Based-Routing (pbr) package discussion

and what version of OpenWRT are you using?

Please show the output of:

ubus call system board

Edit 1 seeing it is IPK you are probably using version 24.10

The code you are showing looks very old so something in creating the ipk packages for 24.10 went haywire.

You can get the correct code from:

Let us know if that works for 24.10 as it has not been tested on 24.10

Edit 2:
The earlier commit in 24.10 was garbled, it will be corrected today, but it will take time before it is processed and the build system will make new packages.
Hopefully a working build will be up tomorrow or the day after, in the mean time you can use the workaround from Edit 1

Thanks for reporting

1 Like

I too am having this same issue and attempted to remove the extra β€œfi” myself, but it seems like pbr is still having a hard time starting:

root@PyrosRouter:/etc/config# /etc/init.d/pbr restart
Using uplink interface (on_start): wan [βœ“]
Found uplink gateway (on_start): X.X.X.X [βœ“]
Processing environment (on_start) ERROR: Uplink/WAN interface is still down, increase value of 'procd_boot_trigger_delay' option!
Setting interface trigger for wan [βœ“]
Setting interface trigger for tun0 [βœ“]
Setting interface trigger for wg6 [βœ“]
pbr 1.2.2-r6 FAILED TO START!!!
Check the output of nft -c -f /var/run/pbr.nft
ERROR: The pbr 1.2.2-r6 service failed to discover WAN gateway!
ERROR: Errors encountered, please check ``https://docs.openwrt.melmac.ca/pbr/1.2.2/#error-messages-details``!
root@PyrosRouter:/etc/config#

Was working just fine with the last version (I think it was 1.2.1?) on the GUI page I see: β€œNot installed or not found” Please let me know if there is a fix or a workaround!

EDIT - I took the entirety of the pbr-1.2.2-r4 file and removed what I had for /etc/init.d/pbr and replaced it with the r4 file. After restoring my old config, enabling uci set pbr.config.enabled='1' and finally /etc/init.d/pbr restart, pbr seems to work on the back end. The GUI is still showing:

Policy Based Routing - Status

Service Status

Not installed or not found

But it is indeed working. I will wait patiently for a fix.

-Pyro

The commit for 24.10 was garbled, 25.12 and Master/Snapshot were OK
So you can grab the 1.2.2-r6 and use that as a replacement:

But staying on 1.2.2-r4 is fine until it is updated on the OpenWRT repository, PR is already made but it can take one or more days until it is processed.

3 Likes

Hi,
Info about my router:

  • Target Platform x86/64

- Firmware Version OpenWrt 24.10.1 r28597-0425664679 / LuCI openwrt-24.10 branch 26.058.03685~8c588e3

- Kernel Version 6.6.86

I had tro reinstall openwrt. I restored my previously configuration on the same Openwrt version 24.10.1.
in the PBR screen in luci, I keep giving this error: Service Status: Not installed or not found
Under the Service Warnings, I followed the instructions but I cant get to work PBR.
The output of : command -v opkg > /dev/null 2>&1 && opkg list-installed | grep pbr

GIves the correct answer (same version)
luci-app-pbr - 1.2.2-r6
pbr - 1.2.2-r6

I am unable to restart the service in the gui as there is no button to do so

when service rpcd restart does not help me.

/etc/init.d/pbr status
/etc/rc.common: /etc/init.d/pbr: line 1888: syntax error: unexpected "fi" (expecting "done")

and

/etc/init.d/pbr restart
/etc/rc.common: /etc/init.d/pbr: line 1888: syntax error: unexpected "fi" (expecting "done")

I keep having this unexpected "fi" (expecting "done")

I am running out of options.

I also tried to upgrade to 24.10.5 and did not make it any better.
The Attended sysupgrade gave me also the upgrade option 25.12.0-rc5.
That as well did not help.

so I reversed back to 24.10.1.
I have the configuration backup and the all /etc folder backed up from before the upgrade.

Among my try-outs I also tried to install manually a different version: pbr-1.2.3-23_openwrt-24.10_all.ipk. also without success of starting the service.

What can I do to fix this issue?

Thanks you

Have you tried checking if the file you have on β€œ/etc/init.d/pbr” is the same as the one here?

https://github.com/openwrt/packages/blob/master/net/pbr/files/etc/init.d/pbr
cd /tmp
wget https://github.com/openwrt/packages/raw/dde3a694f0a15ac00b07bb9982c1558acbf65437/net/pbr/files/etc/init.d/pbr
diff pbr /etc/init.d/pbr

at line "1888" there should be a "fi":

https://github.com/openwrt/packages/blob/07b918bbc4321dc9f588b14dd0baef410e4afdd2/net/pbr/files/etc/init.d/pbr#L1888

at line β€œ1883” there should be a "done":

https://github.com/openwrt/packages/blob/07b918bbc4321dc9f588b14dd0baef410e4afdd2/net/pbr/files/etc/init.d/pbr#L1883

I apologize in advance if I waste your time :sweat_smile:

That is a known problem which started today and hopefully will be solved the coming days
See:
https://forum.openwrt.org/t/policy-based-routing-pbr-package-discussion/140639/2635?u=egc

1 Like

So,

after more tha 4h trying and trying, I found this procedure about 5 minutes ago:
opkg update opkg install wget-ssl echo -e -n 'untrusted comment: OpenWrt usign key of Stan Grishin\nRWR//HUXxMwMVnx7fESOKO7x8XoW4/dRidJPjt91hAAU2L59mYvHy0Fa\n' > /etc/opkg/keys/7ffc7517c4cc0c56 sed -i '/stangri_repo/d' /etc/opkg/customfeeds.conf echo 'src/gz stangri_repo https://repo.openwrt.melmac.ca' >> /etc/opkg/customfeeds.conf opkg update

from: https://docs.openwrt.melmac.ca/pbr/1.2.2/#warning-messages-details

That did the trick and now it works.
I am a bit scare to upgrade my openwrt now as when I tried I had troubles.
But I hope this solution can help others in my situation.
Thanks you ncompact and egc for feedback

yes, I did see that too. But I though I had a bit of a different problem. Yet can be of the same nature

For PBR users using OpenWRT 24.10 an updated PBR 1.2.2-r6 is now available in the OpenWRT repository, this time it should be a working version :slight_smile:

Builds above 1.2.2-r6 are a Work in Progress do not use those yet.

For info only

I am using version 1.2.3-r23 and all works fine (or so far so good seems to me).
As mentioned earlier in my post. Any reason I should downgrade if it works?
The only thing I noticed is that on the service status line, rather than showing the default gateway it only gives the version nunmer:
Service Status Version 1.2.3-r23 - Running (fw4 nft file mode).

For now it is experimental so use at your own risk.

Build 1.2.2-r8 is out with some late minute minor bug fixes

You can get it directly from the PBR repo using the following script.

This is apk so for OpenWRT 25.12 and Master build

Before you are going to test make a backup of your settings You do not have to copy and execute line by line but you can copy everything and just paste at the command line:

cd /tmp 
wget -O pbr.apk https://github.com/mossdef-org/pbr/releases/download/v1.2.2-8/pbr-1.2.2-8_openwrt-25.12_noarch.apk
wget -O luci-app-pbr.apk https://github.com/mossdef-org/luci-app-pbr/releases/download/v1.2.2-8/luci-app-pbr-1.2.2-8_openwrt-25.12_noarch.apk 
service pbr stop 
apk del luci-app-pbr pbr 		   # opkg remove luci-app-pbr pbr 
mv /etc/init.d/pbr /etc/init.d/pbr-old	>/dev/null 2>&1   # backup old pbr in case it is not removed
apk add --allow-untrusted ./*.apk 	   # opkg install luci-app-pbr pbr 
service pbr start

yes, I am noticing it.
It seems to work but actually does not really cretae the exeptions (tunneling) that are defined,
I have few devices that only work off VPN and they keep stay on it.
Can I simply download the version PBR 1.2.2-r6 and install it?
How can I have luci-app-pbr no the same version when installing PBR 1.2.2-r6?

You can download 1.2.2-r8 please test that, there is also luci-app-pbr 1.2.2-r8

Let me know how it goes, thanks

could you please provide the link as well?
I am lost among all the search tabs! :frowning:

I found this I guess is ok:
https://openwrt.pkgs.org/24.10/openwrt-luci-x86_64/luci-app-pbr_1.2.2-r6_all.ipk.html

I removed the previous packages and installed the above but got errors:

Despite the error, the services are installed but under the Services|policy Routing tab I got his:
Service Warnings

Internal version mismatch (package: 0, luci app: 25, luci rpcd: 0), you may need to update packages or reboot the device, please check the README.
Warnings encountered, please check the README!
However, the versions seems to match:
command -v opkg > /dev/null 2>&1 && opkg list-installed | grep pbr
luci-app-pbr - 1.2.2-r6
pbr - 1.2.2-r6

Any suggestions?

You need the ipk version for 24.10?

I do not have a test router with 24.10 but it should be like this

cd /tmp 
wget -O pbr.ipk https://github.com/mossdef-org/pbr/releases/download/v1.2.2-8/pbr-1.2.2-8_openwrt-24.10_all.ipk
wget -O luci-app-pbr.ipk https://github.com/mossdef-org/luci-app-pbr/releases/download/v1.2.2-8/luci-app-pbr-1.2.2-8_openwrt-24.10_all.ipk 
service pbr stop 
opkg remove luci-app-pbr pbr
mv /etc/init.d/pbr /etc/init.d/pbr-old	>/dev/null 2>&1   # backup old pbr in case it is not removed
opkg install ./*.ipk 
service pbr start

That should download and install 1.2.2-r8

1 Like

on my system PBR gets restarted multiple time during system startup in quick succession .
what prevents multiple PBR init scripts from running simultaneously ?
I'm asking because I want to create a hotplug script that will restart PBR under certain circumstances and I dont want to corrupt anything

What is exactly the problem you are trying to solve?

Newest PBR 1.2.2-r8 has triggers on all supported interfaces and trigger on startup furthermore triggers on config changes