Asterisk on not all network interfaces

A certain server has multiple network interfaces.
For example: two internal network, external network and loopbaсk.

I want what Asterisk listen on multiple interfaces, but not on all.
For example, on one internal and on loopback.

Any correctly written server daemon may directly specify the interfaces that will be served.

So, “bindaddr=” in this case, it is not suitable. Asterisk be listen on all interfaces.
If I write “bindaddr=”, Asterisk will listen on only one interface. But it is necessary to two.

How do I set only two addresses? For example and

Beforehand grateful for answers to the essence of my question.


chan_sip does not allow such a configuration, you can only tell it to bind to a single thing.

Whilst it is possible to write a server that will issue multiple socket listens and wait for them all, not doing so is not incorrect, and I would suggest that doing so is relatively unusual, and probably only commonly done on network infrastructure daemons.

In your case, why not listen on all and then set firewall rules that block port 5060 access from the ones you don’t want.

1 Like

This is possible using PJSIP channel driver, you can define that under the transport section.