Wireguard Comet Pro

Hey there, I’ve got my Comet Pro KVM from Kickstarter campaign. I love it ant want to use it remotely via WireGuard.

I’ve tried to establish a connection via WireGuard, but I got the following error:

$ wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 192.168.x.x/32 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
/usr/bin/wg-quick: line 32: resolvconf: command not found
[#] ip link delete dev wg0

Furthermore, I want to enable the service via systemctl enable [email protected] there is neither systemctl nor service installed on the system. Does anyone know how to solve both problems?

Version on the system: v1.7.0 release2 (RM10)

Thanks
Tom

Our other users have successfully configured WireGuard on Comet.

You can refer to these instructions for configuration: GitHub - fragtastic/gl-rm1_wireguard: Wireguard on GL.iNet Comet GL-RM1

@Flora72 thanks for your fast response. I reset the comet pro and tried it again, but it fails. WireGuard is installed by default, so I think the issue is that the resolvconf binary is missing.

Steps to reproduce:

  1. Start the Comet Pro (V1.7.0release2 (RM10).
  2. Generate a WireGuard configuration.
  3. Store the configuration under /etc/wireguard/wg0.conf
  4. Run the command: wg-quick up wg0

To my mind the issue I have should be come up. Can you or somebody else can try it? Just to double check.

Afterwards I want to follow the instructions you posted. But to my mind it shouldn’t be neccessary to install wireguard again via the install script like in the github repo.

I can also have a call or private chat for more troubleshooting, if the issue is confirmed or if you need more information.

Some updates here?

RM10 does not support systemctl and service, WireGuard can be configured without those service:

Manual setup (replace [config-path] and [your-ip]):
ip link add wg0 type wireguard
wg setconf wg0 [config-path]
ip link set wg0 up
ip addr add [your-ip] dev wg0
Example: ip addr add 192.168.100.2/24 dev wg0

For auto-start: Add these commands to a boot script, this avoids wg-quick dependencies entirely.
For reference, boot script/etc/rc.local (create if missing):
echo "ip link add wg0 type wireguard;wg setconf wg0 [config-path]
ip link set wg0 up;ip addr add [your-ip] dev wg0" >> /etc/rc.local
chmod +x /etc/rc.local

Hope this help!

it does not work. Afaik the comet and comet pro has different firmware installed on the system. wg-quick is already installed but I encounter some issues. First with DNS entry:

 bash-5.2# wg-quick up wg0      

[#] ip link add wg0 type wireguard

[#] wg setconf wg0 /dev/fd/63

[#] ip -4 address add 192.168.4.5/32 dev wg0

[#] ip link set mtu 1420 up dev wg0

[#] resolvconf -a wg0 -m 0 -x

/bin/wg-quick: line 32: resolvconf: command not found

[#] ip link delete dev wg0 

after I removed the dns entry:

ash-5.2# wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 192.168.4.5/32 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
[#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
[#] iptables-restore -n
Warning: Extension addrtype revision 0 not supported, missing kernel module?
Warning: Extension comment revision 0 not supported, missing kernel module?
iptables-restore: line 3 failed
[#] ip -4 rule delete table 51820
[#] ip -4 rule delete table main suppress_prefixlength 0
[#] ip link delete dev wg0

Is there any way to get wq-quick working out of the box with a firmware update?

Is it possible to install softwarepackages or contribute to the project? I want to try to fix it but I cant since no package manager I know isn’t installed.

wg-quick is a script that does different things depending on your wireguard configuration (in /etc/wireguard/wg0.conf). Use manual instructions as @Flora72 said and post the error if any. Also include your wg configuration for additional support.

@juno here is are the full terminal what i have done:

"/etc/wireguard/wg0.conf" 7L, 189B written
bash-5.2# cat /etc/wireguard/wg0.conf
[Interface]
PrivateKey = 4Fc1DaYWU4xxxxx6fnVEY=

[Peer]
PublicKey = FpDbxxxxxxxFTCmU=
AllowedIPs = 0.0.0.0/0
Endpoint = xxx.xxx.xxx.xxx:xxxxx
bash-5.2# ip link add wg0 type wireguard
bash-5.2#  wg setconf wg0 /etc/wireguard/wg0.conf
bash-5.2#  ip link set wg0 up
bash-5.2#  ip addr add 192.168.4.8 dev wg0
bash-5.2# wg show
interface: wg0
public key: SMWU2xxxxxnHWyM=
private key: (hidden)
listening port: 57312

peer: FpDbAxxxxxCmU=
endpoint: xxx.xxx.xxx.xxx:xxxxx
allowed ips: 0.0.0.0/0
bash-5.2# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=113 time=28.0 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=113 time=41.2 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=113 time=56.6 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=113 time=43.4 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=113 time=25.4 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=113 time=41.4 ms
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 25.420/39.343/56.603/10.358 ms
bash-5.2# ping 192.168.xxx.1
PING 192.168.xxx.1 (192.168.xxx.1) 56(84) bytes of data.
^C
--- 192.168.xxx.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4060ms

bash-5.2# ping 192.168.xxx.2
PING 192.168.xxx.2 (192.168.xxx.2) 56(84) bytes of data.
^C
--- 192.168.xxx.2 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1000ms

bash-5.2# ip addr | grep wg0
5: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
inet 192.168.xxx.8/32 scope global wg0

I’m using the integrated unifi wireguard server.

I assume your wg network is 192.168.4.0/24? Make sure it doesn’t conflict with other networks you are attached to.

What is your use case? you likely don’t need 0.0.0.0/0 in AllowIPs.

is your wg server reachable publicly? Like what devices are supposed to be on addresses 192.168.xxx.1 and 192.168.xxx.2 that you are pinging. These are local addresses, you don’t need to hide them or it is hard to debug

Local network of the kvm is 192.168.34.0/24

Remote wireguard network 192.168.4.0/24

Remote local Network 192.168.67.0/24

I have successfully conntected an unraid server with the same networks and an Fedora client also with the same networks (i use a DNS entry for the public endpoint). But it does not work with the public IP in the kvm.

As far as I know is the 0.0.0.0 required to send all traffic over the wireguard Network.

Ok, but I am still missing something, I will have to assume it. There are 4 devices. A is the KVM, B is the device attached to the KVM that you want to control, C is the wireguard server, and finally D is the client device you will use to reach the KVM and finally control B.

A and B are in the local network 192.168.34.0/24. Where are C and D? I assume they are both in the remote local network 192.168.67.0/24. Now, how are these 2 local network connected? I assume C has a public IP, is that the case?

If your goal is to control B from D, then you don’t need to allow 0.0.0.0/0. But we will get there, first we need to clarify the use case

Alright more information:
A: The KVM has the ip: 192.168.34.45 (and wireguard network IP 192.168.4.8) → is not connected
B: The server which is attached to the kvm has: 192.168.34.41 (this server is also successfully connected via wireguard 192.168.4.3)
C: is the wireguard server and is in the remote local network (192.168.67.2)
D: is a client device with the ip 192.168.67.8

Usecase Client D (192.168.67.8) want to access A the KVM via the wireguard IP (192.168.4.8)

The clients in the remote network have access to the wireguard network (D can access B)

If you need more information let me know.

Ok try this configuration for the kvm:

[Interface]
PrivateKey = ...
Address = 192.168.4.8/32
PostUp = iptables -A FORWARD -i %i -j ACCEPT
PostUp = sysctl -w net.ipv4.ip_forward=1
PostDown = iptables -D FORWARD -i %i -j ACCEPT

[Peer]
PublicKey = ….
AllowedIPs = 192.168.4.0/24
Endpoint = xxx.xxx.xxx.xxx:xxxxx

Then activate it with wg-quick up. Compared to your previous configuration, it specifies the address of the kvm, creates a rule in iptables to allow forward traffic (only on the wireguard interface), enable ip forwarding in the kernel, and limit the AllowedIPs to the wireguard network.

If the connection establishes (check with wg show), then you can try to ping the KVM from D. If the ping works, it should also work opening the KVM web interface in the browser from D

bash-5.2# wg setconf wg0 /etc/wireguard/wg0.conf
Line unrecognized: `PostUp=iptables-AFORWARD-i%i-jACCEPT'
Configuration parsing error

Same for Address.

bash-5.2# wg setconf wg0 /etc/wireguard/wg0.conf
Line unrecognized: `Address=192.168.4.8/32'
Configuration parsing error

PostUp and Address are lines recognized only by the wg-quick command, that is why I said “activate it with wg-quick up“. Try with “wg-quick up wg0“