How to use KDEConnect over wirguard












0















How could I use KDEConnect over wireguard, that does no implement broadcasting?










share|improve this question



























    0















    How could I use KDEConnect over wireguard, that does no implement broadcasting?










    share|improve this question

























      0












      0








      0








      How could I use KDEConnect over wireguard, that does no implement broadcasting?










      share|improve this question














      How could I use KDEConnect over wireguard, that does no implement broadcasting?







      vpn kde-connect






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 14 mins ago









      tobiasBoratobiasBora

      249211




      249211






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Let's imagine that we have three computers:




          • a server that will run the wireguard server, with wireguard ip 10.100.0.1

          • a phone that runs KDEConnect for android, with wireguard ip 10.100.0.2

          • a laptop with KDE Plasma that runs kdeconnect, with wireguard ip 10.100.0.3


          On the server first configure wireguard. I personnally chosed to use nixos to do that, but you should also be able to configure it manually, or with a .conf file. Here is my nix configuration file:



          # Source: https://nixos.wiki/wiki/Wireguard
          #### Create keys, as root:
          # mkdir ~/wireguard-keys
          # umask 077 ~/wireguard-keys
          # wg genkey > ~/wireguard-keys/private
          # wg pubkey < ~/wireguard-keys/private > ~/wireguard-keys/public
          { config, pkgs, lib, ... }:
          let
          port = 51820;
          in
          {
          environment.systemPackages = with pkgs; [ wireguard ];

          networking.wireguard.interfaces = {
          # "wg0" is the network interface name. You can name the interface arbitrarily.
          wg0 = {
          # Determines the IP address and subnet of the server's end of the tunnel interface.
          ips = [ "10.100.0.1/24" ];

          # The port that Wireguard listens to. Must be accessible by the client.
          listenPort = port;

          # Path to the private key file.
          #
          # Note: The private key can also be included inline via the privateKey option,
          # but this makes the private key world-readable; thus, using privateKeyFile is
          # recommended.
          privateKeyFile = "/root/wireguard-keys/private";

          peers = [
          # List of allowed peers.
          {
          # Android
          publicKey = "myandroidpublickey=";
          # List of IPs assigned to this peer within the tunnel subnet.
          # Used to configure routing.
          allowedIPs = [ "10.100.0.2/32" ];
          }
          {
          # Laptop
          publicKey = "mylaptoppublickey=";
          # List of IPs assigned to this peer within the tunnel subnet.
          # Used to configure routing.
          allowedIPs = [ "10.100.0.3/32" ];
          }
          ];
          };
          };

          # Ensure IP forwarding is enabled.
          boot.kernel.sysctl."net.ipv4.ip_forward" = 1;

          # Add a masquerade rule to iptables so the clients can
          # talk to the internet
          networking.firewall.extraCommands = ''
          iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE
          '';
          # Make sure port is open
          networking.firewall = {
          allowedTCPPorts = [ port ];
          allowedUDPPorts = [ port ];
          };


          }


          The important part is to make sure ip forwarding is enabled, and run the command iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE. Indeed, if you don't do masquerade, then you won't be able to access the internet from your phone, and if you forget to ensure that the destination is outside of the network before doing the masquerade, you will not be able to connect to KDEConnect from your phone (I spend lot's of time before realizing that).



          Then, configure also wireguard on your laptop, for example by putting in /etc/wireguard/wg0.conf:



          # https://wiki.archlinux.fr/Wireguard
          # To run, use:
          # wg-quick up wg0
          # ou systemctl enable --now wg-quick@wg0.service
          # Sur le noeud 2, le "client"
          [Interface]
          # le /24 est important : on définit un réseau (/24) auquel l'interface appartient
          Address = 10.100.0.3/24
          PrivateKey = computerprivatekey

          # On définit qui est le "serveur"
          [Peer]
          PublicKey = serverpublickey
          # le /24 indique ici que tous les noeuds du VPN vont d'abord communiquer avec le serveur,
          # qui va nous renvoyer ce qui nous concerne :
          # on peut s'attendre à recevoir du trafic de la part d'hypothétiques nouveaux noeuds qui seraient dans 10.X.Y/24
          AllowedIPs = 10.100.0.0/24
          Endpoint = serverip.com:51820
          # En général les clients sont derrière du NAT, et si on veut que le serveur puisse joindre le client à tout moment, il faut :
          PersistentKeepalive = 15


          On the android phone, install the wireguard app (available on the Play store and FDroid), and create a new interface, generate a new private key, in the interface address chose 10.100.0.2/32. In Peer, add the public key of the server, and put in Allowed IPs 0.0.0.0/0 (actually you can chose a stricter set of ips). Configure the endpoint to myserver.com:51820, and save/enable the configuration/test the network.



          Finally, just go on your phone on KDEConnect, go to "Associate a new device", then click the three dots on top right, "Add devices by IP", and then add the IP of the laptop 10.100.0.3. Enjoy!



          NB: if you don't want to configure the ip on the phone side, you can also recompile KDEConnect in order to change the address of the broadcast to the ip of your phones... But it's not really practical.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503256%2fhow-to-use-kdeconnect-over-wirguard%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Let's imagine that we have three computers:




            • a server that will run the wireguard server, with wireguard ip 10.100.0.1

            • a phone that runs KDEConnect for android, with wireguard ip 10.100.0.2

            • a laptop with KDE Plasma that runs kdeconnect, with wireguard ip 10.100.0.3


            On the server first configure wireguard. I personnally chosed to use nixos to do that, but you should also be able to configure it manually, or with a .conf file. Here is my nix configuration file:



            # Source: https://nixos.wiki/wiki/Wireguard
            #### Create keys, as root:
            # mkdir ~/wireguard-keys
            # umask 077 ~/wireguard-keys
            # wg genkey > ~/wireguard-keys/private
            # wg pubkey < ~/wireguard-keys/private > ~/wireguard-keys/public
            { config, pkgs, lib, ... }:
            let
            port = 51820;
            in
            {
            environment.systemPackages = with pkgs; [ wireguard ];

            networking.wireguard.interfaces = {
            # "wg0" is the network interface name. You can name the interface arbitrarily.
            wg0 = {
            # Determines the IP address and subnet of the server's end of the tunnel interface.
            ips = [ "10.100.0.1/24" ];

            # The port that Wireguard listens to. Must be accessible by the client.
            listenPort = port;

            # Path to the private key file.
            #
            # Note: The private key can also be included inline via the privateKey option,
            # but this makes the private key world-readable; thus, using privateKeyFile is
            # recommended.
            privateKeyFile = "/root/wireguard-keys/private";

            peers = [
            # List of allowed peers.
            {
            # Android
            publicKey = "myandroidpublickey=";
            # List of IPs assigned to this peer within the tunnel subnet.
            # Used to configure routing.
            allowedIPs = [ "10.100.0.2/32" ];
            }
            {
            # Laptop
            publicKey = "mylaptoppublickey=";
            # List of IPs assigned to this peer within the tunnel subnet.
            # Used to configure routing.
            allowedIPs = [ "10.100.0.3/32" ];
            }
            ];
            };
            };

            # Ensure IP forwarding is enabled.
            boot.kernel.sysctl."net.ipv4.ip_forward" = 1;

            # Add a masquerade rule to iptables so the clients can
            # talk to the internet
            networking.firewall.extraCommands = ''
            iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE
            '';
            # Make sure port is open
            networking.firewall = {
            allowedTCPPorts = [ port ];
            allowedUDPPorts = [ port ];
            };


            }


            The important part is to make sure ip forwarding is enabled, and run the command iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE. Indeed, if you don't do masquerade, then you won't be able to access the internet from your phone, and if you forget to ensure that the destination is outside of the network before doing the masquerade, you will not be able to connect to KDEConnect from your phone (I spend lot's of time before realizing that).



            Then, configure also wireguard on your laptop, for example by putting in /etc/wireguard/wg0.conf:



            # https://wiki.archlinux.fr/Wireguard
            # To run, use:
            # wg-quick up wg0
            # ou systemctl enable --now wg-quick@wg0.service
            # Sur le noeud 2, le "client"
            [Interface]
            # le /24 est important : on définit un réseau (/24) auquel l'interface appartient
            Address = 10.100.0.3/24
            PrivateKey = computerprivatekey

            # On définit qui est le "serveur"
            [Peer]
            PublicKey = serverpublickey
            # le /24 indique ici que tous les noeuds du VPN vont d'abord communiquer avec le serveur,
            # qui va nous renvoyer ce qui nous concerne :
            # on peut s'attendre à recevoir du trafic de la part d'hypothétiques nouveaux noeuds qui seraient dans 10.X.Y/24
            AllowedIPs = 10.100.0.0/24
            Endpoint = serverip.com:51820
            # En général les clients sont derrière du NAT, et si on veut que le serveur puisse joindre le client à tout moment, il faut :
            PersistentKeepalive = 15


            On the android phone, install the wireguard app (available on the Play store and FDroid), and create a new interface, generate a new private key, in the interface address chose 10.100.0.2/32. In Peer, add the public key of the server, and put in Allowed IPs 0.0.0.0/0 (actually you can chose a stricter set of ips). Configure the endpoint to myserver.com:51820, and save/enable the configuration/test the network.



            Finally, just go on your phone on KDEConnect, go to "Associate a new device", then click the three dots on top right, "Add devices by IP", and then add the IP of the laptop 10.100.0.3. Enjoy!



            NB: if you don't want to configure the ip on the phone side, you can also recompile KDEConnect in order to change the address of the broadcast to the ip of your phones... But it's not really practical.






            share|improve this answer




























              0














              Let's imagine that we have three computers:




              • a server that will run the wireguard server, with wireguard ip 10.100.0.1

              • a phone that runs KDEConnect for android, with wireguard ip 10.100.0.2

              • a laptop with KDE Plasma that runs kdeconnect, with wireguard ip 10.100.0.3


              On the server first configure wireguard. I personnally chosed to use nixos to do that, but you should also be able to configure it manually, or with a .conf file. Here is my nix configuration file:



              # Source: https://nixos.wiki/wiki/Wireguard
              #### Create keys, as root:
              # mkdir ~/wireguard-keys
              # umask 077 ~/wireguard-keys
              # wg genkey > ~/wireguard-keys/private
              # wg pubkey < ~/wireguard-keys/private > ~/wireguard-keys/public
              { config, pkgs, lib, ... }:
              let
              port = 51820;
              in
              {
              environment.systemPackages = with pkgs; [ wireguard ];

              networking.wireguard.interfaces = {
              # "wg0" is the network interface name. You can name the interface arbitrarily.
              wg0 = {
              # Determines the IP address and subnet of the server's end of the tunnel interface.
              ips = [ "10.100.0.1/24" ];

              # The port that Wireguard listens to. Must be accessible by the client.
              listenPort = port;

              # Path to the private key file.
              #
              # Note: The private key can also be included inline via the privateKey option,
              # but this makes the private key world-readable; thus, using privateKeyFile is
              # recommended.
              privateKeyFile = "/root/wireguard-keys/private";

              peers = [
              # List of allowed peers.
              {
              # Android
              publicKey = "myandroidpublickey=";
              # List of IPs assigned to this peer within the tunnel subnet.
              # Used to configure routing.
              allowedIPs = [ "10.100.0.2/32" ];
              }
              {
              # Laptop
              publicKey = "mylaptoppublickey=";
              # List of IPs assigned to this peer within the tunnel subnet.
              # Used to configure routing.
              allowedIPs = [ "10.100.0.3/32" ];
              }
              ];
              };
              };

              # Ensure IP forwarding is enabled.
              boot.kernel.sysctl."net.ipv4.ip_forward" = 1;

              # Add a masquerade rule to iptables so the clients can
              # talk to the internet
              networking.firewall.extraCommands = ''
              iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE
              '';
              # Make sure port is open
              networking.firewall = {
              allowedTCPPorts = [ port ];
              allowedUDPPorts = [ port ];
              };


              }


              The important part is to make sure ip forwarding is enabled, and run the command iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE. Indeed, if you don't do masquerade, then you won't be able to access the internet from your phone, and if you forget to ensure that the destination is outside of the network before doing the masquerade, you will not be able to connect to KDEConnect from your phone (I spend lot's of time before realizing that).



              Then, configure also wireguard on your laptop, for example by putting in /etc/wireguard/wg0.conf:



              # https://wiki.archlinux.fr/Wireguard
              # To run, use:
              # wg-quick up wg0
              # ou systemctl enable --now wg-quick@wg0.service
              # Sur le noeud 2, le "client"
              [Interface]
              # le /24 est important : on définit un réseau (/24) auquel l'interface appartient
              Address = 10.100.0.3/24
              PrivateKey = computerprivatekey

              # On définit qui est le "serveur"
              [Peer]
              PublicKey = serverpublickey
              # le /24 indique ici que tous les noeuds du VPN vont d'abord communiquer avec le serveur,
              # qui va nous renvoyer ce qui nous concerne :
              # on peut s'attendre à recevoir du trafic de la part d'hypothétiques nouveaux noeuds qui seraient dans 10.X.Y/24
              AllowedIPs = 10.100.0.0/24
              Endpoint = serverip.com:51820
              # En général les clients sont derrière du NAT, et si on veut que le serveur puisse joindre le client à tout moment, il faut :
              PersistentKeepalive = 15


              On the android phone, install the wireguard app (available on the Play store and FDroid), and create a new interface, generate a new private key, in the interface address chose 10.100.0.2/32. In Peer, add the public key of the server, and put in Allowed IPs 0.0.0.0/0 (actually you can chose a stricter set of ips). Configure the endpoint to myserver.com:51820, and save/enable the configuration/test the network.



              Finally, just go on your phone on KDEConnect, go to "Associate a new device", then click the three dots on top right, "Add devices by IP", and then add the IP of the laptop 10.100.0.3. Enjoy!



              NB: if you don't want to configure the ip on the phone side, you can also recompile KDEConnect in order to change the address of the broadcast to the ip of your phones... But it's not really practical.






              share|improve this answer


























                0












                0








                0







                Let's imagine that we have three computers:




                • a server that will run the wireguard server, with wireguard ip 10.100.0.1

                • a phone that runs KDEConnect for android, with wireguard ip 10.100.0.2

                • a laptop with KDE Plasma that runs kdeconnect, with wireguard ip 10.100.0.3


                On the server first configure wireguard. I personnally chosed to use nixos to do that, but you should also be able to configure it manually, or with a .conf file. Here is my nix configuration file:



                # Source: https://nixos.wiki/wiki/Wireguard
                #### Create keys, as root:
                # mkdir ~/wireguard-keys
                # umask 077 ~/wireguard-keys
                # wg genkey > ~/wireguard-keys/private
                # wg pubkey < ~/wireguard-keys/private > ~/wireguard-keys/public
                { config, pkgs, lib, ... }:
                let
                port = 51820;
                in
                {
                environment.systemPackages = with pkgs; [ wireguard ];

                networking.wireguard.interfaces = {
                # "wg0" is the network interface name. You can name the interface arbitrarily.
                wg0 = {
                # Determines the IP address and subnet of the server's end of the tunnel interface.
                ips = [ "10.100.0.1/24" ];

                # The port that Wireguard listens to. Must be accessible by the client.
                listenPort = port;

                # Path to the private key file.
                #
                # Note: The private key can also be included inline via the privateKey option,
                # but this makes the private key world-readable; thus, using privateKeyFile is
                # recommended.
                privateKeyFile = "/root/wireguard-keys/private";

                peers = [
                # List of allowed peers.
                {
                # Android
                publicKey = "myandroidpublickey=";
                # List of IPs assigned to this peer within the tunnel subnet.
                # Used to configure routing.
                allowedIPs = [ "10.100.0.2/32" ];
                }
                {
                # Laptop
                publicKey = "mylaptoppublickey=";
                # List of IPs assigned to this peer within the tunnel subnet.
                # Used to configure routing.
                allowedIPs = [ "10.100.0.3/32" ];
                }
                ];
                };
                };

                # Ensure IP forwarding is enabled.
                boot.kernel.sysctl."net.ipv4.ip_forward" = 1;

                # Add a masquerade rule to iptables so the clients can
                # talk to the internet
                networking.firewall.extraCommands = ''
                iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE
                '';
                # Make sure port is open
                networking.firewall = {
                allowedTCPPorts = [ port ];
                allowedUDPPorts = [ port ];
                };


                }


                The important part is to make sure ip forwarding is enabled, and run the command iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE. Indeed, if you don't do masquerade, then you won't be able to access the internet from your phone, and if you forget to ensure that the destination is outside of the network before doing the masquerade, you will not be able to connect to KDEConnect from your phone (I spend lot's of time before realizing that).



                Then, configure also wireguard on your laptop, for example by putting in /etc/wireguard/wg0.conf:



                # https://wiki.archlinux.fr/Wireguard
                # To run, use:
                # wg-quick up wg0
                # ou systemctl enable --now wg-quick@wg0.service
                # Sur le noeud 2, le "client"
                [Interface]
                # le /24 est important : on définit un réseau (/24) auquel l'interface appartient
                Address = 10.100.0.3/24
                PrivateKey = computerprivatekey

                # On définit qui est le "serveur"
                [Peer]
                PublicKey = serverpublickey
                # le /24 indique ici que tous les noeuds du VPN vont d'abord communiquer avec le serveur,
                # qui va nous renvoyer ce qui nous concerne :
                # on peut s'attendre à recevoir du trafic de la part d'hypothétiques nouveaux noeuds qui seraient dans 10.X.Y/24
                AllowedIPs = 10.100.0.0/24
                Endpoint = serverip.com:51820
                # En général les clients sont derrière du NAT, et si on veut que le serveur puisse joindre le client à tout moment, il faut :
                PersistentKeepalive = 15


                On the android phone, install the wireguard app (available on the Play store and FDroid), and create a new interface, generate a new private key, in the interface address chose 10.100.0.2/32. In Peer, add the public key of the server, and put in Allowed IPs 0.0.0.0/0 (actually you can chose a stricter set of ips). Configure the endpoint to myserver.com:51820, and save/enable the configuration/test the network.



                Finally, just go on your phone on KDEConnect, go to "Associate a new device", then click the three dots on top right, "Add devices by IP", and then add the IP of the laptop 10.100.0.3. Enjoy!



                NB: if you don't want to configure the ip on the phone side, you can also recompile KDEConnect in order to change the address of the broadcast to the ip of your phones... But it's not really practical.






                share|improve this answer













                Let's imagine that we have three computers:




                • a server that will run the wireguard server, with wireguard ip 10.100.0.1

                • a phone that runs KDEConnect for android, with wireguard ip 10.100.0.2

                • a laptop with KDE Plasma that runs kdeconnect, with wireguard ip 10.100.0.3


                On the server first configure wireguard. I personnally chosed to use nixos to do that, but you should also be able to configure it manually, or with a .conf file. Here is my nix configuration file:



                # Source: https://nixos.wiki/wiki/Wireguard
                #### Create keys, as root:
                # mkdir ~/wireguard-keys
                # umask 077 ~/wireguard-keys
                # wg genkey > ~/wireguard-keys/private
                # wg pubkey < ~/wireguard-keys/private > ~/wireguard-keys/public
                { config, pkgs, lib, ... }:
                let
                port = 51820;
                in
                {
                environment.systemPackages = with pkgs; [ wireguard ];

                networking.wireguard.interfaces = {
                # "wg0" is the network interface name. You can name the interface arbitrarily.
                wg0 = {
                # Determines the IP address and subnet of the server's end of the tunnel interface.
                ips = [ "10.100.0.1/24" ];

                # The port that Wireguard listens to. Must be accessible by the client.
                listenPort = port;

                # Path to the private key file.
                #
                # Note: The private key can also be included inline via the privateKey option,
                # but this makes the private key world-readable; thus, using privateKeyFile is
                # recommended.
                privateKeyFile = "/root/wireguard-keys/private";

                peers = [
                # List of allowed peers.
                {
                # Android
                publicKey = "myandroidpublickey=";
                # List of IPs assigned to this peer within the tunnel subnet.
                # Used to configure routing.
                allowedIPs = [ "10.100.0.2/32" ];
                }
                {
                # Laptop
                publicKey = "mylaptoppublickey=";
                # List of IPs assigned to this peer within the tunnel subnet.
                # Used to configure routing.
                allowedIPs = [ "10.100.0.3/32" ];
                }
                ];
                };
                };

                # Ensure IP forwarding is enabled.
                boot.kernel.sysctl."net.ipv4.ip_forward" = 1;

                # Add a masquerade rule to iptables so the clients can
                # talk to the internet
                networking.firewall.extraCommands = ''
                iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE
                '';
                # Make sure port is open
                networking.firewall = {
                allowedTCPPorts = [ port ];
                allowedUDPPorts = [ port ];
                };


                }


                The important part is to make sure ip forwarding is enabled, and run the command iptables -t nat -A POSTROUTING -s 10.100.0.0/24 ! -d 10.100.0.0/24 -j MASQUERADE. Indeed, if you don't do masquerade, then you won't be able to access the internet from your phone, and if you forget to ensure that the destination is outside of the network before doing the masquerade, you will not be able to connect to KDEConnect from your phone (I spend lot's of time before realizing that).



                Then, configure also wireguard on your laptop, for example by putting in /etc/wireguard/wg0.conf:



                # https://wiki.archlinux.fr/Wireguard
                # To run, use:
                # wg-quick up wg0
                # ou systemctl enable --now wg-quick@wg0.service
                # Sur le noeud 2, le "client"
                [Interface]
                # le /24 est important : on définit un réseau (/24) auquel l'interface appartient
                Address = 10.100.0.3/24
                PrivateKey = computerprivatekey

                # On définit qui est le "serveur"
                [Peer]
                PublicKey = serverpublickey
                # le /24 indique ici que tous les noeuds du VPN vont d'abord communiquer avec le serveur,
                # qui va nous renvoyer ce qui nous concerne :
                # on peut s'attendre à recevoir du trafic de la part d'hypothétiques nouveaux noeuds qui seraient dans 10.X.Y/24
                AllowedIPs = 10.100.0.0/24
                Endpoint = serverip.com:51820
                # En général les clients sont derrière du NAT, et si on veut que le serveur puisse joindre le client à tout moment, il faut :
                PersistentKeepalive = 15


                On the android phone, install the wireguard app (available on the Play store and FDroid), and create a new interface, generate a new private key, in the interface address chose 10.100.0.2/32. In Peer, add the public key of the server, and put in Allowed IPs 0.0.0.0/0 (actually you can chose a stricter set of ips). Configure the endpoint to myserver.com:51820, and save/enable the configuration/test the network.



                Finally, just go on your phone on KDEConnect, go to "Associate a new device", then click the three dots on top right, "Add devices by IP", and then add the IP of the laptop 10.100.0.3. Enjoy!



                NB: if you don't want to configure the ip on the phone side, you can also recompile KDEConnect in order to change the address of the broadcast to the ip of your phones... But it's not really practical.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 14 mins ago









                tobiasBoratobiasBora

                249211




                249211






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503256%2fhow-to-use-kdeconnect-over-wirguard%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    サソリ

                    広島県道265号伴広島線

                    Setup Asymptote in Texstudio