Skip to content

NethCTI Server: binds to IPv6 only when /etc/hosts has localhost mapped to ::1 #7856

@edospadoni

Description

@edospadoni

Description

On some NethServer 8 machines, the set-fqdn script comments out the IPv4 localhost entry in /etc/hosts, leaving only the IPv6 mapping:

# commented by set-fqdn #127.0.0.1   nethvoice localhost localhost.localdomain ...
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

This causes localhost to resolve only to ::1 (IPv6 loopback).

The nethcti-server HTTP proxy server and all internal REST services bind to localhost, which means they listen only on ::1. Any IPv4 connection (e.g. curl http://127.0.0.1:20050/...) gets connection refused.

$ netstat -tulnp | grep 20050
tcp6       0      0 ::1:20050               :::*                    LISTEN      239877/node

Additionally, the internal proxy router URLs use http://127.0.0.1:PORT, so even internal proxying between the gateway and backend services can fail.

Fix

  • nethcti-server: change the default bind address from localhost to 127.0.0.1 in http_proxy.js, and make it configurable via services.json
  • ns8-nethvoice: change all "address": "localhost" to "address": "127.0.0.1" in the services.json template in entrypoint.sh

This ensures all services explicitly bind to IPv4 127.0.0.1, consistent with the router URLs that already use 127.0.0.1.

Thread reference: https://mattermost.nethesis.it/nethesis/pl/58oe18kfttgm9kixnrf63oog6w

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoiceBug or features releted to the NethVoice project

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions