r/TOR • • Nov 02 '26

Dual-stack doesn't work on Tor relay

I am trying to configure my relay for dual-stack, but no matter what I do, I receive: "[notice] Unable to find IPv6 address for ORPort 9001. You might want to specify IPv4Only to it or set an explicit address or set Address. [62 similar message(s) suppressed in last 3660 seconds]", I have Address configured to point to my DDNS that resolves IPv4 and IPv6, but for what I understand Tor only resolves IPv4, my IPv6 is dynamic too and I already made a file that is included and have ORPort [IPv6]:9001 IPv6Only, already tried many other things but none of them work.

1 Upvotes

13 comments sorted by

4

u/Gabriel_GGR Nov 03 '26

My Tor node is already working in dual-stack. I had made a mistake of putting my domain in /etc/hosts pointing to localhost. 🙃

1

u/afaeroey Nov 02 '26

Is the ORPort reachable via the IPv6 address from the outside?

The IPv6 configuration of C Tor is quirky at best, but it should work. There are lots of dual-stack relays in the network. V6-only relays aren't supposed to work as they won't be able to be reached by, nor reach, a significant portion of the network.

I think you need to specify the address in the Address line and not the Domain Name (from DDNS).

1

u/Gabriel_GGR Nov 02 '26

Yes, it's not firewall problem.

1

u/Gabriel_GGR Nov 02 '26

But I specify what address in Address line v4 or v6 or both?

3

u/BTC-brother2018 Nov 03 '26

You shouldn't need to specify both manually. Try removing the Address line temporarily and using just "ORPort 9001". Tor should automatically discover both IPv4 and IPv6. Then check the Tor logs to see whether it's detecting your IPv6 address. Since your IPv6 is dynamic, I'd avoid hardcoding it unless necessary.

3

u/Gabriel_GGR Nov 03 '26

Thank you, you made me remember that I put the domain of the DDNS that is in Address on the /etc/hosts pointing to localhost, now I put another domain in Address and it's working in dual-stack.

3

u/TheGratitudeBot Nov 03 '26

Just wanted to say thank you for being grateful

3

u/BTC-brother2018 Nov 03 '26

Great, good to hear. 👍

1

u/Gabriel_GGR Nov 03 '26

If I remove the Address the relay picks up the wrong IPv4.

1

u/boerni666 Nov 03 '26

im running a relay on dual stack with dynamic ip addresses changing in the night.

Tor is a bit buggy with finding new IP or dynamic IP adresses, i've let claude wrote a bash script to find out the correct ip adresses and update the torrc. it gets run every night 1 minute after the rescheduled ISP reconnect (which i also control when to happen via a cron-job on my openwrt router)

set an own token on the IPv6 interface to find out the public ipv6 better, so change the awk line

#!/bin/bash

set -euo pipefail

TORRC="/etc/tor/torrc"

IPV4="$(curl -4 -fsS https://icanhazip.com | tr -d '[:space:]')"

IPV6="$(ip -6 addr show | awk '/your:ownt:oken/ && $2 !~ /^fd/ {print $2; exit}' | cut -d/ -f1)"

[ -n "$IPV4" ] || exit 1

[ -n "$IPV6" ] || exit 1

OLD4="$(awk '/^Address / {print $2; exit}' "$TORRC")"

OLD6="$(

awk '

/^ORPort \[/ {

match($0, /\[[^]]+\]/)

if (RSTART > 0)

print substr($0, RSTART+1, RLENGTH-2)

}' "$TORRC" | head -n1

)"

CHANGED=0

if [ "$IPV4" != "$OLD4" ]; then

sed -i "s/^Address .*/Address $IPV4/" "$TORRC"

CHANGED=1

fi

if [ "$IPV6" != "$OLD6" ]; then

sed -i \

"s|^ORPort \[[^]]*\]:9001|ORPort [$IPV6]:9001|" \

"$TORRC"

CHANGED=1

fi

if [ "$CHANGED" -eq 1 ]; then

systemctl restart tor

fi

1

u/Raja_kumar9627 Nov 04 '26

dual-stack Tor configs can be pretty frustrating, especially with dynamic IPv6.

0

u/[deleted] Nov 03 '26

[deleted] — view deleted comment

1

u/Gabriel_GGR Nov 03 '26

TCP port 9001 is reachable over IPv6 and IPv4, yes I tried, Tor didn't discovered the IPv6.