Open bannert1337 opened 1 month ago
@bannert1337, can you check if the following command returns an IPv4 address?
curl -4 https://jsonip.com
@mlsmaycon output for the command:
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>403 Forbidden</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Forbidden</h1>
<h2>Your client does not have permission to get URL <code>/</code> from this server.</h2>
<h2></h2>
</body></html>
When run from a computer at my home network, I get the correct IPv4 address. The VPS has a public IPv4 and IPv6 address.
Describe the problem
The
configure.sh
script in the self-hosted setup fails to detect the server's public IP address when run on an IPv6-only VPS or a server with IPv6 preferred. This causes the script to exit with a JSON parsing error, preventing successful configuration of the NetBird infrastructure.To Reproduce
./configure.sh
Expected behavior
The script should successfully detect the server's public IPv4 address, or gracefully handle the case where only an IPv6 address is available. It should then proceed with the configuration without errors.
Are you using NetBird Cloud?
No, this issue occurs during self-hosted NetBird control plane setup.
NetBird version
N/A - This issue occurs during initial setup, before NetBird is fully installed.
NetBird status -dA output:
N/A - NetBird is not yet installed when this issue occurs.
Do you face any (non-mobile) client issues?
N/A - This issue is related to server setup, not client operation.
Screenshots
N/A
Additional context
The root cause appears to be that the script uses
https://jsonip.com
to detect the public IP, which returns an IPv6 address on IPv6-enabled servers. The script expects an IPv4 address, causing a parsing error.A potential fix would be to use a service that consistently returns an IPv4 address, such as
https://api.ipify.org?format=json
, and ensure the-4
flag is used with curl to force IPv4. Alternatively, the script could be updated to handle both IPv4 and IPv6 addresses correctly.