Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bridge doesn't work with DHCP #868

Open
jimparis opened this issue Dec 7, 2023 · 2 comments · May be fixed by #1159
Open

bridge doesn't work with DHCP #868

jimparis opened this issue Dec 7, 2023 · 2 comments · May be fixed by #1159

Comments

@jimparis
Copy link

jimparis commented Dec 7, 2023

With podman version 4.7.2, netavark version 1.8.0:

macvlan driver works with DHCP:

# podman network create --disable-dns --driver macvlan --interface-name brint --ipam-driver dhcp lan
lan
# podman run -it --rm --network=lan alpine ip addr show eth0
2: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 4e:81:42:14:17:be brd ff:ff:ff:ff:ff:ff
    inet 10.0.103.174/16 brd 10.0.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::4c81:42ff:fe14:17be/64 scope link tentative 
       valid_lft forever preferred_lft forever

(note assigned 10.0.103.174 address there)

But bridge does not:

# podman network rm lan
# podman network create --disable-dns --driver bridge --interface-name brint --ipam-driver dhcp lan
lan
# podman run -it --rm --network=lan alpine ip addr show eth0
2: eth0@if28: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c6:9b:3d:ec:27:6c brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c49b:3dff:feec:276c/64 scope link tentative 
       valid_lft forever preferred_lft forever

Is this configuration supportable?

(For my setup, I need bridge instead of macvlan so that the host can communicate with the container too. I can work around it with --cap-add NET_ADMIN,NET_RAW and running udhcpc inside the container, but would prefer to avoid that if possible.)

@jimparis
Copy link
Author

jimparis commented Dec 7, 2023

Actually this seems straightforward to support: #869

# podman network rm lan
lan
# podman network create --disable-dns --driver bridge --interface-name brint --ipam-driver dhcp lan
lan
# podman run -it --rm --network=lan alpine ip addr show eth0
2: eth0@if34: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether d6:7e:53:56:2b:27 brd ff:ff:ff:ff:ff:ff
    inet 10.0.103.178/16 brd 10.0.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::d47e:53ff:fe56:2b27/64 scope link tentative 
       valid_lft forever preferred_lft forever

@mwinters0
Copy link

I created #1090 to address the prereqs to this functionality and preferred approach, since those aren't DHCP-specific.

Luap99 pushed a commit to Luap99/netavark that referenced this issue Jan 9, 2025
Support DHCP for bridge driver, like macvlan.

Fixes containers#868

Signed-off-by: Jim Paris <[email protected]>
Signed-off-by: Paul Holzinger <[email protected]>
@Luap99 Luap99 linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants