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

Node announces wrong public port #7621

Open
Ineluki opened this issue Aug 25, 2020 · 4 comments
Open

Node announces wrong public port #7621

Ineluki opened this issue Aug 25, 2020 · 4 comments
Labels
kind/support A question or request for support

Comments

@Ineluki
Copy link

Ineluki commented Aug 25, 2020

Version information:

go-ipfs version: 0.5.0-36789ea
Repo version: 9
System version: amd64/linux
Golang version: go1.13.10

running the latest docker image (ipfs/go-ipfs latest 8096fbc6044b) in docker 19.03.12 swarm mode on amd64

Description:

The announced public port is incorrect. The node correctly detects the public IP (which changes daily), but adds a made-up port that can not be used to connect.

Config:

"Swarm": [
      "/ip4/0.0.0.0/tcp/9010",
      "/ip6/::/tcp/9010"
    ]

Router: forwarded public 9010 -> host 9010
Docker service: host 9010 -> container 9010

UPnP is disabled on the router

But advertised addresses are:

/ip4/127.0.0.1/tcp/9010/p2p/...
/ip4/172.18.0.21/tcp/9010/p2p/...
/ip4/<redacted-public-ip>/tcp/1056/p2p/...

Expected behavior: advertise port 9010, which is open from the public and works together with the correctly found public ip.

I don't know where the node got that 1056, it's not a forwarded port, nor is it mentioned anywhere in the config.

@Ineluki Ineluki added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Aug 25, 2020
@welcome
Copy link

welcome bot commented Aug 25, 2020

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@aschmahmann
Copy link
Contributor

@Ineluki I see you're running go-ipfs v0.5.0, could you try running v0.6.0 and see if you get the same result? (The image you linked to is not the latest docker image).

I don't know where the node got that 1056, it's not a forwarded port, nor is it mentioned anywhere in the config.

It's not a special port or anything. However, it may be possible that you are behind a NAT (e.g. your ISPs) and that other people see your address as /ip4/<redacted-public-ip>/tcp/1056/p2p/ when you connect to them. If enough people tell you that your address looks like /ip4/<redacted-public-ip>/tcp/1056/p2p/ then you will advertise it as an address.

@Ineluki
Copy link
Author

Ineluki commented Aug 25, 2020

I've tried it with 0.6 and 0.7-dev now (tags v0.6.0 and master-latest respectively). The problem persists.

Swarm announcing /ip4/127.0.0.1/tcp/9010
Swarm announcing /ip4/127.0.0.1/udp/9010/quic
Swarm announcing /ip4/172.18.0.21/tcp/9010
Swarm announcing /ip4/172.18.0.21/udp/9010/quic
Swarm announcing /ip4/<...>/tcp/1056

I haven't seen any hints that I am behind an ISP nat before. Trying to connect from another network via vpn also shows that port 9010 is the one needed from the outside.

@hsanjuan hsanjuan added kind/support A question or request for support and removed kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Aug 25, 2020
@hsanjuan
Copy link
Contributor

ipfs will not advertise ip4/0.0.0.0/tcp/9010 unless it receives multiple successful connections to it. If you want it advertised you need to hardcode your public ip + port in AnnounceAddrs. 1065 may well be the NAT outgoing port or a port obtained via upnp.

This is a libp2p issue: tracking here: libp2p/go-libp2p#789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

3 participants