The client must authenticate to gain network access, typically through a captive portal.
511 Network Authentication Required (RFC 6585) is meant for intercepting proxies such as hotel or airport Wi-Fi captive portals. Instead of answering requests with a fake page or a redirect that could be mistaken for the real site, the portal returns 511 with a link to its login page.
/generate_204 and Apple's captive.apple.com.HTTP/1.1 511 Network Authentication Required
Content-Type: text/html
Cache-Control: no-store
<a href="https://login.wifi.example/">Sign in to use the network</a>