Fog computing (FC) is a promising paradigm to use as an efficientarchitecture for the Internet of Things applications. Proximity, low latency,flexible resource power, and distributed structure of this architecture are somebenefits of it. A huge number of generated data and their requisites to real-timeprocess causes fog nodes offload number of tasks to the others that make trustissues. Here, each clients prefers to offload task to a trusted server, also eachserver tends to service the trusted clients. This may takes a long especiallywhen we want to consume less energy. In order to encounter this problem,in this paper, we propose a two-way trust management strategy based onBayesian learning automata. The proposed approach outperforms the otherstate-of-the-art approaches in terms of the energy consumption, network usage,latency, response time, and trust value.