In this article we present a class of relativistic solutions describing spherically symmetric and static anisotropic stars in hydrostatic equilibrium. For this purpose, we consider a particularized metric potential, namely, Buchdahl ansatz [Phys. Rev. D 116, 1027(1959.] which encompasses almost all the known analytic solution to the spherically symmetric, static Einstein field equations(EFEs) with a perfect fluid source, including in particular the Vaidya-Tikekar and Finch-Skea. We here developed the model by considering anisotropic spherically symmetric static general relativistic configuration that plays a significant effect on the structure and properties of stellar objects. We have considered eight different cases for generalized Buchdahl dimensionless parameter K, and analyzed them in an uniform manner. As a result it turns out that all the considered cases are valid at every point in the interior spacetime. In addition to this, we show that the model satisfies all the energy conditions and maintain hydrostatic equilibrium equation. In the frame work of anisotropic hypothesis, we consider analogue objects with similar mass and radii such as LMC X-4, SMC X-1, EXO 1785-248 etc to restrict the model parameter arbitrariness. Also, establishing a relation between pressure and density in the form of P = P (ρ), we demonstrate that EoSs can be approximated to a linear function of density. Despite the simplicity of this model, the obtained results are satisfactory.