add info how to punch a UPnP hole
This commit is contained in:
parent
d3ec6a7b4a
commit
f7fe4a181d
35
README.md
35
README.md
@ -38,6 +38,8 @@ Now you can use ipfs command as normal:
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ ipfs-daemon
|
$ ipfs-daemon
|
||||||
|
$ ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
|
||||||
|
|
||||||
$ ipfs id
|
$ ipfs id
|
||||||
$ ipfs swarm addrs --local
|
$ ipfs swarm addrs --local
|
||||||
$ ipfs pin ls -q --type recursive
|
$ ipfs pin ls -q --type recursive
|
||||||
@ -60,6 +62,39 @@ $ curl -s https://ipfs.io/ipfs/Qmdd7jNjEM4RXEnG8Y4ZikaqN6PUJkZ6bZuJZySEaFcuqY/do
|
|||||||
03f9ccb5d2a0e88acb60188e627042ef143c7fe5426c883863e78e66dab908d7 -
|
03f9ccb5d2a0e88acb60188e627042ef143c7fe5426c883863e78e66dab908d7 -
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Sharing stuff
|
||||||
|
|
||||||
|
To make sure your stuff gets shared across IPFS peers well, you need to make
|
||||||
|
sure your ipfs-daemon listening on 4001/tcp port is accessible from the WAN.
|
||||||
|
|
||||||
|
Either configure your router to foward the traffic coming to 4001/tcp to your
|
||||||
|
internal server/pc where your ipfs-daemon is running or just punch a port using
|
||||||
|
the UPnP protocol like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt-get -y install miniupnpc
|
||||||
|
$ upnpc -r 4001 tcp
|
||||||
|
```
|
||||||
|
|
||||||
|
> Your IGD (router/GW) must support UPnP for this to work.
|
||||||
|
|
||||||
|
After that you should see lots of traffic is coming to your port 4001/tcp:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo tcpdump -qenn -i eno1 src port 4001 and not src host 192.168
|
||||||
|
```
|
||||||
|
|
||||||
|
And ipfs reports lots of peers (>100 peers):
|
||||||
|
|
||||||
|
```
|
||||||
|
ipfs swarm peers
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, when you've shared some stuff via the IPFS, you can try accessing it via
|
||||||
|
any available public IPFS gateway (see link below).
|
||||||
|
|
||||||
|
It should return the content you've shared quickly.
|
||||||
|
|
||||||
### Links
|
### Links
|
||||||
|
|
||||||
- https://ipfs.github.io/public-gateway-checker/
|
- https://ipfs.github.io/public-gateway-checker/
|
||||||
|
@ -10,3 +10,6 @@ services:
|
|||||||
cap_add:
|
cap_add:
|
||||||
- IPC_LOCK # lock memory to prevent sensitive values from being swapped to disk.
|
- IPC_LOCK # lock memory to prevent sensitive values from being swapped to disk.
|
||||||
shm_size: 128M
|
shm_size: 128M
|
||||||
|
ports:
|
||||||
|
- 4001:4001
|
||||||
|
- 8080:8080
|
||||||
|
Loading…
Reference in New Issue
Block a user