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

DHCP proxy doesn't honor host config #695

Open
Aetylus opened this issue May 18, 2023 · 5 comments
Open

DHCP proxy doesn't honor host config #695

Aetylus opened this issue May 18, 2023 · 5 comments
Labels

Comments

@Aetylus
Copy link

Aetylus commented May 18, 2023

For an interface eth0 with DHCP client settings configured similar to the following:

$ sudo nmcli c modify eth0 ipv4.dhcp-vendor-class-identifier my-class-1

and a macvlan Podman network with DHCP proxy:

$ sudo podman network create -d macvlan -o parent=eth0 webnetwork
$ sudo systemctl enable --now netavark-dhcp-proxy.socket

I would expect that the macvlan network honor the configuration of the parent connection through the DHCP proxy, but this doesn't appear to be the case. Testing with a simple container such as:

$ sudo podman run -dt --name webserver --network webnetwork --rm quay.io/libpod/banner

and using dhcpdump -i eth0 on the host, I'm not seeing the DHCP option being sent in requests by the container. I have confirmed the host will send it if it makes a DHCP request itself however.

Is this intended behavior? Is there any way to get the network to use the host's DHCP configuration?

@Luap99
Copy link
Member

Luap99 commented May 19, 2023

Is this intended behavior?

Yes the proxy has no idea about any settings on the host interface. First of all how would we even know what dhcp settings do you use? We have no idea until we start reading NetworkManager configs but then other users may not be using network manager so how can we even know that. Supporting this would be a nightmare.
Second, while vendor class my be fine to send for more than once for multiple request if something like dhcp-client-id is set it would not work at all.

Is there any way to get the network to use the host's DHCP configuration?

Not at present. The only way I see us supporting this is to allow some options as network options, i.e. podman network create --opt ...

@Aetylus
Copy link
Author

Aetylus commented May 19, 2023

I see, thank you!

@Aetylus Aetylus closed this as completed May 19, 2023
@Luap99
Copy link
Member

Luap99 commented May 19, 2023

Is there a specific reason that you have to set dhcp-vendor-class-identifier? We can consider adding this as feature if you need it.

@Aetylus
Copy link
Author

Aetylus commented May 19, 2023

Is there a specific reason that you have to set dhcp-vendor-class-identifier? We can consider adding this as feature if you need it.

I was looking to configure a separate set of DHCP options (through dnsmasq tags or dhcpd classes) for Podman containers and was hoping to see if I could identify them using the vendor class identifier (as that seemed the most appropriate DHCP option available). I'm not sure how useful it would be for others but if it's possibly helpful down the line for others, having it available as a feature would be nice!

@Luap99 Luap99 reopened this May 22, 2023
@baude baude added the RFE label Jun 29, 2023
@SilverBut
Copy link
Contributor

If DHCP request can carry custom options settable during container creation (for example, #676 wants to send container name as hostname), then you can add a client class in the DHCP server, and assign class-specific options. However, currently all requests comes from the DHCP proxy is not carrying additional info about container, except for a random MAC address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants