would "power over ethernet " solve your problem ?
when only 4 of the 8 wires in an ethernet cable is used for data
using ready made adaptors
the two unused pairs can be used to power the router from a remote power supply
https://en.wikipedia.org/wiki/Power_over_Ethernet
for example
John
PS
what controller do you have ?
if you don't already have a mains socket under control of mach3
you could possibly use some thing like this C55 board from cnc4pc
( provided you have 2 spare outputs on your breakout board )
https://cnc4pc.com/c55-dual-25amp-relay-board.html