Mostrando las entradas con la etiqueta zerotier. Mostrar todas las entradas
Mostrando las entradas con la etiqueta zerotier. Mostrar todas las entradas

martes, noviembre 01, 2022

Instalar Zerotier en Vyos

 Zerotier es una solucion simple y potente para implementar SDWAN, y aunque Vyos no tiene soporte por defecto si se puede implementar en este. Para esto seguiremos los siguientes pasos:


Instalacion

Se utilizara el procedimiento recomendo por Zerotier


root@FW:~# curl -s https://install.zerotier.com | sudo bash

*** ZeroTier Service Quick Install for Unix-like Systems

*** Tested OSes / distributions:

***   MacOS (10.13+) (just installs ZeroTier One.pkg)
***   Debian Linux (7+)
***   RedHat/CentOS Linux (6+)
***   Fedora Linux (16+)
***   SuSE Linux (12+)
***   Mint Linux (18+)

*** Supported architectures vary by OS / distribution. We try to support
*** every system architecture supported by the target.

*** Please report problems to contact@zerotier.com and we will try to fix.

*** Detecting Linux Distribution

*** Found Debian, creating /etc/apt/sources.list.d/zerotier.list
OK

*** Installing zerotier-one package...
Get:1 http://download.zerotier.com/debian/buster buster InRelease [36.8 kB]
Get:2 http://download.zerotier.com/debian/buster buster/main amd64 Packages [5,102 B]
Fetched 41.9 kB in 0s (103 kB/s)     
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  zerotier-one
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,143 kB of archives.
After this operation, 10.8 MB of additional disk space will be used.
Get:1 http://download.zerotier.com/debian/buster buster/main amd64 zerotier-one amd64 1.10.1 [3,143 kB]
Fetched 3,143 kB in 0s (31.8 MB/s)     
Selecting previously unselected package zerotier-one.
(Reading database ... 65607 files and directories currently installed.)
Preparing to unpack .../zerotier-one_1.10.1_amd64.deb ...
Unpacking zerotier-one (1.10.1) ...
Setting up zerotier-one (1.10.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/zerotier-one.service → /lib/systemd/system/zerotier-one.service.
Processing triggers for systemd (241-7~deb10u8) ...
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB

Total disk space freed by localepurge: 0 KiB


*** Enabling and starting ZeroTier service...
Synchronizing state of zerotier-one.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zerotier-one

*** Waiting for identity generation...

*** Success! You are ZeroTier address [ 55f72cb6f1 ].



Agrega a una network de Zerotier

Ya tenemos instalado Zerotier, debemos unir Vyos a una de las redes de Zerotier para esto debemos ejecutar lo siguiente:

root@FW~# zerotier-cli join 12xxxxxxxxxxxx
200 join OK
ya realizado esto, debemos nnombre la interface nuevo con nombre tipo ethXX para que Vyos la reconozco. Para esto debemos crear el archivo /var/lib/zerotier-one/devicemap y agregar lo siguiente:
12xxxxxxxxxxxx=eth10

y debemos reiniciar Zerotier

root@FW:~# /etc/init.d/zerotier-one restart
[ ok ] Restarting zerotier-one (via systemctl): zerotier-one.service.
root@FW:~# ifconfig eth10
eth10: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2800
inet 192.168.194.163 netmask 255.255.255.0 broadcast 192.168.194.255
ether 56:2f:58:5d:a8:bb txqueuelen 1000 (Ethernet)
RX packets 24 bytes 1968 (1.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17 bytes 2066 (2.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

root@FW:~# exit
exit

vyos@FW:~$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 xx.xx.xx.xx/29 u/u
eth1 xx.xx.xx.xx/24 u/u
eth10 192.168.194.163/24 u/u
lo 127.0.0.1/8 u/u
::1/128

Y ya estamos