Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721736 - net-misc/netifrc should check if wg exists when configuring wireguard interfaces
Summary: net-misc/netifrc should check if wg exists when configuring wireguard interfaces
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-09 02:50 UTC by tastytea
Modified: 2020-05-31 07:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tastytea 2020-05-09 02:50:55 UTC
/lib/netifrc/net/wireguard.sh uses /usr/bin/wg, installed by net-vpn/wireguard-tools. wireguard.sh should check if wg exists and report an error if not.

Reproducible: Always

Steps to Reproduce:
1. Configure wireguard interface
2. Uninstall net-vpn/wireguard-tools
3. Start wireguard interface
Actual Results:  
Error message: “interface wg0 does not exist”.
If the user adds the interface with `ip link add wg0 type wireguard`, the init script seems to start fine but ping reports “Required key not available”.

Expected Results:  
An error message that says that wg couldn't be found and that it can be installed  from net-vpn/wireguard-tools.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2020-05-31 05:18:09 UTC
You should get a message:
Skipping module wireguard due to missing program: wg

Can you please capture the full output, as I don't why this doesn't happen for your case.
Comment 2 tastytea 2020-05-31 07:44:58 UTC
$ rc-service net.wg0 stop
$ mv /usr/bin/wg{,_}
$ rc-service net.wg0 start
 * Bringing up interface wg0
Cannot find device "wg0"
 *   ERROR: interface wg0 does not exist
 *   Ensure that you have loaded the correct kernel module for your hardware
 * ERROR: net.wg0 failed to start

Config in /etc/conf.d/net:
config_wg0="fd66::10:1:3/64 10.66.10.13/16"
wireguard_wg0="/etc/wireguard/wg0.conf"
mtu_wg0="1400"

Version: net-misc/netifrc-0.7.1::gentoo