Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Mar 2021 16:21:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        doc@FreeBSD.org
Subject:   [Bug 253866] if_wg(4) manpage: fix typo and example command
Message-ID:  <bug-253866-9-I1RR4npLNj@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-253866-9@https.bugs.freebsd.org/bugzilla/>
References:  <bug-253866-9@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253866

Sergey Akhmatov <sergey@akhmatov.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|Works As Intended           |---
             Status|Closed                      |Open

--- Comment #3 from Sergey Akhmatov <sergey@akhmatov.ru> ---
(In reply to Gordon Bergling from comment #2)
Hello,

Example configuring wg0 interface is correct, the problem is with adding pe=
ers.

My steps to reproduce, are exact copy-paste from man if_wg (FreeBSD bsd-cur=
rent
14.0-CURRENT FreeBSD 14.0-CURRENT #5 main-n245256-37cd6c20dbc):
# ifconfig wg0 create listen-port 54321 private-key `openssl rand -base64 3=
2`

Checking created interface:
# ifconfig wg0
wg0: flags=3D8080a0<NOARP,MULTICAST> metric 0 mtu 1420
        options=3D880000<LINKSTATE>
        groups: wg
        listen-port: 54321
        private-key: SKQetK9X4MaHh7bXE/Y6mRgtZylRH5mp9Fj+reRP0no=3D
        public-key:  13+dUrtLJ6kt+mbWmGJeBppliygNq4WhmjOXjO4xrkA=3D
        media: Ethernet autoselect (25GBase-ACC <full-duplex>)
        status: active
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Adding peer from manpage example:
# ifconfig wg0 peer '7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=3D' endpoi=
nt
10.0.1.100 allowed-ips 192.168.2.100/32
ifconfig: 7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=3D: bad value

Adding "public-key" before the key itself:
# ifconfig wg0 peer public-key '7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=
=3D'
endpoint 10.0.1.100 allowed-ips 192.168.2.100/32
ifconfig: bad endpoint format 10.0.1.100 - no port delimiter found

Better, but we are still missing portnumber for peer. Adding port:
# ifconfig wg0 peer public-key '7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=
=3D'
endpoint 10.0.1.100:54321 allowed-ips 192.168.2.100/32
[Peer]
PublicKey =3D 7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=3D
Endpoint =3D 10.0.1.100:54321
AllowedIPs =3D 192.168.2.100/32


Now it's OK.

Could you please review it once more and point me if I'm doing something wr=
ong.
I'll update patch, adding portnumber to peer IP if needed.

And, BTW, the term "listing port" just doesn't make any sense to me in this
context:
"listen-port
   The listing port of the wg interface."
English is not my native, but could you explain why is it correct? There is=
 not
a single word "listing" in wireguard doc
(https://www.wireguard.com/papers/wireguard.pdf), while "listening port" wo=
uld
make sense here.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-253866-9-I1RR4npLNj>