Achieving reliable communication over different channels and modes is one of the main goals of Mode Division Multiplexing-Wavelength Division Multiplexing (MDM-WDM) communication networks. The reliability can be described by minimum Signal to Noise Ratio (SNR) margin which dependents on launched power, Multimode-Erbium Doped Fiber Amplification (MM-EDFA) gain, and MMF nonlinearity. In this paper, an analytical model for MMF nonlinearity is derived based on Enhanced Gaussian Noise (EGN) model formulation by considering carrier phase estimation and the first four dispersion terms. The proposed EGN model is verified through the split step Fourier method simulation. Considering a multi-node linear network, the joint optimized power and gain allocation based on minimum SNR margin maximization is formulated. The practical constraints including MM-EDFA saturation power and maximum gain are considered and the problem is solved by using convex optimization. Three scenarios are assumed including best equal power, optimized power, and joint optimized power and gain. In the first scenario, equal powers are considered for different channels and modes with equal MM-EDFA gain in all spans. It is worth mentioning that the MM-EDFA gain is equal to span loss. In the second scenario, different powers are allocated to different channels and modes with equal MM-EDFA gain in all spans. In the third case, allocated powers to each channel and mode are optimized. Moreover, the MM-EDFA gain for each span is optimized separately.