A wireless ad hoc network is a self-configuring infrastructurelessh network of mobile devices connected by wireless. In order to support the basal networking functions like routing and packet forwarding, the nodes in wireless ad hoc network should be cooperate with each other due to the limited range of wireless transmission. However, nodes are unwilling to relay packets for others considering the poor energy and bandwidth especially in the open community environment. Some approaches to stimulate nodes cooperation have been introduced recently. In this paper, we provide a novel method based on cross-layer design to solve the cooperation issues both in Mac and network layer. The method with the help of reputation mechanism and utility function based on game theoretical approach can promote nodes to cooperate and make the whole network to reach Nash equilibrium.