-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Allow specifying vmnet network UUID to disable DHCP (when in Host mode) #141
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
Conversation
1d3ead9 to
88d975d
Compare
9d431ca to
9750c51
Compare
nirs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pallotron thanks! This Looks like an interesting feature but it is not clear what is the purpose of the new identifier.
Thanks for the feedback! You've raised a great point about the purpose of the new identifier. Let me clarify. The primary goal of this change is to enable running a custom DHCP server on a vmnet network, which is essential for specialized setups like a PXE boot environment. The ProblemI'm building a virtual lab to test our production PXE boot stack. This involves a "provisioner" VM (running dhcpd, tftp, etc.) and multiple "client" VMs that network-boot from it. For this to work, the client VMs and the provisioner need to be on an isolated network where my custom dhcpd can manage IP allocation. The issue is that vmnet.framework runs its own DHCP server on VMNET_[HOST|SHARED]_MODE networks by default because it provides IP addresses to the VMs that your are booting. The SolutionWhile digging into the vmnet.framework headers, I found a solution provided by Apple. According to By setting the vmnet_network_identifier_key, we can create an isolated VMNET_HOST_MODE network without the conflicting DHCP service. This allows the custom DHCP server in the provisioner VM to function correctly. This feature has been available since macOS 11.0. This allows me to start multiple client VMs on the same socket_vmnet socket, they can take IP addresses from provisioner VM just fine, the provisioner VM also work as a router and can forward client VMs traffic to the internet. It's also worth noting that a more explicit API is coming in the future. The same header file mentions: This I hope this clears things up! Let me know if you have any other questions. |
|
This sounds interesting. I think it would be nice to also provide a template with DHCP, router, and maybe even firewall and proxy, to show users how they can set up isolated networks for testing. |
Are you saying in this PR, I think it would be out of scope for this particular PR. But I agree with you it would be nice. |
|
sorry guys, I had a bicycle incident... I will get back at this and resolve all feedbacks once I can type on my laptop w/o pain :( |
f5abd62 to
e463209
Compare
pallotron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am back! :)
This should be now satisfy all feedback I recieved.
c18916a to
4642f9e
Compare
|
@nirs hey can you let me know if the PR looks good now? |
280ae44 to
b84a7e4
Compare
|
Please squash the commits |
…ost network only) This commit introduces a new `--vmnet-network-uuid` command-line option to allow setting the `vmnet_network_identifier_key` for vmnet. This property is only applicable to a vmnet_interface in VMNET_HOST_MODE. If this property is set, the vmnet_interface is added to an isolated network with the specified identifier. No DHCP service is provided on this network. This is useful for certain applications where the users need an isolated network and are running their own dhcp to assign IPs in such network. See issue [lima-vm#139](lima-vm#139) Signed-off-by: Angelo Failla <[email protected]>
b84a7e4 to
63acef2
Compare
I've squashed the commits as requested. I keep forgetting this specific project rules. Could you now please focus the review on the logical content of the change? I'd appreciate your feedback on the functional aspects which you could have provided when you mentioned about squashing and the stupid space after |
AkihiroSuda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good
This commit introduces a new
--vmnet-network-uuidcommand-line option to allow setting thevmnet_network_identifier_keyfor vmnet.This property is only applicable to a vmnet_interface in
VMNET_HOST_MODE.If this property is set, the vmnet_interface is added to an isolated network with the specified identifier.
No DHCP service is provided on this network.
This is useful for certain applications where the users need an isolated network and are running their own dhcp to assign IPs in such network.
See issue #139