[asterisk-users] tcpbind and source IP address

Kseniya Blashchuk ksyblast at gmail.com
Mon Mar 13 06:31:43 CDT 2017


Yes, look:
netstat -nlp | egrep '506[01]'
tcp        0      0 192.168.0.177:5061      0.0.0.0:*               LISTEN
     13255/asterisk
udp        0      0 192.168.0.177:5060      0.0.0.0:*
    13255/asterisk
Still, the problem is with *outgoing* *TCP* packets originated from
asterisk. Source IP is set to the first IP address of the interface only
when TCP is used. As I understand, the application (chan_sip in this case)
should request kernel to use the specific source IP address (used in bind
directive) for outgoing packets, however it seems to be done only for UDP.
For outgoing packets on TCP/5061 I see the following:
IP *192.168.0.172*.47596 > <mydestip>.5061: Flags [S], seq 2529313754, win
29200, options [mss 1460,sackOK,TS val 82765588 ecr 0,nop,wscale 7], length
0
And with UDP as transport:
IP *192.168.0.177*.5060 > <mydestip>.5060: SIP: OPTIONS ....




пн, 13 мар. 2017 г. в 13:55, Joshua Colp <jcolp at digium.com>:

> On Mon, Mar 13, 2017, at 03:52 AM, Kseniya Blashchuk wrote:
> > Hi!
> > Attached sip.conf and interface config as well. In this case we use only
> > TLS, but I have checked with TCP - same situation, 192.168.0.172 is used
> > as
> > a source. For UDP 192.168.0.177 is used as expected.
>
> Does the output of netstat -a confirm that it is bound to only that IP
> address? If so, then it seems chan_sip has done its part.
>
> --
> Joshua Colp
> Digium, Inc. | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & www.asterisk.org
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170313/42aec17d/attachment.html>


More information about the asterisk-users mailing list