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

Can coredhcp support multiple IPs on a single network card? #158

Open
attlee-wang opened this issue Sep 12, 2022 · 3 comments
Open

Can coredhcp support multiple IPs on a single network card? #158

attlee-wang opened this issue Sep 12, 2022 · 3 comments

Comments

@attlee-wang
Copy link

I have a case:
there are multiple Ipv4 and multiple ipv6 on a single network card, codedhcp does not seem to support it.
Hope to have this function.

@Natolumin
Copy link
Member

It does support that: it'll listen on ipv4 wildcard and ipv6 well-known multicast addresses by default, but you can specify which interface(s) and address(es) you want to listen on specifically in the configuration. It will use the same configuration for all the addresses, so if you need separate configurations for each address, you can launch multiple coredhcp processes instead

You can find details for configuring that here in the example configuration file, around the listen stanzas for server4 and server6: https://github.com/coredhcp/coredhcp/blob/master/cmds/coredhcp/config.yml.example

@attlee-wang
Copy link
Author

@Natolumin I may not have made it clear. I have only one network card, that is to say, only one MAC address, but I want to bind multiple IPV4 addresses to it. When multiple dhcp services are deployed, only one IPV4 address can be successfully bound, and other addresses will be rejected. So, what can I do to bind multiple IPV4 addresses to one MAC address?

@Natolumin
Copy link
Member

Ah! I completely misunderstood your initial message - you mean a client wants to obtain multiple IPs!

So 2 answers:

  • In DHCPv4, we don't support that and I we can't really without massive changes. The current model is strictly 1 request packet leads to 1 response packet. DHCPv4 has a single "yourip" field, so we would need to send multiple messages to assign multiple IPs to the same MAC client.
    Even if we could, I don't know of any dhcpv4 client that supports that and will install multiple IPs, and it's not really specified in standards so I'm not sure how we could make that work in a way that will work in the wild.

  • In DHCPv6, that's possible without much issue since the various IA_ options can appear multiple times, but none of the included plugins do it.
    You'll need to write a plugin with the logic to either answer multiple IA_Addr for each IA_NA(/TA) option, or one that can receive multiple IA_NA and track them independently. But at least there's no structural issue that prevents it

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

No branches or pull requests

2 participants