The two are definitely intertwined. You'll find some of the most ardent proponents of the 2cd Amendment in the military. If the 2cd Amendment ever came under full scale attack and the US military was called upon to act against the citizenry, I think the government would probably get a full dose history lesson on the original intent of the 2cd Amendment.
And yes, trust me, any nation that ever thought about invading the US would definitely be well aware of the gun ownership in this country. Even if you could defeat the military, you'd be dealing with a well armed, spread out populace. This place would be absolute hell to occupy. It'd be virtually impossible.
Sounds like an episode of The Living Dead.