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=0.0.0.0:5060” in this case, it is not suitable. Asterisk be listen on all interfaces.
If I write “bindaddr=192.168.0.1:5060”, Asterisk will listen on only one interface. But it is necessary to two.

How do I set only two addresses? For example 192.168.1.1 and 127.0.0.1.

Beforehand grateful for answers to the essence of my question.

Ogogon.

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.
https://wiki.asterisk.org/wiki/display/AST/PJSIP+Transport+Selection