Page MenuHomeFreeBSD

wireguard: extend ifconfig
AbandonedPublic

Authored by bapt on Dec 3 2023, 6:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 11, 5:37 AM
Unknown Object (File)
Wed, May 8, 1:17 PM
Unknown Object (File)
Wed, May 8, 11:43 AM
Unknown Object (File)
Wed, May 8, 11:38 AM
Unknown Object (File)
Thu, May 2, 6:19 PM
Unknown Object (File)
Wed, May 1, 3:06 AM
Unknown Object (File)
Apr 8 2024, 7:46 PM
Unknown Object (File)
Apr 1 2024, 3:51 AM
Subscribers

Details

Summary

Allow ifconfig to show informations about wireguard bridges

Test Plan
ifconfig wg0
wg0: flags=10080c1<UP,RUNNING,NOARP,MULTICAST,LOWER_UP> metric 0 mtu 1420
	options=80000<LINKSTATE>
	inet 10.10.0.3 netmask 0xffffff00
	groups: wg
	wg public key WwnsbWpa3aNtU932O4mVPaL+TLJeZMYKiVKyDFTuwzQ=
	wg listen-port 51820
	wg peer 41eBMV3uKaE+KS2Q7Yibq+Z+BgSjwW7JLF76JvXQpj0=
	 endpoint: 176.31.115.77:51820
	 allowed ips: 10.10.0.0/24
	 last handshake: 92 seconds
	 keepalive: 25 seconds
	wg peer zL/qcilesyKX6+KslWhTtRVLD2dWJXUQTezk7lEHIS8=
	 allowed ips: 192.168.1.0/24, 10.10.0.6/32
	wg peer YNZ1B/R1EUnupTbv3G+c8EyQeF62D16D9O+4dc9REy4=
	 endpoint: 192.168.1.48:51820
	 allowed ips: 10.10.0.2/32
	 last handshake: 3956 seconds
	nd6 options=109<PERFORMNUD,IFDISABLED,NO_DAD>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54758
Build 51647: arc lint + arc unit

Event Timeline

bapt requested review of this revision.Dec 3 2023, 6:53 AM
bapt added reviewers: jhb, manu, emaste, kevans.

use libifconfig_ioctlwrap

I'm not sure about how useful this is to me. I use ifconfig to take a glance at all interfaces and if I want to learn more specifically about the state of the wg interface, I just run wg. I know it's obvious, I just mean that I never missed this information when looking at ifconfig output. On the other hand, with this patch, the output is longer and somewhat less readable.

But that's just my opinion of a user, if it's a generally desirable feature then I won't protest.

I plan to also add the commands to set it up from ifconfig as well.
So the wg command is not necessary for basic setups like in openbsd

In D42880#978141, @bapt wrote:

I plan to also add the commands to set it up from ifconfig as well.
So the wg command is not necessary for basic setups like in openbsd

I do wonder if they would've made the same decision today; wg(8) wasn't dual-licensed back when they gained wireguard support, but now it is and we include it in base.