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

Discovery of external IPv4 #2413

Closed
yangwao opened this issue Feb 26, 2016 · 8 comments
Closed

Discovery of external IPv4 #2413

yangwao opened this issue Feb 26, 2016 · 8 comments
Assignees
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) topic/libp2p Topic libp2p

Comments

@yangwao
Copy link
Member

yangwao commented Feb 26, 2016

Hello. So I increased my level of IPFS knowledge a lot in last days. But I still have problem about external ip discovery. I know it's working like asking peers where I dial from. But this IPFS daemon is running for few hours & days and I still dont get external address, however, when I ran at same LAN segment on my mac, I get external IP. In resulting this, I'm having problem to pin anything from my server when I'm not home with mac :/

Any idea what could be wrong? Board is ARM Odroid X2.
Will to colaborate, yangwao @ freenode
Thanks!

root@markone:~# uname -a
Linux markone 3.8.13.30 libp2p/go-libp2p-nat#1 SMP PREEMPT Sat Sep 5 00:07:47 BRT 2015 armv7l armv7l armv7l GNU/Linux
root@markone:~# curl -s http://192.168.13.215:8080/version
Commit: d48cd56
root@markone:~# ipfs id
{
    "ID": "QmbzAwAqLzpEkCT98n8vYZkDGbbZZEkZzumYLyyRVJJfiz",
    "PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC77y7FK2NHq9Ty+bOCFVhcKq6rmwQWc3pQLdeMfERzsuoEYLbZOt03nEmD0/YuvzGVdV1XVtDapdnIyXenVTrDKc8Dnig4kN6aQV4bFODx27vtB7Qw+zvHGZXDW87DAhkk3aS208D+UpvCkXBoG0sDSW5S5vMNpBXoscsEhiAGbBopxxw3Ua+/mTQjYrLq0eGUAvzvKQ1HVe2sq2arUNjvS01cIL8npzgYcBYjcIQoQgGsR1Pc4IOFehOM64bDooG2k0jTZFS63HhJxLuEXQ7soolNR+4yJcDAXHj1Wp/Lpc47EE8BsolUwcON2Od9RKQlEUBhtLHp1ibMVukzaVKTAgMBAAE=",
    "Addresses": [
        "/ip4/127.0.0.1/tcp/4001/ipfs/QmbzAwAqLzpEkCT98n8vYZkDGbbZZEkZzumYLyyRVJJfiz",
        "/ip4/192.168.13.215/tcp/4001/ipfs/QmbzAwAqLzpEkCT98n8vYZkDGbbZZEkZzumYLyyRVJJfiz",
        "/ip6/::1/tcp/4001/ipfs/QmbzAwAqLzpEkCT98n8vYZkDGbbZZEkZzumYLyyRVJJfiz"
    ],
    "AgentVersion": "go-libp2p/0.1.0",
    "ProtocolVersion": "ipfs/0.1.0"
}
@mnp
Copy link

mnp commented Feb 28, 2016

Have a look at issue #57, where they're talking NAT traversal. I'd be interested to hear what the final transport resolution was, if it got lost in the issue threads.

@yangwao
Copy link
Member Author

yangwao commented Feb 28, 2016

Also I plan to upgrade my Odroid X2 to latest archlinux soon, may that helps somehow.
Kernel 3.8. could be really old and something doesnt play there good.
@mnp thanks for reference! This tunneling is always hassle.

@Kubuxu
Copy link
Member

Kubuxu commented Feb 28, 2016

For me the problem is that NAT traversal and IP discovery runs only during startup. This means if I switch interface I am using and my external IP changes, the ipfs silently stops resolving most hashes.

@mnp
Copy link

mnp commented Feb 29, 2016

@Kubuxu, sounds like an issue? Is there one open for that?

@whyrusleeping
Copy link
Member

Yeah, this definitely needs to be better. If anyone can make a good reproducible test script for this, that would help out tremendously.

I'm bumping this issues priority up a bit on my todo list

@whyrusleeping whyrusleeping added kind/bug A bug in existing code (including security flaws) topic/libp2p Topic libp2p labels Mar 3, 2016
@whyrusleeping whyrusleeping self-assigned this Mar 3, 2016
@mnp
Copy link

mnp commented Mar 4, 2016

Such a script should be pretty easy with a docker container. Docker engine around v1.10 supports attaching and detaching from multiple networks. You can make a new network, attach your container running a test article to it, and then detach from the old network. The interfaces will get changed out from under the test article. Approx like this:

$ docker network ls
NETWORK ID          NAME                DRIVER
284f80380e11        bridge              bridge
b2ab7b2a390b        none                null
e08234170b3f        host                host

$ docker network create extranet
56b1a95f5afa81db00e6d3c0f02f2471270dcd76d0f97d282be2e0b2571db613

$ docker network ls
NETWORK ID          NAME                DRIVER
56b1a95f5afa        extranet            bridge
284f80380e11        bridge              bridge
b2ab7b2a390b        none                null
e08234170b3f        host                host

$ docker run -itd --name=cont1 busybox
894696e9f9a93a1182ab52e8f646d24a4f761a17ab016727cc6424bff1508f58

$ docker exec -it cont1 ifconfig | grep 'inet addr'
          inet addr:172.17.0.3  Bcast:0.0.0.0  Mask:255.255.0.0
          inet addr:127.0.0.1  Mask:255.0.0.0

$ docker network connect extranet cont1

$ docker exec -it cont1 ifconfig | grep 'inet addr'
          inet addr:172.17.0.3  Bcast:0.0.0.0  Mask:255.255.0.0
          inet addr:172.18.0.2  Bcast:0.0.0.0  Mask:255.255.0.0
          inet addr:127.0.0.1  Mask:255.0.0.0

$ docker network disconnect bridge cont1

$ docker exec -it cont1 ifconfig | grep 'inet addr'
          inet addr:172.18.0.2  Bcast:0.0.0.0  Mask:255.255.0.0
          inet addr:127.0.0.1  Mask:255.0.0.0

I'll post here if I implement it.

@whyrusleeping whyrusleeping added the help wanted Seeking public contribution on this issue label Aug 23, 2016
@CMCDragonkai
Copy link

Would this be related to multihoming and mobile IP?

@Stebalien
Copy link
Member

Closing in favor of libp2p/go-libp2p#1541.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) topic/libp2p Topic libp2p
Projects
None yet
Development

No branches or pull requests

6 participants