Docker bridge networking does not work in Ubuntu 22.04

I have a solution for you, the problem is netplan, ubuntu 22.04 use netplan to adress ip via DHCP. You need to modify the file /etc/netplan/50-cloud-init.yaml and add en in front of the * :

network:
    ethernets:
        all:
            dhcp4: true
            dhcp6: true
            match:
                name: 'en*'
    renderer: networkd
    version: 2

this will force netplan to use DHCP only on interface en* and the docker interface is docker0

next apply the configuration and restart network:

netplan apply
sudo systemctl restart systemd-networkd

#Docker need to be restarted to request a new ip
systemctl restart docker
3 Likes