[GH-ISSUE #6518] Unable to run on tcp4/ipv4 on Lambda Labs instance #50616

Closed
opened 2026-04-28 16:32:55 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @bayadyne on GitHub (Aug 26, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6518

What is the issue?

I used OLLAMA_HOST=0.0.0.0:8080 (and attempted with other ports) and when I checked, the service was only on tcp6 which I'm currently unable to use.

OS

Linux

GPU

Nvidia

CPU

Intel, AMD

Ollama version

0.3.6

Originally created by @bayadyne on GitHub (Aug 26, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6518 ### What is the issue? I used OLLAMA_HOST=0.0.0.0:8080 (and attempted with other ports) and when I checked, the service was only on tcp6 which I'm currently unable to use. ### OS Linux ### GPU Nvidia ### CPU Intel, AMD ### Ollama version 0.3.6
GiteaMirror added the needs more infobug labels 2026-04-28 16:32:56 -05:00
Author
Owner

@bayadyne commented on GitHub (Aug 26, 2024):

Issues I read and was unable to work around the problem with:
#3961
#3300
#6077

<!-- gh-comment-id:2310515100 --> @bayadyne commented on GitHub (Aug 26, 2024): Issues I read and was unable to work around the problem with: #3961 #3300 #6077
Author
Owner

@rick-github commented on GitHub (Aug 27, 2024):

You can try disabling ipv6 on the instance. You don't specify the OS, but something like the following:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

If you want the changes to survive a reboot, add them to /etc/sysctl.conf or the eqivalent.

<!-- gh-comment-id:2312159515 --> @rick-github commented on GitHub (Aug 27, 2024): You can try disabling ipv6 on the instance. You don't specify the OS, but something like the following: ``` sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 ``` If you want the changes to survive a reboot, add them to /etc/sysctl.conf or the eqivalent.
Author
Owner

@xuijuthub commented on GitHub (Oct 30, 2024):

@pdevine @rick-github https://github.com/ollama/ollama/issues/3961#issuecomment-2141322231
Linked issue was closed without resolution. Same behavior on 0.3.14.

In systemd service
Environment="OLLAMA_HOST=0.0.0.0"
Results in
tcp6 0 0 :::11434 :::* LISTEN 30635/ollama

In systemd service
Environment="OLLAMA_HOST=0.0.0.0"
Results in netstat -lpnt| grep 11434
tcp 0 0 127.0.0.1:11434 0.0.0.0:* LISTEN 31217/ollama

<!-- gh-comment-id:2446317820 --> @xuijuthub commented on GitHub (Oct 30, 2024): @pdevine @rick-github https://github.com/ollama/ollama/issues/3961#issuecomment-2141322231 Linked issue was closed without resolution. Same behavior on 0.3.14. In systemd service `Environment="OLLAMA_HOST=0.0.0.0"` Results in `tcp6 0 0 :::11434 :::* LISTEN 30635/ollama` In systemd service ~`Environment="OLLAMA_HOST=0.0.0.0"`~ Results in netstat -lpnt| grep 11434 `tcp 0 0 127.0.0.1:11434 0.0.0.0:* LISTEN 31217/ollama`
Author
Owner

@rick-github commented on GitHub (Oct 30, 2024):

@xuijuthub What's your actual problem? Most linux machines are dual-stack, if it's listening on :::11434 it will also answer on 127.0.0.1:11434:

$ sudo netstat -pant | grep 11434
tcp6       0      0 :::11434                :::*                    LISTEN      1602578/ollama      
$ curl --ipv4 http://127.0.0.1:11434
Ollama is running
$ curl --ipv6 http://[::1]:11434
Ollama is running

If you want to prevent listening on ip6, do the sysctl commands above not work?

<!-- gh-comment-id:2446401088 --> @rick-github commented on GitHub (Oct 30, 2024): @xuijuthub What's your actual problem? Most linux machines are dual-stack, if it's listening on :::11434 it will also answer on 127.0.0.1:11434: ```console $ sudo netstat -pant | grep 11434 tcp6 0 0 :::11434 :::* LISTEN 1602578/ollama $ curl --ipv4 http://127.0.0.1:11434 Ollama is running $ curl --ipv6 http://[::1]:11434 Ollama is running ``` If you want to prevent listening on ip6, do the `sysctl` commands above not work?
Author
Owner

@xuijuthub commented on GitHub (Oct 30, 2024):

@xuijuthub What's your actual problem? Most linux machines are dual-stack, if it's listening on :::11434 it will also answer on 127.0.0.1:11434:

$ sudo netstat -pant | grep 11434
tcp6       0      0 :::11434                :::*                    LISTEN      1602578/ollama      
$ curl --ipv4 http://127.0.0.1:11434
Ollama is running
$ curl --ipv6 http://[::1]:11434
Ollama is running

If you want to prevent listening on ip6, do the sysctl commands above not work?

Sorry. It really works proper. Actual problem is open-webui running in docker not being able to access ERROR [open_webui.apps.ollama.main] Connection error: 127.0.0.1:11434/api/tags although docker exec curl --ipv4 127.0.0.1:11434/api/tags works. Most likely not ollama's issue. Thanks

<!-- gh-comment-id:2446613460 --> @xuijuthub commented on GitHub (Oct 30, 2024): > @xuijuthub What's your actual problem? Most linux machines are dual-stack, if it's listening on :::11434 it will also answer on 127.0.0.1:11434: > > ``` > $ sudo netstat -pant | grep 11434 > tcp6 0 0 :::11434 :::* LISTEN 1602578/ollama > $ curl --ipv4 http://127.0.0.1:11434 > Ollama is running > $ curl --ipv6 http://[::1]:11434 > Ollama is running > ``` > > If you want to prevent listening on ip6, do the `sysctl` commands above not work? Sorry. It really works proper. Actual problem is open-webui running in docker not being able to access `ERROR [open_webui.apps.ollama.main] Connection error: 127.0.0.1:11434/api/tags` although docker exec curl --ipv4 127.0.0.1:11434/api/tags works. Most likely not ollama's issue. Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#50616