Starship Troopers 3: Marauder

In the past eleven years of "The Second Bug War", the Mobile Infantry has improved their weapons and tactics. However, as they adapt, so do the Bugs, and many new Arachnid variants have developed. The United Citizen Federation now finds itself engaged in trench warfare on the frontier planets. The Federation puts a positive spin on this in the media while using its judicial and military authority to suppress peace protesters and religious fanatics as seditionists.
Colonel Johnny Rico (Casper Van Dien) is stationed on the agrarian planet Roku San when the popular Sky Marshal Omar Anoke (Stephen Hogan) pays a visit. Off-duty, Rico's old friend General Dix Hauser (Boris Kodjoe) gets into a bar fight with farmers protesting against the war. During the fight, Rico stops Dix from shooting one of the farmers. Dix tries to have Rico arrested, but the base defences suddenly fail due to an alien attack. Rico knocks Dix to the floor and leaves to help fight the Arachnids. When Roku San falls, Rico is blamed by the Federal Media and set for execution for insubordination and striking a superior officer. However Dix has Rico's execution stopped and covered up so that Rico can lead a rescue mission.
On their way back to Sanctuary, the Fleet's secret HQ, Captain Lola Beck (Jolene Blalock) is marooned on a classified planet, OM-1, with Sky Marshal Anoke, and Admiral Enolo Phid (Amanda Donohoe) suppresses this information. Dix finds out thanks to an officer who thinks this is wrong and recruits Rico to rescue the Sky Marshal and Lola, the latter being one of the few in possession of the coordinates to Sanctuary, which would cripple the military if the Arachnids learned of its location.
An apparent earthquake causes Dr. Wiggs (Danny Keogh) to fall into a crevasse, while the Sky Marshal views a giant eye staring back at him from below. Cynical cook Jingo Ryan (Jon Falkow) is next to die after he takes shelter within a cluster of supposed rock outcroppings, which are actually Arachnid limbs which pull him below. Engineer Bull Brittles (Stelio Savante) asks the very religious flight attendant, Holly Little (Marnette Patterson), to marry him, but dies shortly after.
On Earth, General Hauser confronts Admiral Phid about why she is abandoning the Sky Marshal, only to be arrested. Later, Phid reveals to him that Sky Marshal Anoke is responsible for the downfall of Roku San, having been in communication with the "Brain of Brains," also known as "Behemecoatyl," through the original brain bug captured in Starship Troopers as he has psychic powers. The Sky Marshal adopted their religion, hoping he could save humanity from the bugs if he could make peace with them. It is revealed that he turned off the electric barrier surrounding the base on Roku San to show his willingness to make peace between the two species. The Federation now believes the Brain Bug allowed itself to be captured in the first place on Planet P in order to pass on intelligence from inside The Federation. The Federation makes the decision to kill and dissect the captured brain but it overhears them and unleashes a telepathic scream, killing a few soldiers by exploding their skulls before Hauser kills it. It is revealed that Admiral Phid ignored the distress calls of those abandoned on OM-1 so she could become the new Sky Marshal; however, she failed to take into account that Lola, who is one of the few pilots of the Federation that know the location of Sanctuary, was with Anoke.
Back on OM-1, the stranded make contact with The Brain of Brains, who communicates with them through the corpses of their fallen comrades and soon kills Anoke for his knowledge; Lola and Holly, the last two left alive, begin to pray that they will be saved.
Rico leads the Marauders, an elite team of troopers composed of his command staff from Roku San, on a rescue mission, using the Federation's new battle-suits. They defeat the Arachnid warriors on OM-1, suffer no casualties, and rescue the two survivors. OM-1 is revealed to be the home of the Bug Hive, the Arachnids' ruling body, and Fleet destroys it from orbit with a planet-destroying "Q Bomb."
Rico is apparently cleared of charges and subsequently awarded a promotion to the rank of General, and given permanent command of the Marauder program. Anoke is reported to have died in a terrorist attack (staged by the government earlier to explain his disappearance) and given a hero's funeral. Dix and Lola are married, Admiral Phid is appointed the new Sky Marshal with Dix as her second-in command, and Holly becomes a Federal chaplain. Dozens of peace protesters are hanged in connection to the purported terrorist attack. The new Sky Marshal Phid, impressed with the way that Sky Marshal Anoke was rendered servile by the Arachnids' religion, decides the Federation should adopt a religion, and a Christian-esque religion is embraced by the Federation.

Question: Who was Johnny Rico fighting against?
Answer: The arachnids.