Restricting SIP access to specific IP address


I am wondering if its possible to access SIP accounts from specific IP address only. All I want to do is that I want to configure an extension, so that it would be accessible from only two specifics IP addresses.

Please let me know the way to do it.



Hi billsimon,

That really works great. Thank you very much for the info.

But is it possible that I will allow/permit multiple IPs.

like for example



I tried the following but it doesn’t work:

permit: -


permit: /



assuming that Asterisk allows multiple permit lines (I think but am not sure) then you can separate the entries with “&” and you’ll get multiple permit= lines for each IP/Mask you want to set.

This is what the deny and permit lines are for in your SIP extension config. Specify your IPs in the permit and leave the deny at to deny everything else.