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

Option to set external advertised IP #5979

Open
b3rsrk opened this issue Oct 11, 2019 · 6 comments
Open

Option to set external advertised IP #5979

b3rsrk opened this issue Oct 11, 2019 · 6 comments

Comments

@b3rsrk
Copy link

b3rsrk commented Oct 11, 2019

Problem

I would like to run my Monero nodes (at home) behind my edge server (cloud). The nodes should use my home internet connection for outgoing connections and accept connections on the edge server.

My current setup:
monerod

My current solution is to route the upstream traffic through the VPN as well. But the Edge Server got multiple public IPs, so there is still an issue.

Proposal

I'd propose an option similar to p2p-external-port to set the advertised external IP: p2p-external-ip.

Reference

bitcoind already got an option like this: bitcoin/bitcoin#15
Additional reference: https://monero.stackexchange.com/questions/6600/monerod-advertise-different-external-ip

@jbg
Copy link

jbg commented Jul 10, 2020

This feature is necessary for running a Monero node in any environment where the IP that outbound traffic will be SNAT'ed to differs from the IP that inbound traffic should connect to.

An example is Kubernetes, where the Service abstraction for incoming connections provides an IP dedicated to the service, whereas all outbound connections from the cluster node (or in the case of private clusters, the whole cluster) are usually NAT'ed to the same IP or one of a pool of IPs. At the moment there doesn't appear to be any way to run a Monero node reliably in this kind of environment, as only outbound connections work.

@jbg
Copy link

jbg commented Jul 10, 2020

Saving this from #monero here:

<moneromooo> Should be fairly easy to add. If you're looking for a guide for doing it yourself:
<moneromooo> - Add the same option as --external-p2p-port (if the name's right).
<moneromooo> - Add a field for an IP in the handshake structure, in one of
               src/{p2p,protocol}/*defs.h
<moneromooo> - Write it there when creating your own handshake packet
<moneromooo> - when you receive a handshake, check whether an IP is set in that packet, and use
               that IP instead of the incoming IP if so
<moneromooo> - use that IP to add to the peer list instead of always the incoming IP
<moneromooo> That should be it.

I'm hoping to work on this and send a PR next week.

@qertoip
Copy link

qertoip commented Nov 15, 2021

I would also welcome this option.

@reijerh
Copy link

reijerh commented Mar 24, 2023

Related to this: is there a way to advertise a domain/sub-domain instead of an IP for RPC auto-discovery? This way you can use a reverse proxy (e.g. NGINX) to still host monero RPC when you can only forward 1 port that is already needed for other services.

@thisIsNotTheFoxUrLookingFor

Did this ever happen?

@selsta
Copy link
Collaborator

selsta commented Jul 29, 2024

@tortxoFFoxtrot doesn't appear implemented yet, otherwise this issue would be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants