Open aw1875 opened 1 week ago
Currently, wireguard-rs does not support multiple addresses on a network interface. Possibly, this will be added in the future.
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.
@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.
@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?
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:
I noticed that the
InterfaceConfiguration
struct expects only a string for theaddress
field, so trying something likeaddress: "10.0.0.3/32,fd00::4/128".to_string()
will not parse correctly. I also tried using theassign_address
method on theWireguardInterfaceApi
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!