Surprisingly, there are a variety of legal mountain bike routes in and around Yellowstone National Park.
East of Gardiner near the Mammoth area, the Northern-Pacific Railgrade offers 10 miles of riding.
Near Mount Washburn, the Old Chitten Road is a rough jeep trail with a 6 mile route climbing 1,400 feet up to the Mt. Washburn summit. Though less exciting, also try one of several low travel roads in the area including the Bunsen Peak Loop, the route to Old Gardiner, the Black Tail Plateau, the route to Gull Point, and the trek to Fire Hole Lake.
Overall, Yellowstone National Park is the 7th most popular mountain bike trail of all 19 mountain biking rides in Wyoming.