passepartoutvpn / tunnelkit

VPN client library for Apple platforms.
GNU General Public License v3.0
9 stars 8 forks source link

VPN seems connected but No Internet #415

Open KavinduDissanayake opened 8 months ago

KavinduDissanayake commented 8 months ago

Summary

VPN seems connected but No Internet With wiregaurd

Steps to reproduce

I will provide wiregaurd configuration details , When Im Connection to this it not working

[Interface] PrivateKey = ONxGJ/m501vbd6Zoi2iZDC5bLdhJB7QcWf3INN1JD2c= Address = 10.7.0.13/24 DNS = 1.1.1.1, 1.0.0.1 [Peer] PublicKey = syq8LIXwyrIR6M7nXUa8BLvTbacz5UWLUTPD1bD+AU8= PresharedKey = KfdwgUMWfyKJayAbg5Gu43aQdprTZ5gnjc37MEb2PEc= AllowedIPs = 0.0.0.0/0, :/0 Endpoint = 62.210.169.93:51820 PersistentKeepalive = 25

What is the current bug behavior?

What is the expected correct behavior?

I Want connect with above configuration with internet, please help to fix it

Relevant logs and/or screenshots

Screenshot 2024-03-10 at 20 19 07

Possible fixes suggested remediation

@roop @johankool @keeshux @jaroslavas

0xBF90E913 commented 6 months ago

Hey dude, did you manage to fix this?

NasrullahKhan commented 6 months ago

i found the solution. you have to add allowedIPs and setPresharedKey

var builder = try! WireGuard.ConfigurationBuilder(privateKey) builder.addresses = ["10.7.0.13/24"] builder.dnsServers = ["1.1.1.1", "1.0.0.1"]

try! builder.addPeer(publicKey, endpoint: "\(serverAddress):\(serverPort)", allowedIPs: ["0.0.0.0/0", ":/0"]) try! builder.setPreSharedKey(preshaerdKey, ofPeer: 0) builder.setKeepAlive(25, forPeer: 0)