-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Setup
podman 5.4.2 on Debian 13
Run as root.
podman create network1
podman create network2
podman create --driver macvlan ... network3
Test Cases
podman run --network network1 --network network2 alpine cat /etc/resolv.conf
shows two resolvers, OK
podman run --network network1 --dns 1.1.1.1 alpine cat /etc/resolv.conf
shows only resolvers from network1, not OK
podman run --network network3 alpine cat /etc/resolv.conf
shows resolvers from host, OK
podman run --network network1 --network network3 alpine cat /etc/resolv.conf
shows only resolvers from network1, not OK
podman run --network network3 --dns 1.1.1.1 alpine cat /etc/resolv.conf
shows only 1.1.1.1, OK
podman network update network1 --dns-add 1.1.1.1
# verifies 1.1.1.1 is added
podman network inspect network1
podman run --network network1 alpine cat /etc/resolv.conf
# does not show 1.1.1.1, not OK
podman network update network1 --dns-drop 1.1.1.1
Background
I want to put a few containers into an internal bridge network, such that they can find each other by names.
Meanwhile, one container needs internet access, so I put it into another macvlan network.
IP addresses works, but the container only sees the DNS server from the bridge network, so it cannot access Internet