Skip to content

ZeroTier “ERROR: unable to configure virtual network port: could not open TUN/TAP device: No such file or directory” di OpenVZ

Masalah

Ketika kita menginstall ZeroTier pada suatu host, biasanya yang kita lakukan adalah langsung menjoinkan host tersebut ke ZeroTier network kita. Namun, ketika saya mencoba menjoinkan VM berbasis OpenVZ, saya hanya mendapati message Join 500 (), sementara VM saya tidak terhubung ke ZeroTier network.

Selain itu, jika saya lihat status service ZeroTier, ada errornya.

root@vm:~# service zerotier-one status
 zerotier-one.service - ZeroTier One
    Loaded: loaded (/lib/systemd/system/zerotier-one.service; enabled; vendor preset: enabled)
    Active: active (running) since Mon 2021-09-20 21:11:20 BST; 4s ago
    Main PID: 1437 (zerotier-one)
    Tasks: 4 (limit: 19660)
    Memory: 4.7M
    CGroup: /system.slice/zerotier-one.service
    └─1437 /usr/sbin/zerotier-one

Apr 07 21:09:14 vm systemd[1]: Stopping ZeroTier One…
Apr 07 21:09:14 vm systemd[1]: zerotier-one.service: Succeeded.
Apr 07 21:09:14 vm systemd[1]: Stopped ZeroTier One.
Apr 07 21:11:20 vm systemd[1]: Started ZeroTier One.
Apr 07 21:11:20 vm zerotier-one[1437]: ERROR: unable to configure virtual network port: could not open TUN/TAP device: No such file or directory

Solusi

  • Pastikan TUN/TAP device sudah aktif. Kita bisa aktifkan sendiri, atau konsultasikan dengan tim support hosting provider.
  • [OPSIONAL] Set permission 666 untuk /dev/net/tun
chmod 0666 /dev/net/tun
  • Tambahkan option -U di akhir baris ExecStart= pada file /lib/systemd/system/zerotier-one.service, sehingga tampak seperti berikut:
[Unit]
Description=ZeroTier One
After=network.target

[Service]
ExecStart=/usr/sbin/zerotier-one -U
  • Lalu lakukan reload
root@vm:~# service zerotier-one stop
Warning: The unit file, source configuration file or drop-ins of zerotier-one.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.

root@vm:~# systemctl daemon-reload
root@vm:~# service zerotier-one stop
root@vm:~# service zerotier-one start

Sampai di sini, ketika kita melihat status ZeroTier, harusnya sudah tidak ada masalah.

root@vm:~# service zerotier-one status
 zerotier-one.service - ZeroTier One
     Loaded: loaded (/lib/systemd/system/zerotier-one.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-04-07 22:39:42 WIB; 1h 32min ago
   Main PID: 783 (zerotier-one)
      Tasks: 6 (limit: 9334)
     Memory: 13.4M
        CPU: 25.758s
     CGroup: /system.slice/zerotier-one.service
             └─783 /usr/sbin/zerotier-one

Apr 07 22:39:42 vm systemd[1]: Started ZeroTier One.

Begitu juga jika dilakukan ip a dan list networks, harusnya sudah sesuai harapan.

root@vm:~# zerotier-cli listnetworks
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>
200 listnetworks XXXXXXXXXXXXXXXX oil-skiing-saddling xx:xx:xx:xx:xx:xx OK PRIVATE ztXXXXXXXX 192.168.XXX.XXX/24

Selamat mencoba.

Published inIT Related