public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>
To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>,
	"t.lamprecht@proxmox.com" <t.lamprecht@proxmox.com>
Subject: Re: [pve-devel] [RFC cluster/manager/network 0/6] Add support for DHCP servers to SDN
Date: Thu, 14 Sep 2023 13:15:52 +0000	[thread overview]
Message-ID: <116a14f3d0de2447f3179f00f26468496e25f4d2.camel@groupe-cyllene.com> (raw)
In-Reply-To: <ac795743-b849-96ec-2e4a-c2d3da9c3c17@proxmox.com>

> 
> Ah sorry, DHCP leases will not persist across reboots of course. So
> this 
> could work I think.
> 

yes, the vm client will always send a dhcp request if you restart the
vm , or restart the networking service/dhcp client.

the lease timeout is really a decrementing counter in the guest os, to
auto renew/resend a dhcp request on expire.



I have done some tests with kea api,

The host "reservations" can't be done, as it need a database backend
and also it's a non-free plugin.

But, leases can be provided manually without any problem.

(The difference between both, is that with reservations, you don't need
to define a pool/iprange   in the subnet, as they are used for dynamic
ip assign).


So, after vm start, if we find free ip from ipam &&  inject a lease
though kea socket:

echo '{ "command": "lease4-add", "arguments": { "hw-address":
"16:e5:75:c1:28:a0", "ip-address": "192.168.0.101" } }' | socat
UNIX:/var/run/kea/kea4-ctrl-socket -,ignoreeof


The vm will get this ip at boot 

(we just need to be carefull, that if we don't inject any lease, the
dhcp will itself attribute an ip from the pool, I don't think it's
possible to disable this without hacking kea)




The kea config simply define the subnet && pool:


"Dhcp4": {
     "interfaces-config": {
        "interfaces": ["vnet1"],

    },
     ...
    "hooks-libraries": [
       {
             "library": "/usr/lib/x86_64-linux-
gnu/kea/hooks/libdhcp_lease_cmds.so",
       },
    ],
    "subnet4": [
        {

            "subnet": "192.168.0.0/24",
            "pools": [ { "pool": "192.168.0.20 - 192.168.0.200" } ],
            "option-data": [
                {
                    "name": "routers",
                    "data": "192.168.0.1"
                }
            ],
	}
    }

}


  reply	other threads:[~2023-09-14 13:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 13:42 Stefan Hanreich
2023-09-08 13:42 ` [pve-devel] [RFC pve-cluster 1/6] cluster files: add dhcp.cfg Stefan Hanreich
2023-09-08 13:43 ` [pve-devel] [RFC pve-manager 2/6] sdn: regenerate DHCP config on reload Stefan Hanreich
2023-09-08 13:43 ` [pve-devel] [RFC pve-network 3/6] sdn: dhcp: add abstract class for DHCP plugins Stefan Hanreich
2023-09-08 13:43 ` [pve-devel] [RFC pve-network 4/6] sdn: dhcp: subnet: add DHCP options to subnet configuration Stefan Hanreich
2023-09-11  4:03   ` DERUMIER, Alexandre
2023-09-13  8:37     ` Stefan Hanreich
2023-09-08 13:43 ` [pve-devel] [RFC pve-network 5/6] sdn: dhcp: add DHCP plugin for dnsmasq Stefan Hanreich
2023-09-08 13:43 ` [pve-devel] [RFC pve-network 6/6] sdn: dhcp: regenerate config for DHCP servers on reload Stefan Hanreich
2023-09-11  3:53 ` [pve-devel] [RFC cluster/manager/network 0/6] Add support for DHCP servers to SDN DERUMIER, Alexandre
2023-09-13  8:18   ` DERUMIER, Alexandre
2023-09-13  8:54   ` Stefan Hanreich
2023-09-13  9:26     ` DERUMIER, Alexandre
2023-09-13 11:37     ` Thomas Lamprecht
2023-09-13 11:43       ` DERUMIER, Alexandre
2023-09-13 11:50       ` Stefan Hanreich
2023-09-13 12:40         ` Thomas Lamprecht
2023-09-13 12:50         ` DERUMIER, Alexandre
2023-09-13 13:05           ` Stefan Hanreich
2023-09-13 13:21             ` DERUMIER, Alexandre
2023-09-13 13:48               ` Stefan Hanreich
2023-09-13 13:52                 ` Stefan Hanreich
2023-09-14 13:15                   ` DERUMIER, Alexandre [this message]
2023-09-20 21:48               ` DERUMIER, Alexandre
2023-09-26 11:20                 ` Stefan Hanreich
2023-09-26 13:07                   ` DERUMIER, Alexandre
2023-09-26 14:12                     ` Stefan Hanreich
2023-09-26 16:55                       ` DERUMIER, Alexandre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=116a14f3d0de2447f3179f00f26468496e25f4d2.camel@groupe-cyllene.com \
    --to=alexandre.derumier@groupe-cyllene.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal