Directly etching an active grating in Er/Yb codoped fiber, a compact asymmetric π phase-shifted fiber laser was fabricated. The designed grating length is only 50 mm, the optimal phase shift position is at 29 mm, and the optimal coupling coefficient value is 150 m-1 . Adopting forward pumped manner by 980 nm LD, when pumped power was of 200 mW, at 1 550.94 nm we have achieved the narrow-band laser output of 10 mW, its width was narrower than 0.05 nm, the threshold was 35 mW, the slope efficiency was 6.06%, total optical conversion efficiency was 5%. The fiber laser has met the practicality of light sources' power in the long-term optical communications system.