To realize continuous legged locomotion between different walls, especially the large-angled walls, we present a gait planning method for a underwater legged robot based on central pattern generator (CPG) and back propagation (BP) neural network in this paper. We use CPG as the signal generator for hip joint of each leg, and collect the data set in Gazebo. After that, we set up a BP neural network to fit the mapping relationship between the joint rotation angle and the output of CPG. Then, we use the trained network to generate adaptive gait autonomously for our robot. The test results in Gazebo verify the effectiveness of our method.