Mobile Ad hoc Networks (MANETs) consist of mobile autonomous nodes that rely on each other to forward the traffic. This cooperative nature may be exploited by attackers to accomplish malicious goals such as disrupting the traffic flow. One such type of attack is the wormhole attack where two colluding malicious nodes capture the traffic from one part of the network and forward it to another part via a tunnel. The malicious nodes could then drop or manipulate the packets passing through the tunnel. In this paper, we investigate the impact of two types of wormhole attack on MANET performance: static wormhole where the malicious nodes are static, and mobile wormhole attack where the malicious nodes are mobile. We analyze the impact on two routing protocols: On-Demand Distance Vector (AODV) and Optimized Link State Routing (OLSR). The results show that the OLSR proactive routing protocol behaves much better under wormhole attacks than the AODV routing protocol. The drop in the packet delivery ratio and throughput under the wormhole attack for AODV is 50-65% while it is 10-12% in the case of OLSR.