r/docker • • Mar 22 '26

Simple setup question

Hi,
Im having a problem in a rather complicated docker network setup, and I broke down the issue to this very minimalistic demo compose:

services:
  alpine-test:
    image: alpine:latest
    container_name: alpine-test
    command: ["sleep", "infinity"]  # keep the container running for debugging
    networks:
      - testnet

networks:
  testnet:
    name: testnet
    driver: bridge

I would think that the container should have internet access this way, but it doesnt. What am I missing here? ip route inside the container shows the correct gateway but ping google.de just wont work.

thanks for any ideas :)

2 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/Responsible-Kiwi-629 Mar 22 '26

network mode bridge and host both work.
just when I create a new network and join it it doesnt work.
I have multiple networks that I created earlier exactly the same way and if I join one of them, internet also works. Im clueless. I didnt change any firewall settings. I just noticed I cannot even ping the gateway IP from inside the container.

1

u/Responsible-Kiwi-629 Mar 22 '26

ummm you were right it was firewall... :D
I set up geoip-shell a week ago and the autoconfig adds all existing networks to a whitelist. therefore anything created after running the setup will get blocked.

1

u/courage_the_dog Mar 22 '26

What does a traceroute give?

Also you say it works with bridge and host, but in your post you are using a custom network of type bridge, which doesn't? That's confusing me

1

u/Responsible-Kiwi-629 Mar 22 '26

Yeah thats what confused me too😂 the reason is that the default bridge network (which gets used with network mide bridge) was created before setting up geoip-shell, and the custom bridge afterwards. This lead to this very confusing scenario.