ivpn / ios-app

Official IVPN iOS app
https://www.ivpn.net/apps-ios
GNU General Public License v3.0
413 stars 86 forks source link

Internet Connection is not working, after I use my own wireguard server configuration. #435

Open I-amCoder opened 3 months ago

I-amCoder commented 3 months ago

Feature request

I have setup my own wireguard server, and want to create vpn connection, it says connected but internet doesn't work.

Description

I'm passing my server's port and settings to wireguard protocol configuration, it shows connected icon but internet doesn't work. I replaced configuration with my own configuration:

File: IVPNClient/Utilities/Extensions/NETunnelProviderProtocol+Ext.swift

Function: makeWireguardProtocol()

Replacing:

   let peer = Peer(
        publicKey: publicKey,
        presharedKey: KeyChain.wgPresharedKey,
        allowedIPs: Config.wgPeerAllowedIPs,
        endpoint: endpoint,
        persistentKeepalive: Config.wgPeerPersistentKeepalive
    )
    let interface = Interface(
        addresses: addresses,
        listenPort: Config.wgInterfaceListenPort,
        mtu: UserDefaults.standard.wgMtu,
        privateKey: KeyChain.wgPrivateKey,
        dns: host.localIPAddress()

        )

My settings:

   let peer = Peer(
        publicKey: "rkBijC5WLAOVjJUJioG1HzI3F8fgtkgs__my_peer_public_key",
        presharedKey: nil,
        allowedIPs: "0.0.0.0/0, ::/0",
        endpoint: "46.101.132.188:3376",
        persistentKeepalive: 25
    )
    let interface = Interface(
        addresses: "10.9.0.3/24",
        listenPort: 54063,
        mtu:  0,
        privateKey: "yHt/WuyjFx1W6J+GVllEfp8THK8npcUIk__my_server_private_key",
        dns: "1.1.1.1, 1.0.0.1"

         )

These settings are working in official wireguard app.

A clear and concise description of the problem or missing capability. I want to know how you're setting up your servers for wireguard.

Describe the solution you'd like

A clear guide to how would I setup my wireguard server according to your server configuration.