In this paper, an efficient motion planning method is proposed for a six-legged robot walking on irregular terrain. The method provides the robot with fast-generated free-gait motions to traverse the terrain with medium irregularities. We first of all introduce our six-legged robot with legs in parallel mechanism. After that, we decompose the motion planning problem into two main steps: first is the foothold selection based on a local footstep cost map, in which both terrain features and the robot mobility are considered; second is a whole-body configuration planner which casts the problem into a general convex optimization problem. Such decomposition reduces the complexity of the motion planning problem. Along with the two-step planner, discussions are also given in terms of the robot-environmental relationship, convexity of constraints and robot rotation integration. Both simulations and experiments are carried out on typical irregular terrains. The results demonstrate effectiveness of the planning method.