ejabberd register from specific ip's

I am trying to setup my ejabberd server to allow user registration from a specific ip adress. So far the only time I can register a user is when I change ip_access value to all. But thats not what I want.

Here is part of my config file:

...
acl:
  ...
  loopback:
    ip:
      - "127.0.0.0/8"
      - "xx.xx.xx.xx"

  register_networks:
    ip:
      - "xx.xx.xx.xx"
...
access:
  ...
  register:
    all: allow

  trusted_network:
    loopback: allow

  register_network:
    register_networks: allow
...
registration_timeout: infinity
...
modules:
  ...
  mod_register:
    ip_access: register_network
    access: register
...

Neither trusted_network or register_network work. I always get 403 Forbidden error. I am using ejabberd 16.01

Maybe your problem is this

Maybe your problem is this one:

If you configure the listener in a IPv4 address, then provide an IPv4 address, example:

listen:
  -
    port: 5222
    module: ejabberd_c2s

acl:
  register_networks:
    ip:
      - "127.0.0.1"

14:08:12.227 [info] Start accepting TCP connections at 0.0.0.0:5222 for ejabberd_c2s

If you configure the listener in a IPv6 address, then provide an IPv6 address, example:

listen:
  -
    port: 5222
    ip: "::"
    module: ejabberd_c2s

acl:
  register_networks:
    ip:
      - "::FFFF:127.0.0.1"

14:09:20.960 [info] Start accepting TCP connections at [::]:5222 for ejabberd_c2s
Syndicate content