*** The Anti-Showoff Thread ***

How did you setup the redundancy between the two ? Also are they connected to the network on wifi ?

They're connected by ethernet, the redundacy/failover is handled by the router — Mikrotik routers have a tool called netwatch, which can trigger a script to run when a device becomes online or offline, I have it set to update DNS servers. This coupled with a DHCP lease time of 60 seconds keeps the devices on the network updated with whatever DNS servers are currently online.


Here are the scripts, with sensitive information redacted. They're pretty much human readable. The UP script:

C-like:
:local activedns [:toarray ""]
:local notifydns
:if ([/ping 192.168.254.1 count=1]=0) do={
:set notifydns "AdBlockerOne is offline"
} else={
:set activedns ($activedns, "192.168.254.1")
:set notifydns "AdBlockerOne is online"
}
:if ([/ping 192.168.254.2 count=1]=0) do={
:set notifydns ($notifydns."%0AAdBlockerTwo is offline")
} else={
:set activedns ($activedns, "192.168.254.2")
:set notifydns ($notifydns."%0AAdBlockerTwo is online")
}
:if ([/ping 192.168.254.3 count=1]=0) do={
:set notifydns ($notifydns."%0AAdBlockerBM3 is offline")
} else={
:set activedns ($activedns, "192.168.254.3")
:set notifydns ($notifydns."%0AAdBlockerBM3 is online")
}
:if ([/ping 192.168.254.4 count=1]=0) do={
:set notifydns ($notifydns."%0AAdBlockerBM4 is offline")
} else={
:set activedns ($activedns, "192.168.254.4")
:set notifydns ($notifydns."%0AAdBlockerBM4 is online")
}
[/ip dns set servers=$activedns]
[/tool fetch url="https://api.telegram.org/botX:X/sendMessage\?chat_id=X&disable_notification=true&text=$notifydns" keep-result=no]

The DOWN script is identical but with these additional commands:

C-like:
:if ([:len $activedns]=0) do={
:set activedns ($activedns, "1.1.1.1")
:set notifydns ($notifydns."%0APublic DNS activated")
}
[/tool fetch url="https://api.telegram.org/botY:Y/sendMessage\?chat_id=Y&text=Network configuration invalid,%0Aautomatic reset in 60 seconds." keep-result=no]

Both scripts are active across all of the adblockers. They're hardcoded for now as I refine my networking setup, the proper way to do it is probably a loop with array/variables.

AdBlockerOne and AdBlockerTwo are proxmox VM's on a host that I've turned off because of the current heatwave. BM3 and BM4 are these two adblockers on 'bare metal'.

These scripts also send telegram notifications, I have two groups/channels set up for these kind notifications. The first one has more technical information and it's primarily for myself:

photo_2023-06-03 18.28.12.jpeg

The other is for family, primarily to let them know if there are issues with the wifi/internet:

photo_2023-06-03 18.28.10.jpeg

The 'automatic reset' is the DHCP refresh time that'll push out whichever DNS servers are active.
 
Last edited:
Anyone running a secondary linux box for compute? It's something I'm considering since it feels like I'm always at the limit of what's possible with Apple's M1.

want need more cores (all four performance cores maxed out for the last few hours):

Screen Shot 2023-07-23 at 12.01.23 AM (2).png

love the file size optimizations of Google's Guetzli jpeg encoder, don't love the speed
 
Back
Top