Access LM Studio API running on Windows from another device (Mac) on the same network.
(Get-NetTCPConnection -State Listen | Select-Object -ExpandProperty LocalPort -Unique | Sort-Object) | ConvertTo-Json -CompressGet-NetTCPConnection -LocalPort 15100 | Select-Object LocalAddress, LocalPort, State, @{Name='Process';Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}Good output: LocalAddress should be 0.0.0.0 (accepts all connections)
Bad output: 127.0.0.1 (localhost only — reconfigure the app)
Get-NetFirewallPortFilter | Where-Object { $_.LocalPort -eq 15100 } | Get-NetFirewallRule | Where-Object { $_.Enabled -eq 'True' } | Select-Object DisplayName, Direction, Action, Enabled | Format-Table -AutoSizeNo output = no rule exists (inbound blocked by default).
New-NetFirewallRule -DisplayName "Allow Port 15100 Inbound" -Direction Inbound -Protocol TCP -LocalPort 15100 -Action Allow; New-NetFirewallRule -DisplayName "Allow Port 15100 Outbound" -Direction Outbound -Protocol TCP -LocalPort 15100 -Action AllowGet-NetFirewallPortFilter | Where-Object { $_.LocalPort -eq 15100 } | Get-NetFirewallRule | Select-Object DisplayName, Direction, Action, Enabled | Format-Table -AutoSizeRemove-NetFirewallRule -DisplayName "Allow Port 15100 Inbound"; Remove-NetFirewallRule -DisplayName "Allow Port 15100 Outbound"Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.IPAddress -notlike "127.*" -and $_.IPAddress -notlike "169.*" } | Select-Object InterfaceAlias, IPAddressUse the Wi-Fi or Ethernet IP (e.g., 192.168.2.177)
Don't use: VirtualBox (192.168.56.x) or Hyper-V (172.x.x.x) IPs
nc -zv 192.168.2.177 15100curl --max-time 30 http://192.168.2.177:15100/v1/modelscurl --max-time 300 http://192.168.2.177:15100/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "qwen/qwen3-coder-30b", "messages": [{"role": "system", "content": "You answer only in rhymes."}, {"role": "user", "content": "What is your favorite color?"}]}'Get-NetTCPConnection -State Listen | Select-Object LocalPort, @{Name='PID';Expression={$_.OwningProcess}}, @{Name='Process';Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}, @{Name='Path';Expression={(Get-Process -Id $_.OwningProcess).Path}} | Sort-Object LocalPort | Format-Table -AutoSizeGet-NetFirewallProfile | Select-Object Name, Enabled, DefaultInboundAction, DefaultOutboundAction | Format-Table -AutoSizenetstat -an 2>/dev/null | grep LISTEN | grep -oE ':\d+' | sed 's/://' | sort -nu | paste -sd, - | sed 's/^/[/;s/$/]/'powershell -Command "(Get-NetTCPConnection -State Listen | Select-Object -ExpandProperty LocalPort -Unique | Sort-Object) | ConvertTo-Json -Compress"| Symptom | Cause | Fix |
|---|---|---|
nc times out |
Wrong IP (VirtualBox/Hyper-V) | Use Wi-Fi/Ethernet IP |
nc connection refused |
Firewall blocking or service not running | Add firewall rule, check service |
| API hangs | Large model, slow inference | Wait longer, use smaller model |
LocalAddress is 127.0.0.1 |
App only accepts localhost | Reconfigure app to bind to 0.0.0.0 |
| PowerShell command freezes | Inefficient firewall query | Use Get-NetFirewallPortFilter first |
| IP Pattern | What It Is |
|---|---|
192.168.56.x |
VirtualBox Host-Only |
172.x.x.x |
Hyper-V / WSL |
127.0.0.1 |
Localhost |
169.254.x.x |
APIPA (no network) |
| Port | Service |
|---|---|
| 22 | SSH |
| 135, 139, 445 | Windows Core (RPC, NetBIOS, SMB) |
| 3389 | Remote Desktop (RDP) |
| 5800, 5900 | VNC |
| 5985, 47001 | WinRM |
| 9222 | Chrome DevTools |
| 15100 | LM Studio (default) |
| 27015 | Steam |