Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pbr: does not enable routing at startup #25616

Open
mikhirev opened this issue Dec 25, 2024 · 4 comments
Open

pbr: does not enable routing at startup #25616

mikhirev opened this issue Dec 25, 2024 · 4 comments

Comments

@mikhirev
Copy link
Contributor

Maintainer: @stangri
Environment: ath79/nand/netgear_wndr3700-v4 OpenWrt 24.10.0-rc4 (r28211-d55754ce0d)

Description:

After reboot routing to the wireguard interface does not work correctly. I found the following line in system log:

Thu Dec 26 03:04:18 2024 user.notice pbr [2621]: Setting up routing for 'wireguard/0.0.0.0' [✗]

After I restart pbr, everything works fine. In the log I see:

Thu Dec 26 03:07:53 2024 user.notice pbr [9955]: Setting up routing for 'wireguard/10.11.0.2' [✓]

But after reboot the problem reproduces. Seems that pbr starts too early, before the wireguard interface is set up.

@mikhirev
Copy link
Contributor Author

Well, my assumption that pbr should wait for interfaces was incorrect. It seems that interface triggers don't work as expected. I see the following trigger registered:

                        [
                                "interface.*",
                                [
                                        "if",
                                        [
                                                "eq",
                                                "interface",
                                                "wireguard"
                                        ],
                                        [
                                                "run_script",
                                                "/etc/init.d/pbr",
                                                "on_interface_reload",
                                                "wireguard"
                                        ]
                                ]
                        ]

However it does not work properly at startup.

@mikhirev mikhirev changed the title pbr: starts before VPN interface is up pbr: does not enable routing at startup Dec 26, 2024
@mikhirev
Copy link
Contributor Author

If I run /etc/init.d/pbr on_interface_reload wireguard in command line, it is reloaded successfully. So my guess is that the trigger does not take action because the wireguard interface gets up while pbr is starting (it takes more than 30 secs and there is a line firewall: Reloading firewall due to ifup of wireguard (wireguard) between messages about setting up routing from pbr in log).

@mikhirev
Copy link
Contributor Author

As I see, when starting with on_boot, pbr waits for the default gateway interface but does not wait for other interfaces.

@mikhirev
Copy link
Contributor Author

As a workaroud, I did

uci set pbr.@pbr[0].procd_boot_delay=30
uci commit

However everything should work out-of-the-box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant