It is an open problem to control the interaction forces of lower-limb exoskeletons designed for unrestricted overground walking, i.e., floating base exoskeletons with feet that contact the ground. For these types of exoskeletons, it is challenging to measure interaction forces as it is not feasible to implement force/torque sensors at every contact between the user and the exoskeleton. Moreover, it is important to compensate for the exoskeleton's whole-body gravitational and dynamical forces. Previous works either simplified the dynamic model by treating the legs as independent double pendulums, or they did not close the loop with interaction force feedback. This paper presents a novel method to calculate interaction torques during the complete gait cycle by using whole-body dynamics and joint torque measurements on a hip-knee exoskeleton. Furthermore, we propose a constrained optimization scheme combined with a virtual model controller to track desired interaction torques in a closed loop while considering physical limits and safety considerations. Together, we call this approach whole-exoskeleton closed-loop compensation (WECC) control. We evaluated the haptic transparency and spring-damper rendering performance of WECC control on three subjects. We also compared the performance of WECC with a controller based on a simplified dynamic model and a passive version of the exoskeleton with disassembled drives. The WECC controller resulted in consistent interaction torque tracking during the whole gait cycle for both zero and nonzero desired interaction torques. On the contrary, the simplified controller failed to track desired interaction torques during the stance phase. The proposed interaction force control method is especially beneficial for heavy lower-limb exoskeletons where the dynamics of the entire exoskeleton should be compensated.