A detailed analysis of the dynamics of homogeneous and anisotropic Bianchi I geometries has been performed in f(R) gravity theory in the Palatini formalism, using dynamical systems approach. The exact solutions have been found and the behavior and stability of these solutions have been studied for three different models based on f(R) gravity. These models can produce a sequence of radiation-dominated, matter-dominated and de-Sitter periods. The analysis shows that stable solutions exist which correspond to accelerated expansion at late times. The solutions corresponding to radiation-dominated and matter-dominated era are found to be unstable. Solutions have also been found corresponding to decelerated expansion.