Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

alias IP's and netplan and docker

Hi there. I've got a connectivity/routing issue i can't unpick...

 - I start from a VM with a primary IP and several alias IP address. I can ping 8.8.8.8 from the VM, and from a docker container on it. All good.
 - i bind those alias IP using netplan, and reboot. (yes, i fix the cloud-init thing first). I can still ping from the VM, but docker fails

I'm trying to do this because i want to use those alias IP addresses to present docker containers to the network on their own IP addresses

Any ideas please?

1 1 633
1 REPLY 1

Hi @matt-seedata-io ,

It seems like you are having issues with Docker after configuring the alias IP address using netplan on a VM instance. 

You need to check if your netplan config is correct, most importantly for the alias IP addresses. Check the syntax and settings on the netplan config file. After the reboot, confirm that the alias IP addresses are still assigned to the correct interfaces. Use commands like ip addr to list all configured IP addresses on the VM instance.

docker network ls
docker network inspect <your_network_name>

Using the command above, verify the Docker network config to ensure it is compatible with the changes on the netplan. Check if Docker is using the correct network interface and that it hasn't been affected by the changes.

Restart the Docker service to apply any changes made to the network configuration. 

sudo systemctl restart docker

Then, examine Docker logs for any error messages or issues that might indicate why it's failing to operate after the netplan changes.

journalctl -u docker.service