# Asterisk listens on ipv6 port

**URL:** <https://community.asterisk.org/t/asterisk-listens-on-ipv6-port/99666>\
**Category:** Asterisk Support\
**Created:** [November 16, 2023, 4:27pm UTC](https://community.asterisk.org/t/asterisk-listens-on-ipv6-port/99666 "2023-11-16T16:27:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![evg](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@evg](https://community.asterisk.org/u/evg)\
**Post date:** [November 16, 2023, 4:27pm UTC](https://community.asterisk.org/t/asterisk-listens-on-ipv6-port/99666/1 "2023-11-16T16:27:31Z")

</div>

Hi!

Please tell me why asterisk listens to ipv6 interface on random udp ports? Which module should be disabled or configured so that asterisk does not do this?

```auto
UNCONN 0 0 0.0.0.0:50735 0.0.0.0:* users:(("asterisk",pid=32236,fd=19))
UNCONN 0 0 0.0.0.0:sip 0.0.0.0:* users:(("asterisk",pid=32236,fd=21))
UNCONN 0 0 [::]:45051 [::]:* users:(("asterisk",pid=32236,fd=20))

```

---

<div class="post-metadata">

**Author:** ![penguinpbx](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/penguinpbx/32/8856_2.png) [@penguinpbx](https://community.asterisk.org/u/penguinpbx)\
**Post date:** [December 1, 2023, 6:38pm UTC](https://community.asterisk.org/t/asterisk-listens-on-ipv6-port/99666/2 "2023-12-01T18:38:49Z")

</div>

This might be the issue:

[https://issues-archive.asterisk.org/ASTERISK-25481](https://issues-archive.asterisk.org/ASTERISK-25481)

---

<div class="post-metadata">

**Author:** ![evg](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@evg](https://community.asterisk.org/u/evg)\
**Post date:** [December 15, 2023, 12:41pm UTC](https://community.asterisk.org/t/asterisk-listens-on-ipv6-port/99666/3 "2023-12-15T12:41:11Z")

</div>

Hello.  
Thank you very much for your help.  
I read this issue. This is a real problem. It’s still not clear why these ports are opened and whether it can be disabled. It’s strange that the problem is ignored by the community. This is a potential security hole.

---

<div class="post-metadata">

**Author:** ![penguinpbx](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/penguinpbx/32/8856_2.png) [@penguinpbx](https://community.asterisk.org/u/penguinpbx)\
**Post date:** [December 15, 2023, 8:54pm UTC](https://community.asterisk.org/t/asterisk-listens-on-ipv6-port/99666/4 "2023-12-15T20:54:57Z")

</div>

> [@evg](#):
>
> This is a potential security hole.

At first glance it may seem that way but in day-to-day usage this is more in the category of a minor nuisance for those curious about their open ports.

The particular lines of sus internal code are not in Asterisk but in the third-party PJSIP project, where the random ports for the PJSIP internal DNS clients are bound on IPv4:

> <https://github.com/pjsip/pjproject/blob/48f3723d7199e6ea3259810020f82a08dd900f4b/pjlib-util/src/pjlib-util/resolver.c#L281>

And IPv6:

> <https://github.com/pjsip/pjproject/blob/48f3723d7199e6ea3259810020f82a08dd900f4b/pjlib-util/src/pjlib-util/resolver.c#L327>

That’s getting in to the weeds a bit… this is developer-level discussion that might happen on a separate mailing list (concurrently penning an email over there…)

In the interim, you could potentially work-around the issue a bit by running something like DNSMASQ on localhost and specifying that as your resolver in /etc/resolv.conf, and patching these particular lines to use hard-coded ports that you protect with your local software firewall.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 14, 2024, 8:55pm UTC](https://community.asterisk.org/t/asterisk-listens-on-ipv6-port/99666/5 "2024-01-14T20:55:42Z")

</div>

Closed on January 14, 2024, 8:55pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
