A developer's Docker bridge network 172.17.0.0/16 collides with the corporate VPN range. How do you fix it?
IntermediateScenarioAddressing, CIDR & Routing
Answer
Situation read → Docker's default bridge uses 172.17.0.0/16, and anything on the corporate side using that block becomes unreachable from the host.
What I'd do →
- Change the default address pool in
/etc/docker/daemon.json:{"bip":"172.30.0.1/24","default-address-pools":[{"base":"172.31.0.0/16","size":24}]} - Restart with
sudo systemctl restart docker - Recreate compose networks with
docker compose down && docker compose up -d - Check with
docker network inspect bridgeandip route
Why → The kernel sees the Docker bridge as a directly connected route that wins over the VPN route.
Interview tip → Roll the daemon.json change through your laptop or runner image so it never happens twice.
More on Addressing, CIDR & Routing
You own 10.0.0.0/16 for a new VPC and need separate /24 subnets for dev, QA and prod across two AZs. How do you carve it up?BeginnerA host is configured as 192.168.1.130/25. What network does it belong to and what is the broadcast address?BeginnerHow many usable IPs does an AWS subnet of /28 have?BeginnerA route table has 10.0.0.0/16 -> local and 10.0.1.0/24 -> vpn-gw. Where does a packet to 10.0.1.5 go?BeginnerA newly built server can ping everything in its subnet but nothing outside. What is the first thing you check?BeginnerYou are picking a private range for a new company network. Which RFC 1918 range do you choose and why?Beginner