https://redmine.pfsense.org/https://redmine.pfsense.org/favicon.ico?16780521162020-04-03T07:37:59ZpfSense bugtrackerpfSense - Bug #10416: dhcrelay command line options not properly configured for some DHCP failover scenarioshttps://redmine.pfsense.org/issues/10416?journal_id=453932020-04-03T07:37:59ZJim Pingle
<ul></ul><p>Why would you need to relay to a server in the same subnet as the clients it serves and the firewall? They can get a reply from it directly.</p>
<p>Using <code>-i</code> could re-introduce problems like <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: DHCP (IPv4) relay mistakenly listening on upstream interface (Resolved)" href="https://redmine.pfsense.org/issues/9466">#9466</a> and some others which were also solved by that change.</p>
<p>Alternately, we could add separate boxes for interfaces selection to pick upstream and downstream interfaces, defaulting to the current automatic behavior.</p>
<p>Either way, changes must be submitted as pull requests on Github: <a class="external" href="https://docs.netgate.com/pfsense/en/latest/development/submitting-a-pull-request-via-github.html">https://docs.netgate.com/pfsense/en/latest/development/submitting-a-pull-request-via-github.html</a></p> pfSense - Bug #10416: dhcrelay command line options not properly configured for some DHCP failover scenarioshttps://redmine.pfsense.org/issues/10416?journal_id=453962020-04-03T09:02:44ZJohn Steele
<ul></ul><p>Jim Pingle wrote:</p>
<blockquote>
<p>Why would you need to relay to a server in the same subnet as the clients it serves and the firewall? They can get a reply from it directly.</p>
</blockquote>
<p>Yes, from the in-subnet server you can, of course. However, the FO peer (in another subset), will never see the DHCPDISCOVER packet. For ISC DHCP failover (see <a class="external" href="https://tools.ietf.org/html/draft-ietf-dhc-failover-12">https://tools.ietf.org/html/draft-ietf-dhc-failover-12</a>), <strong>both</strong> servers need to the see the discover packet, then they both hash the client-ID to compute which one responds. The “losing” peer won’t respond. So, the current behavior, since it doesn’t relay in that scenario, breaks DHCP FO.</p>
<blockquote>
<p>Using <code>-i</code> could re-introduce problems like <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: DHCP (IPv4) relay mistakenly listening on upstream interface (Resolved)" href="https://redmine.pfsense.org/issues/9466">#9466</a> and some others which were also solved by that change.</p>
</blockquote>
<p>Agreed, which is why the change wasn’t just reinstating the “-i” behavior across the board, but only for interfaces that had overlapping behavior, hopefully to help mitigate.</p>
<blockquote>
<p>Alternately, we could add separate boxes for interfaces selection to pick upstream and downstream interfaces, defaulting to the current automatic behavior.</p>
</blockquote>
<p>That still wouldn’t fix the behavior, unfortunately, as a “global” setup. The really “right” answer, which is beyond my coding ability, is the option for separate instances of dhcrelay for each interface, such that, for this situation, you would only specify the one off-network server for relay, but specify different server lists for other networks. This would actually be a feature enhancement, of course, but a welcome one. That could also be problematic, though, as you’d most likely need multiple dhcrelay instances binding to the same interface/port.</p>
<blockquote>
<p>Either way, changes must be submitted as pull requests on Github: <a class="external" href="https://docs.netgate.com/pfsense/en/latest/development/submitting-a-pull-request-via-github.html">https://docs.netgate.com/pfsense/en/latest/development/submitting-a-pull-request-via-github.html</a></p>
</blockquote>
<p>The patch was just me trying to be overly helpful, as I had to get this to work anyway. Apologies for breaking protocol.</p> pfSense - Bug #10416: dhcrelay command line options not properly configured for some DHCP failover scenarioshttps://redmine.pfsense.org/issues/10416?journal_id=453972020-04-03T09:09:31ZJim Pingle
<ul></ul><p>John Steele wrote:</p>
<blockquote>
<p>Jim Pingle wrote:</p>
<blockquote>
<p>Why would you need to relay to a server in the same subnet as the clients it serves and the firewall? They can get a reply from it directly.</p>
</blockquote>
<p>Yes, from the in-subnet server you can, of course. However, the FO peer (in another subset), will never see the DHCPDISCOVER packet. For ISC DHCP failover (see <a class="external" href="https://tools.ietf.org/html/draft-ietf-dhc-failover-12">https://tools.ietf.org/html/draft-ietf-dhc-failover-12</a>), <strong>both</strong> servers need to the see the discover packet, then they both hash the client-ID to compute which one responds. The “losing” peer won’t respond. So, the current behavior, since it doesn’t relay in that scenario, breaks DHCP FO.</p>
</blockquote>
<p>I thought of that after but not using DHCP Relay much I wasn't sure if that was really viable or allowed. It seems like a strange design choice but if that's how it works, so be it.</p>
<blockquote><blockquote>
<p>Using <code>-i</code> could re-introduce problems like <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: DHCP (IPv4) relay mistakenly listening on upstream interface (Resolved)" href="https://redmine.pfsense.org/issues/9466">#9466</a> and some others which were also solved by that change.</p>
</blockquote>
<p>Agreed, which is why the change wasn’t just reinstating the “-i” behavior across the board, but only for interfaces that had overlapping behavior, hopefully to help mitigate.</p>
</blockquote>
<p>I get that but there are multiple issues we've had in the past reported with <code>-i</code> on its own, so I think no matter how we try to guess automatically, it's going to be problematic for the user.</p>
<blockquote><blockquote>
<p>Alternately, we could add separate boxes for interfaces selection to pick upstream and downstream interfaces, defaulting to the current automatic behavior.</p>
</blockquote>
<p>That still wouldn’t fix the behavior, unfortunately, as a “global” setup.</p>
</blockquote>
<p>Having separate choices for upstream and downstream would give the user manual control over which one is used for each role and if an interface is chosen for both roles, then <code>-i</code> could be used instead of the more specific option. It lets the user determine what happens rather than making the backend code guess which is what it does now (and what your patch also does, but with <code>-i</code>).</p>
<blockquote>
<p>The really “right” answer, which is beyond my coding ability, is the option for separate instances of dhcrelay for each interface, such that, for this situation, you would only specify the one off-network server for relay, but specify different server lists for other networks. This would actually be a feature enhancement, of course, but a welcome one. That could also be problematic, though, as you’d most likely need multiple dhcrelay instances binding to the same interface/port.</p>
</blockquote>
<p>IMO, the best possible answer is to run IP Helper/DHCP Relay on the L2 -- switches, AP, etc, not the firewall/router. But not everyone has that choice.</p> pfSense - Bug #10416: dhcrelay command line options not properly configured for some DHCP failover scenarioshttps://redmine.pfsense.org/issues/10416?journal_id=453982020-04-03T09:21:34ZJohn Steele
<ul></ul><p>Jim Pingle wrote:</p>
<blockquote>
<p>Having separate choices for upstream and downstream would give the user manual control over which one is used for each role and if an interface is chosen for both roles, then <code>-i</code> could be used instead of the more specific option. It lets the user determine what happens rather than making the backend code guess which is what it does now (and what your patch also does, but with <code>-i</code>).</p>
</blockquote>
<p>That would actually be pretty cool. Like you said, my patch does that, just keeping in line w/ the "guessing" concept, computing the "right" option. Whether it's manual (as you defined), or automatic (ref my patch), it's the behavior that's important. No ego on the patch (again, was just my fix to get my network back up), just need the -i behavior potential.</p>
<blockquote>
<p>IMO, the best possible answer is to run IP Helper/DHCP Relay on the L2 -- switches, AP, etc, not the firewall/router. But not everyone has that choice.</p>
</blockquote>
<p>I completely agree, when it's doable, but like you said, it isn't always, especially on smaller sites, which is what burned me, actually.</p> pfSense - Bug #10416: dhcrelay command line options not properly configured for some DHCP failover scenarioshttps://redmine.pfsense.org/issues/10416?journal_id=460212020-05-05T13:04:22ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Assignee</strong> set to <i>Jim Pingle</i></li><li><strong>Target version</strong> set to <i>2.4.5-p1</i></li></ul><p>I couldn't get the patch to work as-is, the downstream list always ended up empty, but I found a variation which appears to do the right thing automatically.</p> pfSense - Bug #10416: dhcrelay command line options not properly configured for some DHCP failover scenarioshttps://redmine.pfsense.org/issues/10416?journal_id=460222020-05-05T13:15:07ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Feedback</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="DHCP Relay: Account for dual-role interfaces. Fixes #10416 Based on a patch from John Steele on ..." href="https://redmine.pfsense.org/projects/pfsense/repository/2/revisions/a76e61149b79fe2892f6083454a563b860a035ab">a76e61149b79fe2892f6083454a563b860a035ab</a>.</p> pfSense - Bug #10416: dhcrelay command line options not properly configured for some DHCP failover scenarioshttps://redmine.pfsense.org/issues/10416?journal_id=461962020-05-14T14:44:46ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li></ul><p><code>dhcrelay</code> is running with the expected options now, using <code>-i</code> when an interface is detected as both upstream and downstream.</p>