How can i configure ejabberd to restrict ip addresses of clients that can connect to it?

Hello.
I have ejabberd version 2.0.5 on Ubuntu server and i'd like to configure it, that it would accept client connections only from a specific ip adresses (actually only from the same ip as server with ejabberd).

How can i do that?
Thank you.

For restricting IP addresses,

For restricting IP addresses, use a firewall.

But your cause is simple, maybe it works if you tell ejabberd to only listen in the local address:

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

Thanks for your reply,

Thanks for your reply, badlop!
I tried that as you suggested and it does not work as expected.
Firstly I put {ip, {127, 0, 0, 1}} in the config and ejabberd had refused all connections, including connections from the same machine.
After that I changed it to external IP of the server and ejabberd started accepting all connections.
What did I do wrong?

Syndicate content