For Battle.net access in Warcraft II, you may need to open specific ports in your firewall, and you may also need to forward those ports through your router.
A list of the ports that need to be open and/or forwarded can be found here:
https://us.battle.net/support/en/article/7842 This website can be useful in learning how to port forward, if that proves necessary.
https://portforward.com/ If those don't fix the problem, you may be under a carrier-grade NAT.
You would need to contact your ISP in order to see if this can be disabled.
Fibre internet users may need to contact their ISP in order to gain access the necessary ports.