Allow access to ollama from VPN servers

This commit is contained in:
Chris (wolcen) Thompson 2025-05-31 17:50:40 -04:00
parent f304b82399
commit 2da8f22d2d

View file

@ -195,6 +195,11 @@
# if packets are still dropped, they will show up in dmesg
logReversePathDrops = true;
checkReversePath = "loose";
extraCommands = ''
# Enable connections to Ollama for VPN users:
iptables -t filter -I INPUT --protocol TCP --source 10.40.4.2/32 --destination 10.40.4.2 --dport 11434 -j ACCEPT
iptables -t filter -I INPUT --protocol TCP --source 10.0.7.0/24 --destination 10.40.4.2 --dport 11434 -j ACCEPT
'';
# wireguard trips rpfilter up
#extraCommands = ''
# ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
@ -375,6 +380,7 @@
#environmentVariables = {
# HCC_AMDGPU_TARGET = "gfx1031"; # used to be necessary, but doesn't seem to anymore
#};
host = "10.40.4.2"; # See also ip46tables update in firewall extracommands
rocmOverrideGfx = "10.3.0";
};
system.activationScripts = {
@ -395,8 +401,8 @@
environment = {
"TZ" = "America/New York";
"OLLAMA_API_BASE_URL" = "http://127.0.0.1:11434/api";
"OLLAMA_BASE_URL" = "http://127.0.0.1:11434";
"OLLAMA_API_BASE_URL" = "http://10.40.4.2:11434/api";
"OLLAMA_BASE_URL" = "http://10.40.4.2:11434";
"WEBUI_URL" = "http://127.0.0.1:8080/";
};