Send dhcp-users mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."
Today's Topics:
1. Re: Can you use DHCP to assign an address to the downstream
interface used by dhcrelay? (Simon)
2. RE: Can you use DHCP to assign an address to the downstream
interface used by dhcrelay? (Vallevand, Mark K)
----------------------------------------------------------------------
Message: 1
Date: Fri, 2 Feb 2024 12:43:16 +0000
From: Simon <[email protected]>
To: Users of ISC DHCP <[email protected]>
Subject: Re: Can you use DHCP to assign an address to the downstream
interface used by dhcrelay?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On 2 Nov 2023, at 17:13, Vallevand, Mark K <[email protected]> wrote:
> I have configured dhcrelay upstream and downstream interfaces and a server
> address.
> DHCP addresses are correctly relayed from machines on the downstream side to
> the upstream side and back.
> Rather than using a static address in the downstream interface, I would like
> to assign a DHCP address using dhclient to the downstream interface.
> Dhcrelay does not seem to handle this case. If the origin of the request is
> the actual downstream interface, it is not relayed.
> Is this possible? Can I use dhclient to get an address for the downstream
> interface used by dhcrelay?
Sorry, I?ve not had time to keep up here for a bit - I see this one seems to
have gone unanswered.
Unfortunately, you are in a catch-22 situation here. If the downstream
interface doesn?t have an IP address then presumably the relay cannot fill in
the GI-Addr field. If it can?t fill in the GI-Addr field, then the server can?t
locate the interface in order to offer an address.
To get around this situation, you?d need to configure the device in some way
before it could then use DHCP to get an address for the downstream - and once
you?ve set this up, you might as well just configure the interface.
Alternatively, you might be able to do some ?fudge? to get a subnet from the
server (similar to the way IPv6 Prefix Delegations can be done) and then use an
algorithm to configure the interface (e.g. pick the lowest usable address in
the subnet). The DHCP server would need some way of associating the request
with the device - and of course it needs the subnet details (such as router)
configured anyway in order to hand them to the clients.
However, I think your observation is a separate implementation specific
limitation. Because of the need to handle unaddressed packets (i.e. it needs to
receive and send broadcasts from/to the clients before they have an IP address)
I assume the relay agent shares code with the server in using a raw packet
interface rather than going through the IP stack. You can?t have two bits of
software doing this, and in any case running a client would result in a
broadcast packet OUT of the interface which would not be seen as an incoming
packet by the relay agent.
I assume not the answer you were looking for, but at least you now understand
why it isn?t working.
Simon
------------------------------
Message: 2
Date: Fri, 2 Feb 2024 14:19:28 +0000
From: "Vallevand, Mark K" <[email protected]>
To: Users of ISC DHCP <[email protected]>
Subject: RE: Can you use DHCP to assign an address to the downstream
interface used by dhcrelay?
Message-ID:
<ch2pr07mb6693abb261a45745f5011528ea...@ch2pr07mb6693.namprd07.prod.outlook.com>
Content-Type: text/plain; charset="utf-8"
Thanks for the reply.
I tried several different methods and hit on one that works.
It involves MACvlans, dhclient pseudo interfaces, and dhclient hook scripts.
I?ve formalized it into a utility library and it is used in a network appliance
for any interface that needs a DHCP address but cannot be directly connect to
the subnet with the DHCP server.
A macvlan interface is created to represent the target that needs a DHCP
address. The other end of the interface is the desired uplink interface. A
special configuration file is created for dhclient which tells it to run two
instances of DHCP state machine - one for the macvlan interface,
and one for a pseudo interface. The configuration also specifies a hook script
for the pseudo interface. The hook script doesn't actually do anything to the
pseudo interface - its not real - but uses its assigned address to configure
the target. So, two DHCP leases are pulled from the server - one for the
macvlan interface and one for the pseudo interface.
Regards.
Mark K Vallevand
Unisys 651-635-7708 |
[email protected]<mailto:[email protected]>
[cid:[email protected]]<http://www.unisys.com/>
From: dhcp-users <[email protected]> On Behalf Of Simon
Sent: Friday, February 2, 2024 6:43 AM
To: Users of ISC DHCP <[email protected]>
Subject: Re: Can you use DHCP to assign an address to the downstream interface
used by dhcrelay?
On 2 Nov 2023, at 17:?13, Vallevand, Mark K <Mark.?Vallevand@?UNISYS.?com>
wrote: > I have configured dhcrelay upstream and downstream interfaces and a
server address. > DHCP addresses are correctly relayed from machines on the
downstream
On 2 Nov 2023, at 17:13, Vallevand, Mark K
<[email protected]<mailto:[email protected]>> wrote:
> I have configured dhcrelay upstream and downstream interfaces and a server
> address.
> DHCP addresses are correctly relayed from machines on the downstream side to
> the upstream side and back.
> Rather than using a static address in the downstream interface, I would like
> to assign a DHCP address using dhclient to the downstream interface.
> Dhcrelay does not seem to handle this case. If the origin of the request is
> the actual downstream interface, it is not relayed.
> Is this possible? Can I use dhclient to get an address for the downstream
> interface used by dhcrelay?
Sorry, I?ve not had time to keep up here for a bit - I see this one seems to
have gone unanswered.
Unfortunately, you are in a catch-22 situation here. If the downstream
interface doesn?t have an IP address then presumably the relay cannot fill in
the GI-Addr field. If it can?t fill in the GI-Addr field, then the server can?t
locate the interface in order to offer an address.
To get around this situation, you?d need to configure the device in some way
before it could then use DHCP to get an address for the downstream - and once
you?ve set this up, you might as well just configure the interface.
Alternatively, you might be able to do some ?fudge? to get a subnet from the
server (similar to the way IPv6 Prefix Delegations can be done) and then use an
algorithm to configure the interface (e.g. pick the lowest usable address in
the subnet). The DHCP server would need some way of associating the request
with the device - and of course it needs the subnet details (such as router)
configured anyway in order to hand them to the clients.
However, I think your observation is a separate implementation specific
limitation. Because of the need to handle unaddressed packets (i.e. it needs to
receive and send broadcasts from/to the clients before they have an IP address)
I assume the relay agent shares code with the server in using a raw packet
interface rather than going through the IP stack. You can?t have two bits of
software doing this, and in any case running a client would result in a
broadcast packet OUT of the interface which would not be seen as an incoming
packet by the relay agent.
I assume not the answer you were looking for, but at least you now understand
why it isn?t working.
Simon
--
ISC funds the development of this software with paid support subscriptions.
Contact us at https://www.isc.org/contact/ for more information.
dhcp-users mailing list
[email protected]<mailto:[email protected]>
https://lists.isc.org/mailman/listinfo/dhcp-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://lists.isc.org/pipermail/dhcp-users/attachments/20240202/20404862/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2709 bytes
Desc: image001.png
URL:
<https://lists.isc.org/pipermail/dhcp-users/attachments/20240202/20404862/attachment.png>
------------------------------
Subject: Digest Footer
_______________________________________________
ISC funds the development of this software with paid support subscriptions.
Contact us at https://www.isc.org/contact/ for more information.
dhcp-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/dhcp-users
------------------------------
End of dhcp-users Digest, Vol 183, Issue 1
******************************************