Ad-hoc networks carry out routing and forwarding functions through available nodes. These nodes act as base stations and also are involved in route discovery and maintenance, forwarding traffic, and network management functions. Nodes expend most of their energy to forward packets to others without receiving any direct gain from doing so. A misbehaving and greedy node only considers its own short-term utility, and it may not choose to participate within the network. A reputation approach (RAP) is proposed in this paper, based on the reputation model that is used to detect and isolate misbehaving nodes which do not cooperate in forwarding packets of other nodes. Promising results are found through extensive simulation using GloMoSim in identifying selfish nodes.