How To Bind To Ipv4 & Ipv6

Home » Asterisk Users » How To Bind To Ipv4 & Ipv6
Asterisk Users 7 Comments

Hi All,

This is my 1st post so lets go.

What I need to achieve is the following. I have server with both IPv4
addresses and IPv6 addresses. The problem that I am encountering is that in the sip.conf I am having difficulties to bind to both the IPv4 and IPv6 addresses.

Can someone please assist me in this regard as I need to connect another server to this server on IPv6 while the rest of the clients are connecting on IPv4.

I need to know how to get this working?

7 thoughts on - How To Bind To Ipv4 & Ipv6

  • Hi, Please Search the List there is already a post and solution.

    On Fri, Sep 27, 2013 at 3:58 PM, Daniel van den Berg

  • Hi Asghar,

    How do I search the site as I dont see a search bar anywhere…could you please give me the link to the solution in the list or educate me on how to search the site bar going through every thread one by one. 🙂

    Thanks!

    Regards,

  • Hi All,

    I dont really see a solution there to the problem, just that the matter was discussed?

    Can Asterisk or can it not listen for IPv4 & IPv6 addresses at the same time? I only see that there is mention that you must use the bindaddr=::
    for it to listen for IPv4 & IPv6 but when I do this my IPv4 connections drops.

    Thanks!

  • From sip.conf.sample included in your Asterisk source tree. See item c) and the Note:

    ; With the current situation, you can do one of four things:
    ; a) Listen on a specific IPv4 address. Example: bindaddr2.0.2.1
    ; b) Listen on a specific IPv6 address. Example: bindaddr 01:db8::1
    ; c) Listen on the IPv4 wildcard. Example: bindaddr=0.0.0.0
    ; d) Listen on the IPv4 and IPv6 wildcards. Example: bindaddr=::
    ; (You can choose independently for UDP, TCP, and TLS, by specifying different values for
    ; “udpbindaddr”, “tcpbindaddr”, and “tlsbindaddr”.)
    ; (Note that using bindaddr=:: will show only a single IPv6 socket in netstat.
    ; IPv4 is supported at the same time using IPv4-mapped IPv6 addresses.)
    ;
    ; You may optionally add a port number. (The default is port 5060 for UDP and TCP, 5061
    ; for TLS).
    ; IPv4 example: bindaddr=0.0.0.0:5062
    ; IPv6 example: bindaddr=[::]:5062
    ;
    ; The address family of the bound UDP address is used to determine how Asterisk performs
    ; DNS lookups. In cases a) and c) above, only A records are considered. In case b), only
    ; AAAA records are considered. In case d), both A and AAAA records are considered. Note,
    ; however, that Asterisk ignores all records except the first one. In case d), when both A
    ; and AAAA records are available, either an A or AAAA record will be first, and which one
    ; depends on the operating system.

  • Sorry, I meant item d) which says and I quote “Listen on the IPv4 and IPv6 wildcards. Example: bindaddr=::” and “Note that using bindaddr=:: will show only a single IPv6 socket in netstat. . IPv4 is supported at the same time using IPv4-mapped IPv6”

    —–Original Message—