Why am I getting NATed when talking to other Docker containers within the same bridge network

Hey guys so I’m currently experimenting with a torrent tracker server and two clients using Docker. My setup is that I created my own network called torrent-net.

docker network create -d bridge noto-network

I then go ahead and create three containers two for clients, one using ctorrent and the other one is custom go code. The third container has the opentracker server installed. The network configuration is as follows:

Gateway:
ip_address: 172.18.0.1/16
Opentracker:
ip_address: 172.18.0.2/16
announce_port: 6969
GoCode:
ip_address: 172.18.0.3/16
torrent_port: 6881
cTorrent
ip_address: 172.18.0.4/16
torrent_port: 2706

I start my tracker and ctorrent. When I send a request from my go code to the tracker I get sent back these two peers:

  • ip: 172.18.0.1
    port: 6881
  • ip: 172.18.0.1
    port: 2706

I have a questions:

All three containers are within the same network, so why talking to each other requires NAT?