Unable to find IPv4 address for ORPort
Summary
Using a Tor Relay behind a NAT with dynamic IP address, the relay isn't able to get the IP.
The network only accepts IPv4.
Steps to reproduce:
- Configure router to NAT 9001 into Tor Relay;
- Define
ORPort 9001 IPv4Only
intorrc
; - Run the relay and wait until
journald
receivesUnable to find IPv4 address for ORPort
.
What is the current bug behavior?
The relay isn't able to identify which public IPv4 it should use, so it isn't joining into the consensus and receiving flags. It is being ignored by the Tor network.
What is the expected behavior?
Identify its IPv4 and be part of the Tor network contributing with bandwidth.
Environment
- Which version of Tor are you using? Run
tor --version
to get the version if you are unsure.
0.4.7.13
- Which operating system are you using? For example: Debian GNU/Linux 10.1, Windows 10, Ubuntu Xenial, FreeBSD 12.2, etc.
Ubuntu 22.04.2 LTS @ Raspberry Pi 3 Model B Plus.
- Which installation method did you use? Distribution package (apt, pkg, homebrew), from source tarball, from Git, etc.
Apt packages from https://deb.torproject.org
Relevant logs and/or screenshots
debug.log
Mar 25 17:10:42.000 [info] update_consensus_networkstatus_downloads(): Launching microdesc standard networkstatus consensus download.
Mar 25 17:10:42.000 [debug] compute_weighted_bandwidths(): Generated weighted bandwidths for rule weight as directory based on weights Wg=0.412700 Wm=1.000000 We=0.000000
Wd=0.000000 with total bw 35527529420.000000
Mar 25 17:10:42.000 [debug] directory_initiate_request(): anonymized 0, use_begindir 1.
Mar 25 17:10:42.000 [debug] directory_initiate_request(): Initiating consensus network-status fetch
Mar 25 17:10:42.000 [info] connection_ap_make_link(): Making internal direct tunnel to [scrubbed]:9001 ...
Mar 25 17:10:42.000 [debug] connection_add_impl(): new conn type Socks, socket -1, address (Tor_internal), n_conns 143.
Mar 25 17:10:42.000 [info] connection_ap_make_link(): ... application connection created and linked.
Mar 25 17:10:42.000 [debug] connection_add_impl(): new conn type Directory, socket -1, address 185.21.216.197, n_conns 144.
Mar 25 17:10:42.000 [info] directory_send_command(): Downloading consensus from 185.21.216.197:9001 using /tor/status-vote/current/consensus-microdesc/0232AF+14C131+23D15
D+27102B+49015F+E8A9C4+ED03BB+F533C8.z
Mar 25 17:10:42.000 [debug] directory_send_command(): Sent request to directory server 185.21.216.197:9001 (purpose: 14, request size: 350, payload size: 0)
Mar 25 17:10:42.000 [info] update_consensus_router_descriptor_downloads(): 0 router descriptors downloadable. 0 delayed; 6527 present (0 of those were in old_routers); 0
would_reject; 0 wouldnt_use; 0 in progress.
Mar 25 17:10:42.000 [debug] tor_rename(): Renaming /var/lib/tor/state.tmp to /var/lib/tor/state
Mar 25 17:10:42.000 [info] or_state_save(): Saved state to "/var/lib/tor/state"
Mar 25 17:10:42.000 [debug] prune_old_routers_callback(): Pruning routerlist...
Mar 25 17:10:42.000 [info] routerlist_remove_old_routers(): We have 6527 live routers and 13007 old router descriptors.
Mar 25 17:10:42.000 [debug] consdiffmgr_cleanup(): Looking for consdiffmgr entries to remove
Mar 25 17:10:42.000 [info] channel_check_for_duplicates(): Performed connection pruning. Found 3 connections to 33 relays. Found 3 current canonical connections, in 3 of
which we were a non-canonical peer. 0 relays had more than 1 connection, 0 had more than 2, and 0 had more than 4 connections.
Mar 25 17:10:42.000 [info] router_rebuild_descriptor(): Rebuilding relay descriptor
Mar 25 17:10:42.000 [debug] get_address_from_config(): Attempting to get address from configuration
Mar 25 17:10:42.000 [info] get_address_from_config(): No Address option found in configuration.
Mar 25 17:10:42.000 [debug] get_address_from_orport(): Attempting to get address from ORPort
Mar 25 17:10:42.000 [info] address_can_be_used(): Address '0.0.0.0' is a private IP address. Tor relays that use the default DirAuthorities must have public IP addresses.
Mar 25 17:10:42.000 [debug] get_address_from_interface(): Attempting to get address from network interface
Mar 25 17:10:42.000 [debug] get_interface_address6(): Found internal interface address '192.168.13.3'
Mar 25 17:10:42.000 [info] address_can_be_used(): Address '192.168.13.3' is a private IP address. Tor relays that use the default DirAuthorities must have public IP addre
sses.
Mar 25 17:10:42.000 [debug] get_address_from_hostname(): Attempting to get address from local hostname
Mar 25 17:10:42.000 [info] address_can_be_used(): Address '127.0.1.1' is a private IP address. Tor relays that use the default DirAuthorities must have public IP addresse
s.
Mar 25 17:10:42.000 [info] find_my_address(): Unable to find our IP address.
Mar 25 17:10:42.000 [notice] Unable to find IPv4 address for ORPort 9001. You might want to specify IPv6Only to it or set an explicit address or set Address.
Mar 25 17:10:42.000 [info] router_build_fresh_unsigned_routerinfo(): Don't know my address while generating descriptor. Launching circuit to authority to learn it.
Mar 25 17:10:42.000 [warn] tor_bug_occurred_(): Bug: ../src/feature/relay/relay_find_addr.c:225: relay_addr_learn_from_dirauth: Non-fatal assertion !(!ei) failed. (on Tor
0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: Tor 0.4.7.13: Non-fatal assertion !(!ei) failed in relay_addr_learn_from_dirauth at ../src/feature/relay/relay_find_addr.c:225. Stack trac
e: (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(log_backtrace_impl+0x6c) [0xaaaad427e72c] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(tor_bug_occurred_+0x164) [0xaaaad4296bb4] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(relay_addr_learn_from_dirauth+0x1f0) [0xaaaad43d6964] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(+0x27d78c) [0xaaaad440d78c] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(router_build_fresh_descriptor+0x44) [0xaaaad423a0f4] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(router_rebuild_descriptor+0x94) [0xaaaad423a604] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(consider_publishable_server+0x44) [0xaaaad423aa84] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(+0x245b6c) [0xaaaad43d5b6c] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(+0x8832c) [0xaaaad421832c] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /lib/aarch64-linux-gnu/libevent-2.1.so.7(+0x1fd04) [0xffff95dbfd04] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /lib/aarch64-linux-gnu/libevent-2.1.so.7(event_base_loop+0x444) [0xffff95dc1868] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(do_main_loop+0xfc) [0xaaaad41fb51c] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(tor_run_main+0x1e0) [0xaaaad41ff4a0] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(tor_main+0x54) [0xaaaad41ff8e4] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(main+0x20) [0xaaaad41f2320] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /lib/aarch64-linux-gnu/libc.so.6(+0x273fc) [0xffff955573fc] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0x98) [0xffff955574cc] (on Tor 0.4.7.13 )
Mar 25 17:10:42.000 [warn] Bug: /usr/bin/tor(_start+0x30) [0xaaaad41f23b0] (on Tor 0.4.7.13 )
Possible fixes
Set Address
with a host that points to my dynamic IP address but as far as I know when the relay is configured with Address
and the public IP changes, the relays isn't able to get this change.
Edited by mfilipe