ejabberd - Comments for "Listen on IPv4 and IPv6 interface" https://www.ejabberd.im/node/4163 en First check Case 6 in non-linux, then report https://www.ejabberd.im/node/4163#comment-56471 <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>Now consider an operating system where you have to explicitly specify if you want to use either IPv6 or IPv4 (exclusive or). If you where using such an operating system, then you where out of luck when you want to use ejabberd with both IP versions because you can only bind to _one_ IP address. You would have to decide if you want to bind to either IPv4 or IPv6 since you cannot specify more than one IP address and you cannot replicate the code as indicated by case 6.</p> <p>Maybe I should file a whishlist entry with this kind of option.</p></div> <p>Case 6 failed for me because I have that "IPv address forwarding" (or whatever it's called). In the machine that you refer, maybe case 6 works.</p> <p>Before you submit a feature request, you must verify that the request makes sense, and for that you need a machine as you describe (maybe FreeBSD or Solaris work that way: find machines, install Erlang, ejabberd and test what happens).</p> <p>Once you confirm the request is valid, then you can submit it to the proper project; which in this case is Erlang/OTP, which is what ejabberd uses to open the listeners in either IPv4 or 6.</p> Mon, 02 Aug 2010 14:24:23 +0000 mfoss comment 56471 at https://www.ejabberd.im whishlist https://www.ejabberd.im/node/4163#comment-56465 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>You enable ejabberd for a port on an IPv6 address and additionally you also get it running on an IPv4 address. This kind of side effect ... </p></div> <p>You can see in telnet of case 2 that the erlang program listens only in tcp6, in the IPv6 address.</p></div> <p>I guess this is a Linux feature (not depending on the distribution as long as a 2.6 kernel is used).</p> <p>Now consider an operating system where you have to explicitly specify if you want to use either IPv6 or IPv4 (exclusive or). If you where using such an operating system, then you where out of luck when you want to use ejabberd with both IP versions because you can only bind to _one_ IP address. You would have to decide if you want to bind to either IPv4 or IPv6 since you cannot specify more than one IP address and you cannot replicate the code as indicated by case 6.</p> <p>Maybe I should file a whishlist entry with this kind of option.</p> Sat, 31 Jul 2010 20:24:42 +0000 rubypro comment 56465 at https://www.ejabberd.im It isn't ejabberd or erlang https://www.ejabberd.im/node/4163#comment-56452 <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>You enable ejabberd for a port on an IPv6 address and additionally you also get it running on an IPv4 address. This kind of side effect ... </p></div> <p>You can see in telnet of case 2 that the erlang program listens only in tcp6, in the IPv6 address.</p> <p>That feature may be provided by the operating system, or the kernel, who forwards IPv4 connections to the IPv6 listener. Maybe this is a Debian thing and doesn't happen in Fedora or others; or maybe it's a Linux thing and doesn't happen in FreeBSD or others.</p> Wed, 28 Jul 2010 09:19:23 +0000 mfoss comment 56452 at https://www.ejabberd.im Case 4 works for me https://www.ejabberd.im/node/4163#comment-56439 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>I would like to use the new syntax using the ip options. How can I do this the new way? </p></div> <p>Use the configuration of case 4, which produces a result similar to case 2. </p></div> <p>OK. I was wondering if this is the way to go because it seems to be a bit awkward from an network administrator point of view. You enable ejabberd for a port on an IPv6 address and additionally you also get it running on an IPv4 address. This kind of side effect I wouldn't expect or in some cases I even wouldn't want it.</p> <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>I tried the following, but it does not work:<br /> {{5222, [{"::", {0,0,0,0}] }, ejabberd_c2s, [ </p></div> <p>You have much imagination, because that syntax isn't mentioned anywhere. Obviously it doesn't work. </p></div> <p>Yes ;-) This was something I hoped that it might work. I'm not really familiar with erlang but I hoped that I could specify a list of IPs.</p> <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>The only option I found to use the new ip option syntax was to duplicate the code for each service. But I do not want this redundancy of course. </p></div> <p>In fact, that doesn't work, as seen in case 6.</p></div> <p>Right.</p> <p>Thanks for your detailed explanations! I really appreciate this. I followed your suggestion of <em>case 4</em> and did a test on a CentOS 5.5 system with ejabberd 2.1.4 and it works like with the inet6 option in the old days.</p> <p>Kind regards,<br /> Rubypro</p> Fri, 23 Jul 2010 16:37:42 +0000 rubypro comment 56439 at https://www.ejabberd.im I tried all the cases that https://www.ejabberd.im/node/4163#comment-56436 <p>I tried all the cases that you mention, and a few more. I have Debian unstable and Erlang R13B05. In all cases I configured Tkabber to connect to the IP 127.0.0.1</p> <h3>Case 1: 2.0.5 with ipv4</h3> <p>ejabberd 2.0.5</p> <pre> {5222, ejabberd_c2s, [ </pre><p>listens in</p> <pre> $ netstat -nl | grep 5222 tcp 0 0 127.0.0.1:5222 0.0.0.0:* LISTEN </pre><p>when a client connects:</p> <pre> =INFO REPORT==== 23-Jul-2010::12:45:50 === I(&lt;0.290.0&gt;:ejabberd_listener:116) : (#Port&lt;0.4227&gt;) Accepted connection {{127,0,0,1},38674} -&gt; {{127,0,0,1},5222} </pre><h3>Case 2: 2.0.5 with ipv6</h3> <p>ejabberd 2.0.5</p> <pre> {5222, ejabberd_c2s, [ inet6, </pre><p>listens in</p> <pre> $ netstat -nl | grep 5222 tcp6 0 0 :::5222 :::* LISTEN </pre><p>when a client connects:</p> <pre> =INFO REPORT==== 23-Jul-2010::12:48:18 === I(&lt;0.262.0&gt;:ejabberd_listener:116) : (#Port&lt;0.4160&gt;) Accepted connection {{0,0,0,0,0,65535,32512,1},38691} -&gt; {{0,0,0,0,0,65535,32512,1},5222} </pre><h3>Case 3: 2.1.4 with ipv4</h3> <p>ejabberd 2.1.4 with</p> <pre> {{5222, "0.0.0.0"}, ejabberd_c2s, [ </pre><p>listens in</p> <pre> $ netstat -nl | grep 5222 tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN </pre><p>when a client connects:</p> <pre> =INFO REPORT==== 23-Jul-2010::12:40:45 === I(&lt;0.387.0&gt;:ejabberd_listener:232) : (#Port&lt;0.4018&gt;) Accepted connection {{127,0,0,1},59667} -&gt; {{127,0,0,1},5222} </pre><h3>Case 4: 2.1.4 with ipv6</h3> <p>ejabberd 2.1.4 with</p> <pre> {{5222, "::"}, ejabberd_c2s, [ </pre><p>listens in</p> <pre> $ netstat -nl | grep 5222 tcp6 0 0 :::5222 :::* LISTEN </pre><p>when a client connects:</p> <pre> =INFO REPORT==== 23-Jul-2010::12:41:14 === I(&lt;0.390.0&gt;:ejabberd_listener:232) : (#Port&lt;0.4034&gt;) Accepted connection {{0,0,0,0,0,65535,32512,1},59673} -&gt; {{0,0,0,0,0,65535,32512,1},5222} </pre><h3>Case 5: 2.1.4 with ipv6 using the old inet6 option</h3> <p>ejabberd 2.1.4 with</p> <pre> {5222, ejabberd_c2s, [ inet6, </pre><p>listens in</p> <pre> $ netstat -nl | grep 5222 tcp6 0 0 :::5222 :::* LISTEN </pre><p>when a client connects:</p> <pre> =INFO REPORT==== 23-Jul-2010::13:07:45 === I(&lt;0.368.0&gt;:ejabberd_listener:232) : (#Port&lt;0.4059&gt;) Accepted connection {{0,0,0,0,0,65535,32512,1},48339} -&gt; {{0,0,0,0,0,65535,32512,1},5222} </pre><h3>Case 6: 2.1.4 with two listeners</h3> <p>ejabberd 2.1.4 with</p> <pre> {{5222, "0.0.0.0"}, ejabberd_c2s, [ {{5222, "::"}, ejabberd_c2s, [ </pre><p>crashes with this error:</p> <pre> =ERROR REPORT==== 23-Jul-2010::12:36:25 === E(&lt;0.388.0&gt;:ejabberd_listener:463) : Failed to open socket: {5222,ejabberd_c2s,[inet6,{ip,{0,0,0,0,0,0,0,0}}]} Reason: IP address and port number already used: :: 5222 </pre><div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>While using ejabberd version 2.0.5, the prefered way was to use the inet6 keyword. </p></div> <p>Right, it works, at least in my Debian, as seen in case 2. It works exactly the same with 2.1.4 as seen in case 4.</p> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>I'm using ejabberd version 2.1.4 and would like to listen on both IP versions at the same time. </p></div> <p>As seen in case 4, it works similarly in 2.1.4 than case 2 of 2.0.5</p> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>The keyword is still working with version 2.1.4 </p></div> <p>Right, as seen in case 5, which provides the same result than case 4 and case 2.</p> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>I would like to use the new syntax using the ip options. How can I do this the new way? </p></div> <p>Use the configuration of case 4, which produces a result similar to case 2.</p> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>I tried the following, but it does not work:<br /> {{5222, [{"::", {0,0,0,0}] }, ejabberd_c2s, [ </p></div> <p>You have much imagination, because that syntax isn't mentioned anywhere. Obviously it doesn't work.</p> <div class="quote-msg"> <div class="quote-author"><em>rubypro</em> wrote:</div> <p>The only option I found to use the new ip option syntax was to duplicate the code for each service. But I do not want this redundancy of course. </p></div> <p>In fact, that doesn't work, as seen in case 6.</p> Fri, 23 Jul 2010 11:15:54 +0000 mfoss comment 56436 at https://www.ejabberd.im