It may be just a meager suggestion but if there is open country a form of a modern day Maginot line “could” work.
Underground bunkers with pop up cylinders with chain guns, remote controlled.
Or several hundred ATVs also remote controlled, each with several auto firing shotguns, like a quad 12 ga saiga drum mounts, and lastly have an explosive clamore so when empty can be driven into a line of attackers.
For a defense against tanks it gets much more problematic unless there was in place concealed tank traps or sand pits with aeration that sends a massive amount of air into a sand ditch that no tank can drive over, it sinks.
When a hovercraft is deployed again having devices in play that can tear the skirts up “might” work.
And then you have to be concerned about HALO jumpers at night.
Someone plays too many video games.