Preventing relay switch-off crashing Ethernet controller
I would suggest two things:


Use opto-isolators instead of (or as well as) the MOSFETs to control the relays, and
Add RC snubber circuits across the contacts.


The latter is the most important, since the spark across the contacts when they open will cause massive amounts of EMI.

The simplest circuit is a simple series resistor and capacitor placed across the contacts:







simulate this circuit &ndash; Schematic created using CircuitLab

Of course, ensure that the resistor and capacitor are rated for at least the voltage you are switching, preferably double.

Selecting the right values for the components depends very much on the load being switched and how much energy needs to be absorbed. I have shown ball-park figures that are usually "ok" for many situations.