<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks for the reply.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
I tried several different methods and hit on one that works.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">It involves MACvlans, dhclient pseudo interfaces, and dhclient hook scripts.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #CCCCCC 1.0pt;padding:4.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:3.0pt;border:none;padding:0in"><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#444444">Regards.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt;border:none;padding:0in"><b><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#444444"><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="margin-bottom:3.0pt;border:none;padding:0in"><b><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#444444">Mark K Vallevand</span></b><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#444444"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:3.0pt"><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#444444">Unisys 651-635-7708 |
</span><span style="font-size:9.0pt;font-family:"Arial",sans-serif"><a href="mailto:mark.vallevand@unisys.com"><span style="color:#0563C1">mark.vallevand@unisys.com</span></a><span style="color:#444444">
<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt"><span style="font-size:8.0pt;color:#2072BC"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt"><a href="http://www.unisys.com/"><span style="font-size:11.0pt;color:windowtext;text-decoration:none"><img border="0" width="124" height="27" style="width:1.2916in;height:.2812in" id="Picture_x0020_49" src="cid:image001.png@01DA55AE.FD3E9B20"></span></a><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt">From:</span></b><span style="font-size:11.0pt"> dhcp-users <dhcp-users-bounces@lists.isc.org>
<b>On Behalf Of </b>Simon<br>
<b>Sent:</b> Friday, February 2, 2024 6:43 AM<br>
<b>To:</b> Users of ISC DHCP <dhcp-users@lists.isc.org><br>
<b>Subject:</b> Re: Can you use DHCP to assign an address to the downstream interface used by dhcrelay?<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="mso-line-height-alt:.75pt"><span style="font-size:1.0pt;color:white">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 <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-line-height-alt:.75pt"><span style="font-size:1.0pt;color:white"><o:p></o:p></span></p>
</div>
<pre style="white-space:pre-wrap"><span style="font-size:11.0pt;font-family:"Arial",sans-serif">On 2 Nov 2023, at 17:13, Vallevand, Mark K <<a href="mailto:Mark.Vallevand@UNISYS.com">Mark.Vallevand@UNISYS.com</a>> wrote:<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">> I have configured dhcrelay upstream and downstream interfaces and a server address.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">> DHCP addresses are correctly relayed from machines on the downstream side to the upstream side and back.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">> Rather than using a static address in the downstream interface, I would like to assign a DHCP address using dhclient to the downstream interface.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">> Dhcrelay does not seem to handle this case.  If the origin of the request is the actual downstream interface, it is not relayed.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">> Is this possible?  Can I use dhclient to get an address for the downstream interface used by dhcrelay?<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">Sorry, I’ve not had time to keep up here for a bit - I see this one seems to have gone unanswered.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">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.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">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.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">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.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">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.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">I assume not the answer you were looking for, but at least you now understand why it isn’t working.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">Simon<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">-- <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/">https://www.isc.org/contact/</a> for more information.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">dhcp-users mailing list<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><a href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a><o:p></o:p></span></pre>
</div>
</body>
</html>