Abstract. We consider a general network of harmonic oscillators driven out of thermal equilibrium by coupling to several heat reservoirs at different temperatures. The action of the reservoirs is implemented by Langevin forces. Assuming the existence and uniqueness of the steady state of the resulting process, we construct a canonical entropy production functional S t which satisfies the Gallavotti-Cohen fluctuation theorem. More precisely, we prove that there exists κ c > 1 2 such that the cumulant generating function of S t has a large-time limit e(α) which is finite on a closed interval [ 1 2 − κ c , 1 2 + κ c ], infinite on its complement and satisfies the Gallavotti-Cohen symmetry e(1 − α) = e(α) for all α ∈ R. Moreover, we show that e(α) is essentially smooth, i.e., that e (α) → ∓∞ as α → 1 2 ∓ κ c . It follows from the Gärtner-Ellis theorem that S t satisfies a global large deviation principle with a rate function I(s) obeying the Gallavotti-Cohen fluctuation relation I(−s) − I(s) = s for all s ∈ R. We also consider perturbations of S t by quadratic boundary terms and prove that they satisfy extended fluctuation relations, i.e., a global large deviation principle with a rate function that typically differs from I(s) outside a finite interval. This applies to various physically relevant functionals and, in particular, to the heat dissipation rate of the network. Our approach relies on the properties of the maximal solution of a one-parameter family of algebraic matrix Riccati equations. It turns out that the limiting cumulant generating functions of S t and its perturbations can be computed in terms of spectral data of a Hamiltonian matrix depending on the harmonic potential of the network and the parameters of the Langevin reservoirs. This approach is well adapted to both analytical and numerical investigations.