There are a number of articles on the web telling you how to kill ants that invade your campsite with common household products. See, for example, Tips And Tricks To Stop Ants From Invading Your Camp. Also, as @Michel Keijzers said in his excellent answer, be fanatical about removing ant attractants.
However, I suggest considering a different strategy. Remove yourself from ant-infested regions. They perform useful functions in the ecosystem, and don't deserve genocide.
This is easy for me to say, because almost all of my camping is done above timberline in the Sierra or the Rockies. Ants are no more than a minor nuisance, if that, there. I fully realize that this may not be practical for the OP and other sufferers.
This Question reminded me of the old movie, Elephant Walk starring Elizabeth Taylor and Peter Finch. A macho manly man (Finch's late father) built his house on an elephant migration trail that led to their watering place, and Finch spent most of the movie trying to deflect elephants from his house. Eventually, the elephants lost patience and smashed the house. Taylor (of course) and Finch survived.
All I am saying is that you try to avoid Ant Walk and consider ensuring that you are not on an ant trail or an ant's nest.