You need to grease the pole with heavy grease, like axle grease they use for wheel bearings (Vaseline or anything would work in a pinch but will wash off easily). Don’t know your setup exactly but you need to put about a 1-2″ wide band around at the top of the pole, just under the box – ants cannot cross this sticky barrier in theory, but you need to be sure they are not already in/under the nest itself, because then they could not get out. This is the easiest & least expensive way. If ants are already in the nest, there are things like DE (Dianthias (spelling?) Earth), which is supposed to be a safe product if you get the right kind.