Internet access on bridge networks, host is fine

My server, due to malpractice on my part, fried the motherboard,
I swapped like for like and Proxmox as expected booted back to how it was before the accident, however my docker install for my media server has not returned as expected.

I can ping on the host, both 8.8.8.8 and domains - google.com

$ docker run -it --network=host busybox ping google.com
PING google.com (216.58.201.110): 56 data bytes
64 bytes from 216.58.201.110: seq=0 ttl=119 time=13.954 ms
64 bytes from 216.58.201.110: seq=1 ttl=119 time=14.885 ms
64 bytes from 216.58.201.110: seq=2 ttl=119 time=15.240 ms
64 bytes from 216.58.201.110: seq=3 ttl=119 time=15.281 ms

But anything under the bridge network fails both IP’s and domains (Leading me to think it is not DNS problems?)

$ docker run -it --network=bridge busybox ping google.com
ping: bad address 'google.com'

I am certain before it would work, and my containers were able to access the internet, but ever since they have been unable too.
I am running Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-59-generic x86_64)
I have also tried a reinstall of docker and compose following the instructions to the letter, but came back to exactly the same problem.

Im not sure if this has anything to do with it but I have two interfaces on the host machine for two different internal IP networks as shown with IP ROUTE;

$ ip route
default via 192.168.1.1 dev ens18 proto static
default via 192.168.2.1 dev ens19 proto static
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.18.0.0/16 dev br-d964f7b129cf proto kernel scope link src 172.18.0.1
192.168.1.0/24 dev ens18 proto kernel scope link src 192.168.1.102
192.168.2.0/24 dev ens19 proto kernel scope link src 192.168.2.102

I also have two bridge networks, the default bridge and a custom bridge which all my containers are running through.

$ brctl show
bridge name     bridge id               STP enabled     interfaces
br-d964f7b129cf         8000.cacab75952c6       no              veth0575749
                                                        veth06c3f21
                                                        veth2897fd5
                                                        veth377ad9d
                                                        veth4e76933
                                                        veth79edee9
                                                        veth9437004
                                                        veth9c26fa3
                                                        vethbb9e9a4
docker0         8000.6e77f6ab054b       no
simon@mediaserver:~$ docker network inspect opt_default
[
    {
        "Name": "opt_default",
        "Id": "d964f7b129cfbfa385534a25758f81f517ee7adc306157b55c8c1ed1fa1961bc",
        "Created": "2025-05-09T22:23:54.419575537Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv4": true,
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
            },
            "fbdae228bc8ed7c0d55546bdafc8a48648d465d3fcc9042bc7d01be6c1784251": {
                "Name": "tautulli",
                "EndpointID": "2703731f748948eac803028242a5bbb6f9038493bb3f861d8e91932c5d1d48a7",
                "MacAddress": "42:37:ef:2f:c0:b6",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.config-hash": "01c9149b853a93d8350841888a3ea97ca8a0ef3506836491cc3328e017739e82",
            "com.docker.compose.network": "default",
            "com.docker.compose.project": "opt",
            "com.docker.compose.version": "2.35.1"
        }
    }
]

(I have removed some of the containers to shorten the message)

One solution that I thought looked promising was adding some stuff to the netplan .yaml, but I could not quite work out exactly where or how, so I have added a copy of its current form.

$ sudo nano /etc/netplan/00-installer-config.yaml
  GNU nano 7.2                 /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens18:
      addresses:
      - 192.168.1.102/24
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
        search: []
      routes:
      - to: default
        via: 192.168.1.1
    ens19:
      addresses:
      - 192.168.2.102/24
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
        search: []
      routes:
      - to: default
        via: 192.168.2.1
  version: 2

That pretty much covers my situation, I have been going round in circles for days now trying to work out what the problem is, various other solutions I have found on the internet have not seemed to have the desired effect my end. So I have decided to put it to yous guys expertise. I am not particularly brilliant with this sort of stuff, most of what I have done so far is copy and paste, but would like to try and understand what everything is doing.

I don’t know why it wouldn’t work, but you can try to delete all containers and docker networks and recreate everything. If for example the docker host crashed and stopped unexpectedly, Docker could be in an state from which it cannot recover.

You can also try nicolaka/netshoot to debug network issues. There are some examples in the description.

And what is the difference between the networks? Can both connect to the internet? Have you tried both networks without the other?

Never used ChatGPT before, but decided to give it a go with this,

Turns out it was really helpful, and managed to get to the problem

I only have ens19 interface connected, but have ens18 programmed in, so that in an emergency I can plug it into a normal router on a 192.168.1.1 network I can still access things. At least in my head that is how I think it might work. As I said, I am not actually very good at all of this.

Basically it was having two interfaces that was causing my problems, not sure why host would work but bridge would not.
In the netplan yaml config, I added metric values to each interface, (Lower being higher priority). this solved the problems, everything now works again.

Will definitely use ChatGPT again, it explained everything it thought was wrong, and then explained what each change did.