Nowadays, IP networks are suffering many faults and malicious attacks which greatly threaten its security and survivability. So it is an important issue that how to make the IP networks to be more robust under faults and attacks, i.e., to improve their tolerance abilities for both fault and intrusion. However recently, most of the researches focus on only one of them, and decouple the survivability and security each other. According to the trust model in social networks, this paper proposes an efficient fault-tolerant and intrusion-tolerant scheme based on trust relationship for IP networks. This scheme not only borrows the trust rating from the social links, but also qualitatively describes the relationships between the trust rating and the network behavior. Then, this paper analyses the scheme how to tolerate three known malicious behaviors, viz., self-faults, bad mouth attacks and conflict behavior attacks. Finally, the numeric simulation results show that the scheme can detect the malicious nodes fast and accurately and efficiently prevent these malicious behaviors in IP networks.