ejabberd and ipv6

Hi,

I would like to configure ejabberd to use ipv4 and ipv6 on the same port for c2s. Can somebody tell me if this is possible and how to do it?

Franky

If you add the option

If you add the option 'inet6' to the listened socket on ejabberd.cfg, as described on ejabberd guide, ejabberd will listen to IPv6 and IPv4, at the same time, on the same port.

Example:

ejabberd.cfg wrote:

{listen,
[
{5222, ejabberd_c2s, [inet6, {access, c2s}, {shaper, c2s_shaper}]},
...
]}.

shell wrote:

$ telnet 127.0.0.10 5222
Trying 127.0.0.10...
Connected to 127.0.0.10.
Escape character is '^]'.
Connection closed by foreign host.

$ telnet -6 ::1 5222
Trying ::1...
Connected to ::1.
Escape character is '^]'.
Connection closed by foreign host.

ejabberd.log wrote:

=INFO REPORT==== 20-Oct-2006::15:52:11 ===
I(<0.246.0>:ejabberd_listener:90): (#Port<0.364>) Accepted connection {{0,0,0,0,0,65535,32512,10},53775} -> {{0,0,0,0,0,65535,32512,10},5222}

=INFO REPORT==== 20-Oct-2006::15:52:16 ===
I(<0.246.0>:ejabberd_listener:90): (#Port<0.322>) Accepted connection {{0,0,0,0,0,0,0,1},60879} -> {{0,0,0,0,0,0,0,1},5222}

I have this in my config:

I have this in my config:

{5222, ejabberd_c2s, [inet6, {access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536}]},

but whenever I launch ejabber, it says in the logfile:
=INFO REPORT==== 2006-10-20 16:49:59 ===
application: ejabberd
exited: shutdown
type: temporary

not too informative to me :-(
Netstat gives me nothing for port 5222. Can I check anything else?

What is the startup command

What is the startup command that you used? I got the same error you got, when the host in the cfg file did not match the -name parameter in the erl command line.

I use Freebsd and use "sockstat | grep beam" to look up ejabberd processes. If you get those "informational" errors, more than likely, your jabber server is not up and accessible. I struggled just this weekend with similar issues. Matching the host in the cfg and the -name parameter resolved it for me.

I don't think it's related

I don't think it's related to this:

the erl -name parameter is the same as in my config file, but it just fails to start when I use the inet6 parameter, normal ipv4 operation works just fine.

Not on FreeBSD.

This isn't true for the FreeBSD version. It only binds on v6, not on v4&v6.

Syndicate content