RUT 240 VPN Wireguard problem

Hello,
I have tried to add and configure a Wireguard instance on my RUT 240. However, I cannot add a peer for the instance. The field is gray and not accessible. The peer is a GateWay based on a Raspberry Pi 4B, which was really simple to implement Wireguard on. The firmware is 07.04.1. Can anyone help me with this. It would really be appreciated.

Using the menu path …

SERVICES > VPN > WIREGUARD > WIREGUARD CONFIGURATION > EDIT [insert your tunnel name]

… and in the box entitled ‘Add new peer instance’, what happens when you enter a peer name and press the ‘Add’ button?

If that works, do your setup and don’t forget to ‘Save & Apply’.

Hi Mike,

Thank you for your reply and clarification.

Yes, I have tried to add a peer by editing the existing WireGuard instance (wg0) via the path:

SERVICES > VPN > WIREGUARD > WIREGUARD CONFIGURATION > EDIT wg0**

However, in the “Peers” section, the fields are completely grayed out and not clickable. I see no “Add” button or editable input fields in that section. The only option available at the bottom of the page is “Add New Instance”, which seems to be for creating a new tunnel, not for adding a peer to the existing wg0.

I have:

  • Tried different browsers (Chrome, Firefox) and devices (including a fresh session on another computer)
  • Saved and applied the configuration
  • Logged out and back in again

But the problem persists. I cannot enter any peer details at all.

Do you have any suggestions, or could this be a firmware issue?

Thanks again for your help!

Most strange … if it were me, I’d reflash the firmware with ‘keep settings off’ then either reconfigure manually or restore from a backup.

As an alternative, and assuming you know your way around wireguard etc, tou could manually add the configuration into the config file.

WireGuard config is embedded in the /etc/config/network file and it should have two destinct sections to wireguard. The first if for the tunnel setup and the second is for the peer. As an example, see below, but you will have to ammend it according to your config.

The Public and Private keys have been altered to be non-sensical in the example.

Hi again,
I agree with you…most strange.
Thanks for your help. I have reflashed the firmware on RUT 240
according to your instructions. I have also tried to modify my Wireguard config file based on your proposal and ChatGPT instructions. I still cannot achieve a connection between the two nodes communicating via RUT 240. I am very close to give up. My final attempt is to show you the config file that I have used and if you can see any obvious errors in the configuration, that ChatGPT does not understand. Are there any other setup in RUT240 that need to be configured, besides the DDNS and Port Forwards. I am using UDP and not LTE. For your further information, I had no problems to communicate via Wireguard between the two nodes alone before I also included RUT 240 into the communication chain. I tried to upload the png-file below.

Two remarks:

  • as the RUT is the initiator the option listen_port ‘51822’ isn’t required just delete the line wireguard will use a random port
  • the list allowed_ips ‘10.0.0.2/32’ seems overly restrictive could you try with 10.0.0.0/24 instead ?

You need to ensure that the peer settings on the RUT reflects the settings on your Pi.

For example, is your Pi listening on port 51822 or is it listening on the wireguard default port of 51820. This is the ‘endpoint_port’ setting on your RUT

As I said in my previous comment, “… you will have to ammend it according to your config”

As a last comment, forget about ChatGP it’s useless and insulting to the official Teltonika support people that use this forum (I am not a Teltonika employee).

Thanks for the remarks. Unfortunately, no difference in the result.

Right, I have worked intense to make the settings correct on all three nodes, including the RUT 240. When the 51820 didn’t work, we thought changing to 51821, but then I saw you used 51822 in your example, so I tried that instead. It still doesn’t work.

I respect that ChatGPT may sound not politically correct in all contexts, but it is very powerful, whatever people say. Of course, it can also be very wrong sometimes, but who cannot ? However, thanks for you pointing it out.

What is the output of the wg command on the RUT ?

Here is the output of wg on RUT 240.

"root@RUT240:~# wg
interface: wg0
public key: FtJGIq4yZRlPMJq0rx1Uq3beuPgCa5atqQC+r6NxTG0=
private key: (hidden)
listening port: 42619

peer: CAlDUPh0P+L4HxkgDDBc7mSIvJOPufHWOYX62ErawGs=
endpoint: 84.55.123.99:51822
allowed ips: 10.0.0.0/24
transfer: 0 B received, 60.12 KiB sent
persistent keepalive: every 25 seconds
"
As you can see, I have changed the listening port so it is random.

Are you sure that the server listens on port 51822 ? The RUT send frames (60.12 kb sent) nothing is ever received.
To test the listen port hypothesis you can try a

tcpdump -i any -n -v icmp

you might see icmp errors coming in if so 51822 is the wrong port.
If not one of the keys is probably wrong or the pre-shared key is required by the server but missing in the RUT’s config.

1 Like

Thanks for the tcpdump tool. I had made a mistake in one of the private keys. But, after changing the system still didn’t want to tunnel data. In conclusion, I haven’t been able to get it working, and I don’t want to take too much of your time here in the community. There are so many question marks and it feels insurmountable when you don’t see any communication after you have tried plenty of combinations, and there probably many more to go. One of my bad feelings has all the time been that, eventhough the RUT 240 wireguard configuration file may look good, the wireguard is all the time disabled on the admin page. I would need professional guidance to have any chance to make this thing working. Sad, but I give up. Thanks for all help !

No issue with the time spent. Debugging wireguard configs is not always that easy when something goes astray.

Did tcpdump report incoming icmp port unreachable errors ?

Yes, I got unreachable errors on 51822. I am about to return the RUT 240 today actually. Do you think you could help me to get them working ?

Sure I am available today.

Fantastic. Would it be possible to solve this problem from another platform, email or even Teams ?

This platform is almost real-time, and the resolution path might be useful for future users.

Try with port 51820 while keeping a tcpdump running. Do you still have icmp port unreachable errors ?

Sorry, I’ve been distracted w other problems this afternoon. Now, I am back and focused. I would like to give some background to my problem. I have a chain of nodes that communicate with VPN (wireguard). The start node is a gateway (GW) that should communicate with the end node, that is a NUC computer remotely. The end node is at home. Therefore, I also need a router remotely, which is the RUT 240. The first demo that I am planning is to communicate via the fixed broadband. So, altogether I have a chain of four nodes communicating via Wireguard: 1. GW (WiFi) - > 2. RUT 240 (Broadband- WAN) → 3. Router home - > 4. NUC. I have configured Wireguard on 1, 2 and 4 and tried to establish communication between them at home, but not succeeded. Where would you like to start. I need to work as methodical as possible, since I don’t work with VPN and router technology daily. Please, tell me how you would like to start resolving this problem. I could start sending you all three wireguard config-files if you like ? Please, let me know if anything is unclear.