This study presents a methodology to consider the impedance of a grid in power-hardware-in-the-loop experiments to validate power converter control in the presence of harmonics or resonances in the network impedance. As the phenomena to emulate are in a large frequency range, the skin effect in conductors has to be taken into account. A procedure is developed to model the network. Then, the model is simplified to reduce the computation requirements and discretised for real-time implementation. The proposed method has been applied to analyse the harmonic interactions due to on-board converters running on a 25 kV-50 Hz railway infrastructure for frequencies from 0 to 5 kHz. The model is computed in MATLAB-Simulink, a SpeedGoat Performance Machine and a linear power supply are used for a real-time implementation. The converter under test and the test bench are presented. Some experimental results are presented, showing the feasibility and the usefulness of the proposed approach.