Closed Aditya23456 closed 4 years ago
Sorry for confusion, I figured out that I can't use same AllowedIPs for more than one peer. So I have to restrict subnet for each peer while adding it. Also, the right way to set AllowedIPs is:
AllowedIPs: []net.IPNet{
MustCIDR(ip+"/32"),
},
where ip is peer/client IP. I am closing the issue!
Hello, Thank you very much for the library. I am trying to change wireguard configuration on the server side to dynamically add peers. To accomplish this, I do this when a client gets connected:
I am relaxing AllowedIPs to allow any for now. Later I will be specific to the given client. This works fine for one client and I see communication fine but when second client connects, first client looses connection. When I looked at wg showconf wg0, I see old peer lost AllowedIPs settings. It shows like this:
When I again add another peer, the Peer with public key
63aWx7RpOlxMnXFt0unfBGUryafooPlsMn8d2rQeH2o=
also looses AllowedIPs section. Is there any work around/ config parameter to retain old Allowed IPs?? I did play around withReplaceAllowedIPs and other parameters
but didn't help :(