The Road Side Unit (RSU) is an important part of the Internet of Vehicles (IoV), which collects a large number of user's privacy information and connects vehicles to the Internet. The current RSU is running with static configurations, and the adversary can get enough time to analyze the vulnerability of the RSU and launch attacks, which poses a huge threat to the privacy security of the IoV. Under this asymmetrical condition, the attackers occupy a predominant position, and it is difficult to fully defend. To solve the above asymmetry offense-defense problem, we adopt the moving target defense (MTD) to dynamically change the IP address of the RSU, which increases the difficulty of the attacker's attack. However, due to the unreasonable selection of the RSU's IP hopping frequency, it is difficult for the RSU's IP hopping to exert its defense effect or it may introduce excessive defense overheads. Given the above issue, we propose an intelligent offense and defense mechanism based on a differential game approach, which can adaptively adjust the RSU's IP hopping frequency and maximize its defense benefits. First, based on the offense and defense relationship, we model the RSU's IP hopping frequency intelligent arrangement as a differential game (i.e., IP hopping game) in which the attacker attempts to maximize his potential benefits, and the RSU manages to maximize its defense benefits. On this basis, we calculate a potential Nash equilibrium of the IP hopping game. Finally, simulation results show our proposed mechanism can adaptively adjust the RSU's IP hopping frequency according to the attack frequency and effectively defend attacks. Compared with the mechanisms with a fixed IP hopping frequency, our proposed mechanism can make up for the ineffectiveness of the fixed low-frequency IP hopping defense and avoid the excessive defense overheads of the fixed high-frequency IP hopping defense.