I KNOW this is going to be a user error in the end, but I’m not sure what I’m doing wrong
I have a local ip of 172.18.4.0/22. Using VMware Workstation I install Ubuntu desktop 24.04.2 with my network set to NAT in VMWare I can ping my host and local subnet.
I install Docker and can still ping my local subnet, no worries.
I spin up a container using docker-compose.yaml with a custom network (mynetwork) and set driver: bridge. in that network.
As soon as I do this my Ubuntu VM and containers can no longer ping my host or local subnet. My assumption is that I have a routing issue going on, maybe a default IP range of the bridge I’m creating conflicting with my local subnet?
How do I resolve this issue so my Ubuntu VM and containers can once again reach my local subnet? Here’s the docker-compose.yaml file I’m using
version: '3.8'
name: p_gas
services:
ignition:
image: inductiveautomation/ignition:latest
ports:
- 9088:8088 # Ignition Gateway
volumes:
- ./ignition_data1:/var/lib/ignition/data
environment:
- TZ=America/Chicago
networks:
- mynetwork
database:
image: postgres:latest
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres # The PostgreSQL user (useful to connect to the database)
POSTGRES_PASSWORD: password # The PostgreSQL password (useful to connect to the database)
POSTGRES_DB: default_database # The PostgreSQL default database (automatically created at first launch)
networks:
- mynetwork
networks:
mynetwork:
driver: bridge
I knew it was a user error issue, lol. Thanks! Right as you posted this, I was also able to figure out that I could fix it by changing the default bridge ip.
In Ubuntu this required me to make /etc/docker/daemon.json and enter the following:
Once I changed my default bridge IP and recreated my containers I could reach my local subnet again!
And it also explains why in Linux it broke my ability to talk to the local subnet. In it’s mind the 172.18 subnet needed to be routed to my docker bridge.