Setting up WireGuard on LTE WWAN

Hi,
I've been trying to setup WireGuard to access my local network from the outside. I use an LTE module as the wan interface.
I've tested port forwarding and it works with SSH, the network is not under CG-NAT.
My problem is that when I connect too the WG server from a client, RX stays at 0 bytes and it doesn't connect.
I have set WireGuard into the lan zone.
My /etc/config/network :

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option packet_steering '1'

config interface 'lan'
        option type 'bridge'
        option ifname 'lan1 lan2 lan3 lan4'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.1.1'

config interface 'wan'
        option ifname 'wan'
        option proto 'dhcp'

config interface 'LTEWAN'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option apn 'movistar.es'
        option auth 'none'
        option pdptype 'ipv4'

config interface 'WireGuard'
        option proto 'wireguard'
        option private_key '**myprivkey**'
        option listen_port '53'
        list addresses '192.168.2.1/24'

config wireguard_WireGuard
        option description 'Mi9TPro'
        option public_key '**mypubkey**'
        option route_allowed_ips '1'
        list allowed_ips '192.168.2.2/32'
        option endpoint_host '192.168.2.1'

My client config:

[Interface]
Address = 192.168.2.2/32
DNS = 192.168.2.1
PrivateKey = **another different private key?**

[Peer]
AllowedIPs = 0.0.0.0/0
Endpoint = **router public ip**:53
PublicKey = **another different public key?**

There's probably something very wrong with my config, but I don't have any experience with WireGuard.
Thanks.

For every participant in a WireGuard VPN, the public key should be the public key of the other end of the connection. It's a peer-to-peer paradigm.

On your router, the public_key should be the public key of the client. On the client, the public key should be the public key of the router.

Also, don't use port 53 for WireGuard; it'll interfere with DNS. In fact, don't use any Well-Known Ports for WireGuard; it's better to keep WireGuard in the >1024 port range.

2 Likes

Thanks, the issue was port 53 all along. Port 51820 works fine. Also, the public key was the same, so no issues there.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.