openwrt / openwrt/netifd

wireguard/netifd: Second wireguard interfaces does not initialize correctly on reboot

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
37
Forks
62
PR merge metrics
No merged PRs in 30d

Description

On most restarts of the router, my second wireguard interface (see screenshot below) is not initialized properly. The interface does not work, RX/TX counters are at 0. Restarting the interface or the network does not fix the issue, if the interfaces does not come up after a reboot, you have to reboot the whole device and hope that it works this time - if not, reboot again. In most cases, it works after two or three reboots.

netifd logs look like the interface is up and running, but it is not:

Oct  6 10:54:48 GatewayDummi netifd: Interface 'vpn_wg1' is now down
Oct  6 10:54:48 GatewayDummi netifd: Interface 'vpn_wg1' is setting up now
Oct  6 10:54:49 GatewayDummi netifd: Interface 'vpn_wg0' is now down
Oct  6 10:54:49 GatewayDummi netifd: Interface 'vpn_wg0' is setting up now
Oct  6 10:54:49 GatewayDummi netifd: Interface 'vpn_wg1' is now up
Oct  6 10:54:49 GatewayDummi netifd: Network device 'vpn_wg1' link is up
Oct  6 10:54:49 GatewayDummi netifd: Interface 'vpn_wg0' is now up
Oct  6 10:54:49 GatewayDummi netifd: Network device 'vpn_wg0' link is up

Screenshot:

Image

I need to use two wireguard interfaces because they have different routing tables. The first interface is for "normal" VPN access, the second is for policy-based routing (pbr). The wireguard issue is not related to pbr because it also happens when I disable pbr completely.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reboot failure with two WireGuard interfaces and inspect the provided netifd log sequence for vpn_wg0 and vpn_wg1. The issue names no source files or tests, so trace the interface setup path in netifd from those interface names. Done means both interfaces initialize reliably after reboot and their RX/TX counters work.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.