firecat53 / dockerfiles

Dockerfiles: Gollum, Jackett, Miniflux, Nginx/PHP-FPM, Plex, Privatebin, Qbittorrent, Radarr, Sabnzbd, Samba, SSH Socks Proxy server, Sonarr, Syncthing, Transmission, Unifi Controller.
MIT License
623 stars 93 forks source link

transmission/README.rst is unclear on how IP assignment and gateway config should work #9

Closed exarkun closed 9 years ago

exarkun commented 9 years ago

The last step in the README:

    # pipework br0 transmission_run <ip address>/24@<gateway ip>

doesn't specify what the requirements for IP address selection are. It's pretty easy to guess it should be an address that's not already assigned on the network - but does it need to be an address from the same range as the host's address? Or does it need to be in a different range? Or is it irrelevant?

Similarly, is the gateway IP that is required a gateway address that's configured on the host already? Or is it the Docker interface address?

The answers might be simple and obvious to someone with the right experience but they're pretty mysterious to someone who isn't quite sure how networking is set up inside the container or what exactly the pipework command is supposed to do.

firecat53 commented 9 years ago

Yep, I can see how that can be confusing...it took me a long time to figure it out!

First, you have to create a bridge (br0) on the docker host. The host actually gets its network IP address from the bridge, not from its normal ethernet connection. For example, my server network card is assigned as 'eno1'. The bridge is named 'br0' and is the interface I use to get the IP address (static in this case) for the server.

Pipework uses some networking magic to assign a static IP address (in your regular network address space) to the transmission container. This would be the equivalent of having a 2nd computer in your network hooked up to the router and getting its own IP address.

The default docker0 bridge uses it's own network (typically 172.17.42.1) that is independant of the 'real' network. That's the network that 'normal' containers use with the default '--net=bridge' mode.

So:

192.168.0.1 (Gateway/router) |-> br0 -> server 192.168.0.101 -> docker0 (default docker bridge) -> other docker containers |-> br0 -> transmission 192.168.0.102 |--> other computers on the network

The transmission container has to use the same gateway as the host (192.168.0.1 in this case).

Hopefully that helped some! I'll try to at least add an example to the README to try and clarify it.

Thanks, Scott