Pjsip Ip Acl

Security -- Last reviewed 2026-06-13 security pjsip acl beginner Found this useful? Upvote it. ×

PJSIP IP ACL

Restrict which IP addresses can register or send calls through your Asterisk system using PJSIP ACLs. This is a first line of defence against SIP scanning and brute-force registration attacks.

Requirements

Configuration

acl.conf

[trusted-networks]
deny=0.0.0.0/0.0.0.0
permit=10.0.0.0/255.0.0.0
permit=172.16.0.0/255.240.0.0
permit=192.168.0.0/255.255.0.0
; Add your SIP trunk provider IPs here
permit=203.0.113.50/255.255.255.255

pjsip.conf: apply the ACL to a transport or endpoint

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[my-endpoint]
type=endpoint
; ... other endpoint settings ...
acl=trusted-networks

How it works

  1. Deny all: The deny=0.0.0.0/0.0.0.0 rule blocks every source IP by default.
  2. Permit trusted ranges: Subsequent permit lines whitelist your LAN subnets and SIP trunk provider addresses.
  3. ACL binding: Setting acl=trusted-networks on an endpoint (or transport) causes Asterisk to drop SIP packets from non-permitted sources before authentication is even attempted.

Tips

User Notes

Know a tip or gotcha for this topic? Share it below and help others.

Contribute a note

Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.

Moderated before publishing. Email never shown.
Related Snippets