Project

General

Profile

Actions

Bug #3611

closed

DHCP relay to a server behind the gateway does not work

Added by Bernhard Schmidt about 10 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
DHCP Relay
Target version:
Start date:
04/19/2014
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.1
Affected Architecture:

Description

We have the following setup

WAN: 192.168.15.16/29
LAN: 172.16.18.0/24
DHCP server: 10.156.33.53

iow, the DHCP server is located upstream behind the default gateway. In this setup, DHCP relay never worked.

Apr 19 19:48:24 pfsense php: /services_dhcp_relay.php: The command '/usr/local/sbin/dhcrelay -i vmx3f2 -i wan 10.156.33.134' returned exit code '1', the output was 'Internet Systems Consortium DHCP Relay Agent 4.2.6 Copyright 2004-2014 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Can't attach interface wan to bpf device /dev/bpf0: Device not configured  If you did not get this software from ftp.isc.org, please get the latest from ftp.isc.org and install that before requesting help.  If you did get this software from ftp.isc.org and have not yet read the README, please read it before requesting help. If you intend to request help from the dhcp-bugs at isc.org mailing list, please read the section on the README about submitting bug reports and requests for help.  Please do not under any circumstances send requests for help directly to the authors of this software - please send them to the appropriate mailing list as described in the README file.  exitin

When you look at the flags you notice that the pfSense LAN interface is obviously translated into the correct physical NIC name (vmx3f2), but the wan interface isn't (should be vmx3f0).

The following patch to /etc/inc/services.inc fixes the issue:

--- services.inc.bak    2014-04-19 20:28:22.000000000 +0200
+++ services.inc        2014-04-19 20:28:46.000000000 +0200
@@ -1377,7 +1377,7 @@
                        if (is_array($config['gateways']['gateway_item'])) {
                                foreach ($config['gateways']['gateway_item'] as $gateway) {
                                        if (isset($gateway['defaultgw'])) {
-                                               $destif = $gateway['interface'];
+                                               $destif = get_real_interface($gateway['interface']);
                                                break;
                                        }
                                }
Actions #1

Updated by Chris Buechler about 10 years ago

  • Target version set to 2.2

I think Phil Davis may have already put in a pull request to fix this, though at a quick glance I'm not seeing it.

Actions #2

Updated by Phillip Davis about 10 years ago

Yep, this should have fixed this issue: https://github.com/pfsense/pfsense/commit/d530f8f77da83d8e8dd1ac84c5a42077d52d70c6
"Get real interface when dhcrelay uses default GW"
That has been fixed on 2.1-branch since 2.1.2 was released. So you will need to apply the fix to a 2.1.2 system (using System Patches or manually - its a 1-liner).
Then please report back if it now works.

Actions #3

Updated by Chris Buechler about 10 years ago

  • Status changed from New to Feedback

Thanks Phil

Actions #4

Updated by Chris Buechler over 9 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF