mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #174] IPv6 support disables IPv4 #141
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#141
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Malvineous on GitHub (Nov 10, 2018).
Original GitHub issue: https://github.com/debauchee/barrier/issues/174
The recent IPv6 support is great, however if you try to use it with dual-stack hosts you can run into problems.
This is because the client does a DNS lookup and connects to the first IP it gets. If the host has IPv4 and IPv6 addresses, as most will do, then sometimes the client will try to connect via IPv4 and sometimes via IPv6.
Since the server by default listens on IPv4 only, and with
-a ::can listen on IPv6 only, it means that connections will intermittently be unreliable as clients randomly try to connect over IPv4 and IPv6, but the server is only listening on one protocol.I see a few possible solutions:
0.0.0.0(IPv4) and::(IPv6) so that the server can accept either connection.-aoptions to be specified on the server, so you can do-a 0.0.0.0 -a ::to listen on both protocols at the same time.-4and-6to the client to force it to connect using a specific protocol, taking care to ensure a DNS lookup that returns multiple IP addresses has all of them checked if the first one doesn't match the requirements of the-4or-6options.Steps to reproduce bug
host myserverreturns two IP addresses:@brianjmurrell commented on GitHub (Dec 25, 2018):
I'm not so sure that
::is supposed to mean IPv6 only on dual-stack machines. At least on Linux, this behaviour is controlled with/proc/sys/net/ipv6/bindv6only.@Malvineous commented on GitHub (Dec 26, 2018):
Interesting. Some research shows that this can be overridden by the application, the
procsetting just controls the default value. On my system theprocentry is set to0, meaning binding to::should by default receive IPv4 and IPv6 connections, however IPv4 clients cannot connect.@troxor commented on GitHub (Jan 21, 2019):
As a workaround, I set up Avahi to advertise the server's IPv4 address at hostname-of-server.local, and set up the barrier client to connect to that.
Edit: this was done on a Linux server, using a macOS client.
@brianjmurrell commented on GitHub (Jan 23, 2019):
To bring Barrier into the current century, I think it needs to be switched to listen on
::on Linux (and perhaps/probably OS/X). That will allow both IPv6 and IPv4 connections (depending on the setting of/proc/sys/net/ipv6/bindv6onlyon Linux, but I suspect most distros have that set to0at this point in time).There is a doc that describes how to do the same thing for Windows.
Short of this, if a host is IPv6 capable, it should default to listening on IPv6 since the source address selection and DNS lookup priority (AAAA vs. A) typically default to prioritising IPv6 on most (all, current at least?) O/S these days and so a server defaulting to IPv4-only while a client can find AAAA records for the server will always fail to connect, particularly since
barriercdoesn't seem to fall back to IPv4 if an IPv6 attempt returns an ECONNREFUSED.Ultimately in dual-stack environments, the existing out-of-the-box (i.e. without the user having to twiddle) default behaviour of Barrier just doesn't work.
@LovesTha commented on GitHub (Oct 2, 2020):
I think what I just experienced is related to this topic:
Had barrier working on a IPv4 network, moved the PCs to another office and it wasn't working. Put in the IPv4 address the server GUI told me it was listening on, didn't work. Checked the output of netstat -ln and saw it was listening on :: and not on v4 at all, switched the client to the IPv6 address and it worked.
At least displaying the right address in the GUI would make the experience a lot better.
@DanielGlaas commented on GitHub (Dec 11, 2020):
Hi,
by random I noticed this issues:
My setup is Ubuntu 20.04 as server and raspberry pi 4 as a client. I connected them with two methods:
Switching the Ubuntu server between these two Wifis work flawless without any need to change something on the server side. On the client, I have two instances of barrierc running, one for each Wifi as the server gets assigned different IP addresses.
So the question is whether this is still a recent topic?
@Malvineous commented on GitHub (Dec 11, 2020):
The issue for me is when you are on a network that supports IPv4 and IPv6, but some of the clients trying to connect only speak IPv4. It seems that when listening on IPv6, no IPv4 clients can connect.
@DanielGlaas Are you able to test that scenario?
@DanielGlaas commented on GitHub (Dec 11, 2020):
@Malvineous:
I made a test with following configuration:
pi@raspberrypi:~ $ sudo sysctl net.ipv6.conf.all.disable_ipv6=1net.ipv6.conf.all.disable_ipv6= 1`resulting to
For me, this is a scenario where the network supports IPV4 and IPV6 but the client speaks only IPv4, right?
On the raspberry pi (client), barrierc is started witch this command line:
barrierc -f --name raspberrypi --enable-crypto 192.168.178.26The connection works flawless, even if I start and stop the server process, reconnection works within seconds.
For debugging, here is the netstat output of server and client:
Why is there written tcp6 although it is connected via IPv4?
Is this helpful for you?
@Malvineous commented on GitHub (Dec 12, 2020):
Very helpful! The only thing missing is
netstat -lnp | grep barrieron the server to verify it is listening on IPv6 and not choosing IPv4 only. And it would be useful to compare that to running the server with the-a ::parameter to specifically say you want to listen on all IPv6 interfaces (which should still result in it receiving IPv4 connections through the IPv6 port, but where my set up was failing).That would confirm it for sure, but it does seem like it may indeed be working now.
@DanielGlaas commented on GitHub (Dec 13, 2020):
Here is my output of 'ps -aux | grep barrier' on the server:
Note: I first made a setup with synergy on Ubuntu 18.04 on the server. But after upgrading to Ubuntu 20.04 barrier became my new choice and the configuration file stills works unchanged. :-)
The corresponding output of
netstat -lnp | grep barrierwith no connected client is:I changed the parameters to
/usr/bin/barriers -f --no-tray --debug INFO --name Daniel-Laptop --enable-crypto -c /home/daniel/synergy_raspi.conf **--address ::**with this result ofnetstat -lnp | grep barrierYou see the new PID, but despite of this nothing changed.
I think so, yes!
@Malvineous commented on GitHub (Dec 27, 2020):
Thanks so much for testing! I'm going to close this now as clearly it is working the way it should.
@DanielGlaas commented on GitHub (Dec 27, 2020):
Your are welcome, I like to contribute something at least by testing some circumstances. Please feel free to contact me if there is anything else that needs to be tested!