Port 5060 (SIP)

Port 5060 is the default port of SIP (Session Initiation Protocol), the protocol that sets up and manages phone and video calls over the internet…

Key facts

Port
5060
Protocols
TCP, UDP
Range
Registered port, 1024-49151
IANA service name
sip

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

About port 5060

Port 5060 is the default port of SIP (Session Initiation Protocol), the protocol that sets up and manages phone and video calls over the internet (VoIP), over UDP and TCP. SIP carries the messages that set up and end a call, while the voice itself travels separately, over the RTP protocol, on a different port range.

The protocol is defined in RFC 3261, under which port 5060 is used for SIP over UDP and TCP, and port 5061 is used for SIP encrypted with TLS. In the IANA port registry, port 5060 is registered for the sip service.

What port 5060 is used for

  • Phones and calling apps: office phones and calling apps on phones and computers (softphones) register with the phone system on port 5060.
  • Cloud phone system: an IP phone system (PBX), for example Asterisk, receives calls from the extensions and passes them on to the telephony provider.
  • SIP Trunk: telephony providers connect the phone system to the regular phone network over a digital SIP line.

In the encrypted version, SIP runs over TLS on port 5061, and the voice is usually encrypted with SRTP.

Port 5060 in the firewall

On the phone system, open port 5060 and the RTP port range set in it. In Asterisk, for example, the default RTP range is 10000 to 20000. When the extensions connect from fixed addresses, allow port 5060 only from their addresses and from the telephony provider's addresses:

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

firewalld also has a sip service, which opens port 5060 over UDP and TCP to all addresses.

Risks and security

A phone system with port 5060 open to the internet gets scans and automated login attempts on its extensions, like any login service. A few simple settings make sure those attempts don't succeed:

  • Give each extension a long, random password, different from the extension name.
  • Limit port 5060 to the addresses of the offices and the telephony provider when possible.
  • Temporarily block addresses that make repeated failed registration attempts, for example with fail2ban.
  • Disable anonymous incoming calls, and limit international dialing to the extensions that need it.
  • When your equipment supports it, prefer encrypted SIP on port 5061 and encrypted voice with SRTP.

Commands to check and configure

  • ss -tulnp | grep ':5060 '

    Checks whether the phone system is listening on port 5060, over UDP and TCP.

  • asterisk -rx "pjsip show endpoints"

    Shows the extensions and their registration status in Asterisk.

  • tcpdump -ni any port 5060

    Shows the SIP messages reaching and leaving the phone system (requires root).

  • openssl s_client -connect sip.example.com:5061

    Checks that the phone system accepts encrypted SIP connections on port 5061, and shows its certificate details.

  • ufw allow from 198.51.100.0/24 to any port 5060 proto udp

    Allows port 5060 only from the given network (UFW).

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

    Allows port 5060 only from the given network in firewalld. Then run firewall-cmd --reload.

Port 5060 in the IANA registry

Port Protocol Service IANA registry description
5060 SCTP sip SIP
5060 TCP sip SIP
5060 UDP sip SIP

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

Port 5060 FAQ

What's the difference between port 5060 and port 5061?

Both ports are used for SIP. On port 5060, messages travel unencrypted, over UDP or TCP, while on port 5061 they travel encrypted with TLS. To encrypt the voice as well, combine port 5061 with SRTP.

Why does the call connect but I can't hear the other side?

In most cases, the SIP messages get through, but the voice, which travels on the RTP ports, is blocked. Make sure the RTP port range is open in the phone system's firewall, and that the phone system is configured correctly when it sits behind NAT.

Does changing the SIP port improve security?

Changing the port cuts down on automated scans, but it doesn't replace real protection. The protection itself comes from strong passwords for the extensions, limiting access to known addresses, and blocking repeated failed registration attempts.

Which ports do I need to open for an IP phone system?

Open port 5060 for SIP (and port 5061 when you use encrypted SIP), and the RTP port range set in the phone system, over UDP. When possible, limit the SIP ports to the addresses of the offices and the telephony provider.

Shopping cart

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

Site search

Accessibility

Text size
100%
Accessibility statement