Development discussion of WireGuard
 help / color / mirror / Atom feed
* FreeBSD wireguard wg-quick remote IP address assignment is incorrect
@ 2020-02-23  8:00 Peter Libassi
  2020-02-23 11:37 ` Jason A. Donenfeld
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Libassi @ 2020-02-23  8:00 UTC (permalink / raw)
  To: wireguard


[-- Attachment #1.1: Type: text/plain, Size: 1109 bytes --]

local wg interface does not respond due to the wg-quick script sets up the interface by reusing the local address as the remote address in the ifconfig command:

root@bsd2:~ # wg-quick up wg0
[#] wireguard-go wg0
INFO: (wg0) 2020/02/20 09:45:16 Starting wireguard-go version 0.0.20200121
[#] wg setconf wg0 /tmp/tmp.87viEAsK/sh-np.YdRfI6
[#] ifconfig wg0 inet 192.168.2.2 192.168.2.2 alias

On linux setting up an IP address on a tun interface does not require a remote address:
[root@vpn2 wireguard]# wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 192.168.2.2/24 dev wg0

In the wg-quick script function add_addr() is where the assignment is made:
 
 cmd ifconfig "$INTERFACE" inet "$1" "${1%%/*}" alias

I verifed this by replacing remote address with localhost:

 cmd ifconfig "$INTERFACE" inet "$1" "127.0.0.1" alias

Now local ping works. You can give any address I suppose since the ”remote address” of the ifconfig of a tun interface is not really used by wireguard.

I also filed this as FreeBSD bug 244330.

/Peter

[-- Attachment #1.2: Type: text/html, Size: 1619 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <4c6af2b0-62bc-84bd-f1ec-ce11a152d348@gmail.com>]

end of thread, other threads:[~2020-02-25 13:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23  8:00 FreeBSD wireguard wg-quick remote IP address assignment is incorrect Peter Libassi
2020-02-23 11:37 ` Jason A. Donenfeld
2020-02-23 13:25   ` Peter Libassi
2020-02-23 15:32     ` Jason A. Donenfeld
2020-02-25  6:07       ` Peter Libassi
     [not found] <4c6af2b0-62bc-84bd-f1ec-ce11a152d348@gmail.com>
2020-02-25 13:08 ` Peter Libassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).