NetworkUp() implies there’s a link. Nothing else. As Andre points to you need to know ADDRESS level interactions, so again the earlier link has a great little routine to be used in the network address change event that can help uncover some of that - but I will almost guarantee you’re never hitting that.
If you want to maximise the input, tell us about your network - like whether it’s a home network or a corporate managed network, info on the router you’re talking about, how your PC is configured, what your router can tell you about registered DHCP clients etc. In fact it’s probably worth telling us what mainboard and network module you’re using too in case that’s important.
Edit: just saw your post from a few seconds before mine. The code relies on getting an address when the network state change happens, but that’s not guaranteed. You should move your webserver startup code out of there - and to help diagnose, perhaps if you put in a 10-pass loop with a 10-sec delay between iterations and watch the address value there (or use the addresschange event)