For a long time I had problems on my work computers with Network manager still thinking that it is not connected. And I was really lazy to debug it. But as more and more application take online/offline settings from it, this became more and more annoying.
After some googling I found out that the problem might be in
/etc/network/interfaces file, which is parsed by
Network manager. Some "complex" things might confuse it. Well in my
case the complex thing was calling of some script in post-up.
Commenting this out magically fixes everything. Moving script to
/etc/network/if-up.d/ also is not a big problem, but why the hell
the Network manager thing does not tell where the problem is?