Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[comms(p2p)]: remote tor incoming connection not working #5405

Closed
leet4tari opened this issue May 24, 2023 · 0 comments · Fixed by #5406
Closed

[comms(p2p)]: remote tor incoming connection not working #5405

leet4tari opened this issue May 24, 2023 · 0 comments · Fixed by #5406
Assignees
Labels
A-comms Area - Comms C-bug Category - fixes a bug, typically associated with an issue.

Comments

@leet4tari
Copy link
Contributor

leet4tari commented May 24, 2023

Describe the bug
Using the work done - #5357
Found that env p2p.tor.listener_address_override was been sent to tor as the return address for the incoming connections and not p2p.tor.forward_address as expected.

To Reproduce
Steps to reproduce the behavior:
set:
p2p.tor.forward_address=/dns4/base_node/tcp/12345
p2p.tor.listener_address_override=/ip4/0.0.0.0/tcp/12345
Start basenode and it is unable to get incoming connections: ⚡️ symbol is not shown and list-connections shows no incoming.
Using WireShark, see that tor is setup with 0.0.0.0:12345 and not what should resolve to an IP address for base_node.

Expected behavior
If node is run inside of docker or kubernetes, basenode tools would not be able to autodetect network settings.
p2p.tor.forward_address is the address that should be set in tor to send p2p traffic into the basenode.
p2p.tor.listener_address_override should be the address that basenode would bind to locally.

an example:
would be that tor will need to be able to reach the address setup for tor as an incoming connection. ie: p2p.tor.forward_address=/dns4/base_node/tcp/12345 resolves to 192.168.123.100
p2p.tor.listener_address_override=/ip4/0.0.0.0/tcp/12345 basenode binds and accepts incoming connections on all address on port 12345.

workaround:
p2p.tor.listener_address_override=/ip4/192.168.123.100/tcp/12345 and find that tor is setup with basenode incoming/forward address of 192.168.123.100:12345 and starting the basenode, it comes online very quickly.

Desktop (please complete the following information):

  • quay.io/tarilabs/tari_base_node:v0.50.0-pre.1_20230508_41b7d84
  • daily build on OSX Intel/Apple M1 - tari_suite-0.50.0-pre.1-9ad6144-macos-x86_64.zip / tari_suite-0.50.0-pre.1-9ad6144-macos-arm64.zip

Additional context
Testing without setting up docker or kubernetes, move tor to a none-localhost IP address. Can be seen as a single tor proxy point for all LAN traffic.

@sdbondi sdbondi self-assigned this May 24, 2023
@sdbondi sdbondi added C-bug Category - fixes a bug, typically associated with an issue. A-comms Area - Comms labels May 24, 2023
SWvheerden added a commit that referenced this issue May 25, 2023
…5406)

Description
---
Sets the onion service forward address to the correct port only if
configured to port 0.

Motivation and Context
---
Fixes #5405 

How Has This Been Tested?
---
Manually, default settings were also tested.

What process can a PR reviewer use to test or verify this change?
---
```toml
# This doesnt work (no incoming connections as expected)
#tor.forward_address = "/dns4/localhost/tcp/12345"
# This does work
tor.forward_address = "/ip4/10.71.1.141/tcp/12345"
tor.listener_address_override = "/ip4/10.71.1.141/tcp/12345"
```

Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->

Co-authored-by: SW van Heerden <[email protected]>
SWvheerden added a commit that referenced this issue May 25, 2023
…5406)

Description
---
Sets the onion service forward address to the correct port only if
configured to port 0.

Motivation and Context
---
Fixes #5405 

How Has This Been Tested?
---
Manually, default settings were also tested.

What process can a PR reviewer use to test or verify this change?
---
```toml
# This doesnt work (no incoming connections as expected)
#tor.forward_address = "/dns4/localhost/tcp/12345"
# This does work
tor.forward_address = "/ip4/10.71.1.141/tcp/12345"
tor.listener_address_override = "/ip4/10.71.1.141/tcp/12345"
```

Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->

Co-authored-by: SW van Heerden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-comms Area - Comms C-bug Category - fixes a bug, typically associated with an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants