Wireguard from android to raspberrypi not working over internet

Hi,
First of all i want to thank remote.it team for building such an awesome product. I have used it for ssh and rdp, where it works great.
I am facing some issue in making it work with wireguard vpn.

I was able to setup remote.it client on raspberrypi. My raspberrypi also has pihole and pivpn setup. I can run wireguard from my android phone if i am connected on the same LAN( by using the local ip address in wireguard: 192.168.1.123:51800). But when I try to connect outside LAN, using the remoteit tunnel from my android phone(localhost:51800, which tunnels to raspberrypi port 51800), the connection never seems to work.
Remoteit client is configured properly, as I have also tested VNC connection type on the same raspberrypi machine using cellular network.

Is wireguard connection type supported with raspberrypi?

This is my connection type:

  • Service Name:vpn
  • Service Port:51899
  • Service Protocol:UDP
  • Service Type:WireGuard
  • Service ID: **************

One thing I would double check is your port configuration:

Service Port:51899

does not match 51800.

On the Pi itself, can you run:

sudo netstat -lpn | grep udp

and send the result?

I am using 51899 vs the default 51800 everywhere, which i forgot to mention earlier.’

Netstat results:
udp 0 0 127.0.0.1:43074 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:68 0.0.0.0:* 416/dhcpcd
udp 0 0 0.0.0.0:36935 0.0.0.0:* 695/connectd
udp 0 0 0.0.0.0:631 0.0.0.0:* 4056/cups-browsed
udp 0 0 0.0.0.0:44168 0.0.0.0:* 704/connectd
udp 0 0 127.0.0.1:49818 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:55963 0.0.0.0:* 704/connectd
udp 0 0 0.0.0.0:59066 0.0.0.0:* 637/connectd
udp 0 0 0.0.0.0:51899 0.0.0.0:* -
udp 0 0 127.0.0.1:36545 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:46291 0.0.0.0:* 644/connectd
udp 0 0 127.0.0.1:40154 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:44258 0.0.0.0:* 637/connectd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 374/avahi-daemon: r
udp 0 0 0.0.0.0:54022 0.0.0.0:* 695/connectd
udp 0 0 127.0.0.1:44808 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:44338 0.0.0.0:* 644/connectd
udp 0 0 127.0.0.1:5980 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:59743 0.0.0.0:* 661/connectd
udp 0 0 0.0.0.0:54153 0.0.0.0:* 613/connectd
udp 0 0 0.0.0.0:39890 0.0.0.0:* 613/connectd
udp 0 0 0.0.0.0:53216 0.0.0.0:* 374/avahi-daemon: r
udp 0 0 127.0.0.1:56306 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:51197 0.0.0.0:* 677/connectd
udp 0 0 0.0.0.0:44045 0.0.0.0:* 661/connectd
udp 0 0 127.0.0.1:38425 0.0.0.0:* 402/remoteit_linux_
udp 0 0 0.0.0.0:35867 0.0.0.0:* 677/connectd

Remote.it connection type:
connection type:

  • Service Name:vpn
  • Service Port:51899
  • Service Protocol:UDP
  • Service Type:WireGuard
  • Service ID: **************

Also adding wireguard configuration here:

pi@raspberrypi : sudo wg show
interface : wg0
public key : EZ+yoAwc80Dg8/zZELeWyu13osDFzQt6RiliQvDDfXw=
private key : (hidden)
listening port : 51899
peer : ICQXTiitMcj49ZK5no4RKGuUiTcMSo0zDCKFNo1pm2A=
preshared key : (hidden)
allowed ips : 10.6.0.2/32

Wireguard Client configuration:
pi@raspberrypi : cat /home/pi/configs/client.conf
[Interface]
PrivateKey = (hidden)
Address = 10.6.0.2/24
DNS = 10.6.0.1

[Peer]
PublicKey = EZ+yoAwc80Dg8/zZELeWyu13osDFzQt6RiliQvDDfXw=
PresharedKey = (hidden)
Endpoint = localhost:51899
AllowedIPs = 0.0.0.0/0, ::0/0

On the Android device, are you actually able to achieve a P2P (localhost) connection? I just realized that the mobile app works differently than the desktop. If you get a proxy connection (e.g. proxyXX.rt3.io) then this approach won’t work. You could still do it in a pinch but it would require editing the client configuration endpoint/port every time you make a connection.

Yes I do get a working proxy as you describe but it does not seem to work when pasted in on the client config with Android or Windows10. Hence my question is it tried and tested?