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

IPv6 Support #81

Open
aw1875 opened this issue Nov 11, 2024 · 4 comments
Open

IPv6 Support #81

aw1875 opened this issue Nov 11, 2024 · 4 comments

Comments

@aw1875
Copy link

aw1875 commented Nov 11, 2024

I'm not entirely sure if this exists in the project so wanted to reach out to verify. I did notice a few PRs that address IPv6 support but it wasn't super clear if I needed to do something different with my setup to have this working. Currently, I'm trying to mimic bringing up an interface using this config:

[Interface]
Address = 10.0.0.3/32,fd00::4/128
PrivateKey = <private_key>
DNS = 192.168.100.10

[Peer]
PublicKey = <public_key>
PresharedKey = <preshared_key>
Endpoint = <endpoint>
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25

I noticed that the InterfaceConfiguration struct expects only a string for the address field, so trying something like address: "10.0.0.3/32,fd00::4/128".to_string() will not parse correctly. I also tried using the assign_address method on the WireguardInterfaceApi struct but that doesn't seem to work either. It seems like the second approach does add the IP to the interface as expected, but no traffic is routed and it seems like only the IPv4 address is found when checking against my public address. I'd be happy to share a code snippet if needed but I wasn't able to find any really clear documentation on this so figured I'd ask. Thank you in advance!

@moubctez
Copy link
Contributor

moubctez commented Nov 12, 2024

Currently, wireguard-rs does not support multiple addresses on a network interface. Possibly, this will be added in the future.

@aw1875
Copy link
Author

aw1875 commented Nov 12, 2024

Thank you for the response! Is this something that hasn't been implemented due to difficulty or lack of interest/need? If it doesn't seem too complicated I'd be interested in taking a look at it.

@teon
Copy link
Contributor

teon commented Nov 12, 2024

@aw1875 this library is developed for our main product: https://GitHub.com/defguard/defguard - especially for it's gateway and client, thus most of the features are added here when implementing features in those products.

I agree that's easy, you are warmly welcome to contribute the code.

@aw1875
Copy link
Author

aw1875 commented Nov 13, 2024

@teon sounds good I'll definitely take a look! Is there any part of the codebase I should be looking to add this logic before I dive into it?

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

No branches or pull requests

3 participants