  We investigate the possibility that the E_p propto E_gamma^{1/2} relation
between the peak energy E_p of the nuF_nu spectrum and energy output E_gamma
for long-duration GRBs arises from the external shock produced by the
interaction of a relativistic outflow with the ambient medium. To that aim, we
take into account the dependence of all parameters which determine E_p and
E_gamma on the radial distribution of the ambient medium density and find that
the E_p-E_gamma relation can be explained if the medium around GRBs has a
universal radial stratification. For various combinations of GRB radiative
process (synchrotron or inverse-Compton) and dissipation mechanism (reverse or
forward shock), we find that the circumburst medium must have a particle
density with a radial distribution different than the R^{-2} expected for
constant mass-loss rate and terminal speed.
