We propose the gait control strategy for a six-legged robot walking on rough terrain. To walk efficiently on rough terrain the robot uses proprioceptive sensors only. The robot detects contact with the ground and uses Attitude and Heading Reference System (AHRS) unit to measure the inclination of the platform. We propose a single-step procedure to compute inclination of the robot's platform taking into account the terrain slope and kinematic margin of each robot's leg. Additionally, we use a procedure, which keeps the robot stable during walking on rough terrain. We show in the experiments that the robot is capable of climbing slopes inclined by 25 deg and walking efficiently on rough terrain.