Port 3128 (Squid Proxy)

Port 3128 is registered by IANA for the ndl-aas service (Active API Server Port), but it is best known as the port of Squid, a long-standing proxy…

Key facts

Port
3128
Protocols
TCP
Range
Registered port, 1024-49151
IANA service name
ndl-aas
Unofficial use
The use described on this page is not the IANA assignment for this port. Source (opens in a new tab) Checked on 30.11.2026

IANA assigns ports in this range to services on request, under RFC 6335.

About port 3128

Port 3128 is registered by IANA for the ndl-aas service (Active API Server Port), but it is best known as the port of Squid, a long-standing proxy server for web browsing and for keeping copies of pages (caching).

Common use (unofficial): according to the Squid documentation, the server usually listens on port 3128, which is set by the http_port setting in the squid.conf file, and you can configure any other port. On a server with two networks, the documentation recommends specifying the internal address together with the port. This use is not the IANA assignment; it is documented by the software vendor.

What port 3128 is used for

  • Browsing through a proxy: computers on the office network go out to the internet through Squid, which filters sites and logs browsing.
  • Saving bandwidth: Squid keeps copies of files that are loaded again and again, and serves them from the server.
  • Controlled access for servers: servers on an internal network get updates from the internet only through the proxy.

Port 3128 in the firewall

A proxy server should serve only your own users, so allow port 3128 only from the internal network or from known addresses:

  • UFW: ufw allow from 198.51.100.0/24 to any port 3128 proto tcp
  • firewalld: firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="198.51.100.0/24" port port="3128" protocol="tcp" accept'

When you restrict access to specific addresses, also delete any earlier rule that opened the port to everyone, or that general rule will keep allowing access from any address.

The firewall is one layer. In addition, set who may use the proxy with http_access rules in squid.conf.

Risks and security

A proxy that accepts requests from any address becomes an open proxy, which anyone on the internet can browse through in your server's name. A few simple settings prevent this:

  • According to the Squid documentation, when there are no http_access rules, requests are denied, and the suggested configuration ends with http_access deny all. Keep this rule at the end of the list.
  • Allow only your own networks, for example with an acl localnet rule and the line http_access allow localnet.
  • Restrict the port in the firewall to the internal network.
  • Check the access log from time to time, and try connecting to the proxy from an outside address to make sure access is blocked.

Commands to check and configure

  • squid -k parse

    Checks the syntax of the squid.conf configuration file before a restart.

  • squid -k reconfigure

    Reloads the configuration without stopping the server.

  • ss -tlnp | grep ':3128 '

    Checks that Squid is listening on port 3128, and on which address (requires root privileges).

  • curl -x http://proxy.example.com:3128 -I https://example.com

    Sends a request through the proxy and shows the response headers, to check that browsing through it works.

  • tail -f /var/log/squid/access.log

    Shows the requests passing through the proxy in real time. This path is common on Linux installations, and may differ by distribution.

  • ufw allow from 198.51.100.0/24 to any port 3128 proto tcp

    Allows port 3128 only from the specified network (UFW).

  • firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="198.51.100.0/24" port port="3128" protocol="tcp" accept'

    Allows port 3128 in firewalld only from the specified network. Then run firewall-cmd --reload.

Port 3128 in the IANA registry

Port Protocol Service IANA registry description
3128 TCP ndl-aas Active API Server Port
3128 UDP ndl-aas Active API Server Port

Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)

Port 3128 FAQ

How do I check that the proxy works?

From a computer on the network, run curl -x http://proxy.example.com:3128 -I https://example.com. When response headers come back, browsing through the proxy works, and the request also appears in the Squid access log. The curl commands page has more testing options.

How do I set who may use the proxy?

In the squid.conf file, define your networks, for example acl localnet src 198.51.100.0/24, allow them with http_access allow localnet, and end with http_access deny all. After the change, check with squid -k parse and reload with squid -k reconfigure.

Can I run Squid on a different port?

Yes. Change the http_port line in the squid.conf file, for example to http_port 8080, update the firewall and the proxy settings on the computers, and reload the configuration.

What's the difference between a regular proxy and a reverse proxy?

A regular proxy, like Squid on port 3128, serves your own users when they browse out to the internet. A reverse proxy sits in front of a website or a server, receives visitors on port 80 or port 443, and passes the requests to the server behind it.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement