Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter to limit outgoing connection to IPv4 #379

Closed
petrkutalek opened this issue Nov 18, 2024 · 2 comments
Closed

Parameter to limit outgoing connection to IPv4 #379

petrkutalek opened this issue Nov 18, 2024 · 2 comments

Comments

@petrkutalek
Copy link

Hello Romain, thank you for your work on this great project. I have here a suggestion for a feature to implement that would make my deployment cases easier. Thank you for your consideration and best regards.

Describe the feature

The possibility to limit outgoing client connection to IPv4; something like the --ipv4 command line parameter

Describe the reason for such feature

With typical use of wstunnel client … wss://server1.example.com:443, server1.example.com is resolved to an IP address where IPv6 takes precedence if both A and AAAA exist.

However, there are cases where an IPv4 preference would make configuration easier. I use wstunnel even on the client side in systemd fully automatically linked to the wireguard interface, which is also managed via systemd-networkd. Nevertheless, in the example above, the destination is resolved to IPv6 and in some sites that I don't have under control, I am unable to establish connections via IPv6. I have to work around this via a bash script, where I first resolve the destination's IPv4 address and modify the systemd unit environment… This all breaks the elegant solution where everything was fully automated via systemd dependencies.

@erebe
Copy link
Owner

erebe commented Nov 18, 2024

Hello,

There is already a flag that you can use to prefer ipv4 :)
You can use either at client or server side.

      --dns-resolver-prefer-ipv4
          Enable if you prefer the dns resolver to prioritize IPv4 over IPv6
          This is useful if you have a broken IPv6 connection, and want to avoid the delay of trying to connect to IPv6
          If you don't have any IPv6 this does not change anything.

          [env: WSTUNNEL_DNS_PREFER_IPV4=]

@petrkutalek
Copy link
Author

OMG, I missed this, I was just looking at the REAMDE here. You are my hero of the day week, thank you! That's just awesome! 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants