1

Is it possible to set a custom URL for captive portal detection in Ubuntu?

Ubuntu uses https://connectivity-check.ubuntu.com by default to check the connection. Is there a way to change this URL, for example to https://your.host.com/another-path?

2 Answers 2

5

You can set the URL using the uri parameter in the NetworkManager config file /etc/NetworkManager/NetworkManager.conf. Add the following lines there:

[connectivity]
uri=https://your.host.com/another-path

The important part is that the server must return either the header X-NetworkManager-Status with a value of online or a body content with NetworkManager is online.

You can also set interval to set the check interval in seconds and response to require a specific string in the check response. For more information see the CONNECTIVITY SECTION of the NetworkManager man page.

After that you have to restart the NetworkManager or reboot your system:

# sudo service network-manager restart
-1

supplementary for the existing answer, for the most recent ubuntu dists, the command for network-manager restart should be

# sudo systemctl restart systemd-networkd
1
  • Interesting, but internet (including WiFi) disappears after this. I had to go to Settings and manually turn everything off/on.
    – Max_Payne
    Commented Jul 21, 2023 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .