Port 3128 is the default port for the Squid caching proxy, used to share and filter web access for a network. It should not be reachable from the public internet.
- Port
- 3128
- Protocol
- TCP
- Service
- Squid proxy
- Expose to internet?
- No
Is port 3128 safe to open?
A Squid proxy that accepts requests from anywhere is an open proxy. It will be used to hide abuse behind your IP address and can be used to reach internal web services through the proxy. Squid’s stock configuration only allows local networks, but edits often widen it.
How to secure Squid proxy
- Keep
http_access deny allas the last rule and only allow your own networks (acl localnet src ...). - Require authentication for remote users.
- Block access to internal addresses and the proxy host itself (
http_access deny to_localhost). - Allow 3128 only from client networks at the firewall.
Check if port 3128 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':3128 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 3128 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 3128
# or
nmap -p 3128 HOST
# Windows
Test-NetConnection HOST -Port 3128Test the Squid proxy service itself
curl -x http://HOST:3128 -I https://example.comRestrict port 3128 in the firewall
Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:3128:3128) instead of relying on the host firewall.
ufw: allow only your private network, deny everyone else
sudo ufw allow from 10.0.0.0/8 to any port 3128 proto tcp
sudo ufw deny 3128/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=3128/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="3128" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 3128 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3128 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 3128 from internet" -Direction Inbound -Protocol TCP -LocalPort 3128 -RemoteAddress Internet -Action BlockMonitor port 3128
Run a TCP port monitor against your public IP on port 3128: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.
Related ports
FAQ
What is port 3128 used for?
Port 3128 is the default port for the Squid caching proxy, used to share and filter web access for a network.
Is it safe to open port 3128?
Not to the public internet. A Squid proxy that accepts requests from anywhere is an open proxy. It will be used to hide abuse behind your IP address and can be used to reach internal web services through the proxy. Squid’s stock configuration only allows local networks, but edits often widen it.
Is port 3128 TCP or UDP?
Squid proxy uses TCP on port 3128.
How do I check if port 3128 is open?
On the server, run sudo ss -tulpn | grep ':3128 ' (Linux) or Get-NetTCPConnection -LocalPort 3128 (Windows) to see what is listening. From another machine, run nc -zv HOST 3128 or Test-NetConnection HOST -Port 3128.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.