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

Zebra should support separate local bind and external advertise addresses #1890

Closed
4 tasks
teor2345 opened this issue Mar 12, 2021 · 9 comments · Fixed by #8488
Closed
4 tasks

Zebra should support separate local bind and external advertise addresses #1890

teor2345 opened this issue Mar 12, 2021 · 9 comments · Fixed by #8488
Assignees
Labels
A-network Area: Network protocol updates or fixes C-bug Category: This is a bug C-enhancement Category: This is an improvement I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use

Comments

@teor2345
Copy link
Contributor

teor2345 commented Mar 12, 2021

Is your feature request related to a problem? Please describe.

Currently, Zebra binds to the configured listen_addr, and also advertises that address to peers for inbound connections.

This doesn't work for nodes which bind to an internal address, but receive inbound connections on a different external address. (For example, NAT and firewalls.)

These nodes won't get inbound connections, because other nodes don't know their inbound addresses.

Describe the solution you'd like

Zebra should:

  • add an external_addr config option, which can contain one or more IPv4 or IPv6 addresses
  • advertise these addresses to other nodes in Version messages
  • add these addresses to inbound Peers responses
    • make the AddressBook ignore any null addresses (0.0.0.0 or [::]) when adding or updating peers from any source

Describe alternatives you've considered

We could just support a single external address, but that makes dual-stack IPv4/IPv6 impossible.
We could support multiple listener addresses.

@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage P-Medium I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use labels Mar 12, 2021
@zfnd-bot zfnd-bot bot added this to To Do in 🦓 Mar 12, 2021
@teor2345 teor2345 added this to No Estimate in Effort Affinity Grouping via automation Mar 12, 2021
@teor2345 teor2345 moved this from No Estimate to S - 3 in Effort Affinity Grouping Mar 12, 2021
@mpguerra mpguerra added P-Low and removed P-Medium S-needs-triage Status: A bug report needs triage labels Mar 15, 2021
@teor2345
Copy link
Contributor Author

teor2345 commented Jun 2, 2022

We can re-open this if users ask for it.

@teor2345 teor2345 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2022
@upbqdn
Copy link
Member

upbqdn commented May 24, 2023

I, as a random Zebra user, am interested in having this functionality. I could run Zebra at home on a private IP, redirect its traffic through a $5 VPS (which I already pay for) with a public IP, and accept inbound connections.

@teor2345
Copy link
Contributor Author

teor2345 commented Jun 8, 2023

I, as a random Zebra user, am interested in having this functionality. I could run Zebra at home on a private IP, redirect its traffic through a 5$ VPS (that I already pay for) with a public IP, and accept inbound connections.

I just discovered a workaround for this:
Run 2 Zebra instances:

  1. Port forward your external IP to the first instance
  2. Add your external IP (or dynamic DNS name) to the initial_mainnet_peers list for the second instance, along with the default DNS seeders

Then the second instance will connect to the first instance via your external IP, and gossip its IP address.

Other Zebra instances will also auto-detect the external IPs of instances with 0.0.0.0 in their version messages. So if you're using the default Zcash port externally, and listening on 0.0.0.0 internally, your IP might already be gossiped on the network.

@teor2345
Copy link
Contributor Author

teor2345 commented Jun 8, 2023

I'm going to re-open this, because it would have been really useful to have for the final release candidate testing.

@teor2345 teor2345 reopened this Jun 8, 2023
🦓 automation moved this from To Do to In progress Jun 8, 2023
@teor2345 teor2345 added A-network Area: Network protocol updates or fixes and removed A-rust Area: Updates to Rust code labels Oct 30, 2023
@emersonian
Copy link

+1, all of our instances are behind load balancers and cannot yet contribute to the P2P network.

@mpguerra
Copy link
Contributor

I've scheduled this for next sprint (Sprint 10) let's see if we can tackle this then

@oxarbitrage
Copy link
Contributor

We could just support a single external address, but that makes dual-stack IPv4/IPv6 impossible.

I think is a lot easier to do a single external address as having multiple address will require negotiate with each one of them.

@emersonian in your case, will a single address make it ?

@emersonian
Copy link

A single address is fine with me, thanks for looking into this.

For the backlog: it would be amazing if Zebra could auto-discover its public IP address(es) as a configuration option some day, saving me an initContainer step when rolling out deployments.

@oxarbitrage
Copy link
Contributor

A single address is fine with me, thanks for looking into this.

Ok, lets do this for now as my first impression is telling me it will be a lot easier.

For the backlog: it would be amazing if Zebra could auto-discover its public IP address(es) as a configuration option some day, saving me an initContainer step when rolling out deployments.

We had an issue for this (#1893) but it was closed as not planned. @mpguerra do you think we should reopen it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network protocol updates or fixes C-bug Category: This is a bug C-enhancement Category: This is an improvement I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use
Projects
Archived in project
🦓
  
In progress
Development

Successfully merging a pull request may close this issue.

5 participants