It worked really well for bed bugs in the past. Wasn't sure if it works well for red ants. I will try. But my concern is if there is an anthill inside the wall, does diatomaceous earth help?
Diatomaceous earth works on most crawling insects.
There is likely not an anthill inside the wall, but there may well be a colony. Some species of ants have evolved to live in tiny voids and cracks (think the void between some bark and a tree, a crack under a rock, that sort of thing). They love setting up shop in houses because there are fewer natural predators and the voids are often more accommodating.
Diatomaceous earth will kill ants by getting into their breathing holes. This will not kill the whole colony, but will kill individual ants. Ants aren't smart, but they are adaptive. Once they lose enough workers heading off in a particular direction, they will modify behaviour by sending out workers in another direction. If the ants you're seeing in your house are just exploring from outside then the earth will work a treat.
If however, you've got a colony then things will be slightly different. If a colony experiences enough losses, it will either move or split with the two halfs heading off in different directions. If the ants are coming out of an exterior wall, the diatomaceous earth will discourage them from coming into your house, and they'll probably move back outside. If they're coming out from under an interior wall a different approach is likely to be more effective.