Some modems have operational amplifiers that have balanced inputs that offer a fair amount of iterference rejection also called common mode rejection.This is expressed in dB,the higher the dB level the better rejection.
Another way is to shield the data/telephone line for example, use external/outside Cat 5 cable near the electric fence.
Let us know what works.
Chris