Instalar Pi-Hole, UniFi Controller, LibreSpeed y Candy en Mikrotik RouterOS «CHR»

Antes de empezar por favor asegúrese de tener habilitado y activado el paquete Container de RouterOS

Container – RouterOS – MikroTik Documentation

Crear red
Agregamos la interfaz veth1 para Pi-Hole, veth2 para UniFi y veth3 para LibreSpeed

/interface/veth/add name=veth1 address=172.17.0.2/16 gateway=172.17.0.1
/interface/veth/add name=veth2 address=172.17.0.3/16 gateway=172.17.0.1
/interface/veth/add name=veth3 address=172.17.0.4/16 gateway=172.17.0.1
/interface/veth/add name=veth4 address=172.17.0.5/16 gateway=172.17.0.1
/interface/veth/add name=veth5 address=172.17.0.6/16 gateway=172.17.0.1

Creamos un puente, agregamos la interfaces creadas y configuramos el direccionamiento IP

/interface/bridge/add name=dockers
/ip/address/add address=172.17.0.1/16 interface=dockers
/interface/bridge/port add bridge=dockers interface=veth1
/interface/bridge/port add bridge=dockers interface=veth2
/interface/bridge/port add bridge=dockers interface=veth3
/interface/bridge/port add bridge=dockers interface=veth4
/interface/bridge/port add bridge=dockers interface=veth5

Configurar NAT para el tráfico saliente:
/ip/firewall/nat/add chain=srcnat action=masquerade src-address=172.17.0.0/16

Definimos los puntos de montaje

Pi-Hole

Agregar variables de entorno para Pi-Hole

/container/envs/add name=pihole_envs key=TZ value="America/Bogota"
/container/envs/add name=pihole_envs key=WEBPASSWORD value="mysecurepassword"
/container/envs/add name=pihole_envs key=DNSMASQ_USER value="root"

/container/mounts/add name=etc_pihole src=disk1/etc dst=/etc/pihole
/container/mounts/add name=dnsmasq_pihole src=disk1/etc-dnsmasq.d dst=/etc/dnsmasq.d

UniFi

/container/mounts/add name=etc_unifi src=disk1/etc dst=/etc/unifi
/container/mounts/add name=dnsmasq_unifi src=disk1/etc-dnsmasq.d dst=/etc/dnsmasq.d

LibreSpeed

/container/mounts/add name=etc_librespeed src=disk1/etc dst=/etc/librespeed
/container/mounts/add name=dnsmasq_librespeed src=disk1/etc-dnsmasq.d dst=/etc/dnsmasq.d

Candy

/container/mounts/add name=etc_caddy src=disk1/etc dst=/etc/caddy
/container/mounts/add name=dnsmasq_caddy src=disk1/etc-dnsmasq.d dst=/etc/dnsmasq.d

Nginx Proxy Manager

/container/mounts/add name=etc_nginx-proxy-manager src=disk1/etc dst=/etc/nginx-proxy-manager
/container/mounts/add name=dnsmasq_nginx-proxy-manager src=disk1/etc-dnsmasq.d dst=/etc/dnsmasq.d

Registrar URL para la descarga remota de los contenedores

Docker Hub Container Image Library | App Containerization)

Set registry-url (para descargar contenedores desde el registro de Docker) :
/container/config/set registry-url=https://registry-1.docker.io

Extraer imágenes

Pi-Hole

/container/add remote-image=pihole/pihole:latest interface=veth1 root-dir=disk1/pihole mounts=dnsmasq_pihole,etc_pihole envlist=pihole_envs

UniFi

/container/add remote-image=linuxserver/unifi-controller:latest interface=veth2 root-dir=disk1/unifi mounts=dnsmasq_unifi,etc_unifi envlist=unifi_envs

LibreSpeed

/container/add remote-image=linuxserver/librespeed:latest interface=veth3 root-dir=disk1/librespeed mounts=dnsmasq_librespeed,etc_librespeed envlist=librespeed_envs

Candy

/container/add remote-image=caddy:latest interface=veth4 root-dir=disk1/caddy mounts=dnsmasq_caddy,etc_caddy envlist=caddy_envs

Nginx Proxy Manager

/container/add remote-image=jlesage/nginx-proxy-manager:latest interface=veth5 root-dir=disk1/nginx-proxy-manager mounts=dnsmasq_nginx-proxy-manager,etc_nginx-proxy-manager envlist=nginx-proxy-manager_envs

La imágenes se extraerán automáticamente y se extraerán a root-dir, el estado se puede verificar utilizando el siguiente comando

/container/print

Iniciar los contenedores

/container/start 0
/container/start 1
/container/start 2
/container/start 3
/container/start 4

Last modified: 24 de julio de 2022

Comments

Write a Reply or Comment

Your email address will not be published.