Specify ipv6 address to listen on to

Hi all,
I have multiple IPv6 addresses on my machine and I want ejabberd only listen on a specific one. How do I do that? I tried various forms of the ip,{...} configuration parameter but that didn't work.

Thanks for help.

Try setting the IPv6 address in tuple form

Let's say I want c2s of port 5222 to listen only in the IPv6 address: ::ffff:127.0.0.1

To configure ejabberd, you need to express that IPv6 address in tuple form. How to know the correct value? This way:

$ erl
Erlang (BEAM) emulator version 5.6.3 [source] [smp:2] [async-threads:0] [kernel-poll:false]

Eshell V5.6.3  (abort with ^G)
1> inet_parse:address("::ffff:127.0.0.1").
{ok,{0,0,0,0,0,65535,32512,1}}

Now that you know the correct value, edit ejabberd.cfg and specify the IP address as a tuple:

{listen,
 [
  {5222, ejabberd_c2s, [
                        inet6,
                        {ip, {0,0,0,0,0,65535,32512,1}},
                        {certfile, "/etc/ejabberd/ssl.pem"}, starttls,
                        {access, c2s},
                        {shaper, c2s_shaper},
                        {max_stanza_size, 65536}
                       ]},
...

When I login with my Jabber client, I see in ejabberd.log:

=INFO REPORT==== 12-Jul-2008::12:15:37 ===
I(<0.265.0>:ejabberd_listener:114) : (#Port<0.439>) Accepted connection
{{0,0,0,0,0,65535,32512,1},48887} -> {{0,0,0,0,0,65535,32512,1},5222}

If you try this, can you pease report that it works correctly? I mean that ejabberd only listens in that IPv6 address, and clients can connect correctly, etc. Thanks

Related feature request:

mmm... seems correcectly,

mmm... seems correcectly, ejabberd listens only in that IPv6:

netstat -apn | grep beam
____________cut__________________
tcp        0      0 2001:470:1f0b:243::6222 :::*                    LISTEN      2612/beam

but bug/feature request "Allow to specify IP address in string format in the Listen section" still present:

=CRASH REPORT==== 14-Jul-2008::09:10:13 ===
  crasher:            
    pid: <0.267.0>
    registered_name: ejabberd_listeners
    exception exit: {start_spec,{duplicate_child_name,5222}}
      in function  gen_server:init_it/6
    initial call: gen:init_it(gen_server,<0.239.0>,<0.239.0>,
                              {local,ejabberd_listeners},
                              supervisor,
                              {{local,ejabberd_listeners},
                               ejabberd_listener,[]},
                              [])
    ancestors: [ejabberd_sup,<0.36.0>]
    messages: []
    links: [<0.239.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 23
    reductions: 196
  neighbours:
   
=SUPERVISOR REPORT==== 14-Jul-2008::09:10:13 ===
     Supervisor: {local,ejabberd_sup}
     Context:    start_error
     Reason:     {start_spec,{duplicate_child_name,5222}}
     Offender:   [{pid,undefined},
                  {name,ejabberd_listener},
                  {mfa,{ejabberd_listener,start_link,[]}},
                  {restart_type,permanent},
                  {shutdown,infinity},
                  {child_type,supervisor}]

& any ipv6 XMPP-client ?

IP can only be specified as tuple, not string

evadim wrote:

but bug/feature request "Allow to specify IP address in string format in the Listen section" still present:

Right, the two feature requests that I mentioned are still present in ejabberd, that's why I mentioned them.
Right now the only way to specify an IP address is providing the tuple.

Syndicate content