DHCP relay



  • DHCP relay service will not start. Running Sept 14, 2020 dev build and DHCrelay works. Update to latest build and DHCrelay stops working. Not sure what info is needed. I've installed Build Sept 14, 2020 in a VM to verify that it works and stops working after updating to latest build. DHCrelay can be started manually from the command line using full syntax. Can stop with GUI via services and will not restart.



  • @BeingMoody2 Check the logs, system and dhcp for clues.



  • Also seeing this issue, nothing in the logs to indicate the service even tried to start.

    2.5.0-DEVELOPMENT (amd64)
    built on Mon Sep 28 07:01:24 EDT 2020
    FreeBSD 12.2-PRERELEASE

    Edit 2:
    Found this in the system log:
    /services_dhcp_relay.php: No suitable upstream interfaces found for running dhcrelay!

    I have DHCP relay configured on 2 VLAN interfaces for my WiFi networks.



  • The error "No suitable upstream interfaces found for running dhcrelay!" seems to come from the function guess_interface_from_ip($ipaddress) not returning a valid interface for whatever reason. I've yet to track the changes to see what borked it.

    Edit 1:
    guess_interface_from_ip($ipaddress) return $false because route_get($ipaddress) returns array(0) for my LAN network.. the investigation continues..

    php > var_dump(route_get('192.168.11.1'));
    array(1) {
      [0]=>
      array(7) {
        ["destination"]=>
        string(12) "192.168.11.1"
        ["gateway"]=>
        string(6) "link#2"
        ["flags"]=>
        string(3) "UHS"
        ["flags_pretty"]=>
        array(3) {
          [0]=>
          string(2) "up"
          [1]=>
          string(4) "host"
          [2]=>
          string(6) "static"
        }
        ["use"]=>
        int(0)
        ["mtu"]=>
        int(16384)
        ["interface-name"]=>
        string(3) "lo0"
      }
    }
    php > var_dump(route_get('192.168.11.18'));
    array(0) {
    }
    

    Edit2:

    This code should probably handle subnets? 192.168.11.18 is in the 192.168.11.0/24 subnet which there is a route for, but the code just checks if the destination matches.

    $result = array();
    	foreach ($rtable[$family] as $item) {
    		if ($item['destination'] == $target) {
    			$result[] = $item;
    		}
    	}
    

    https://github.com/pfsense/pfsense/commit/c428cdf436cc9e407e64fd550be96bb0ecad3fb3#diff-d45d58361f1c16219dd36fc4951f76db



  • Today Oct 14,2020 updated to latest dev build.
    2.5.0-DEVELOPMENT (amd64)
    built on Wed Oct 14 07:02:29 EDT 2020
    dhcrelay now works correctly without needing any additional work arounds. Not sure what changed from Sept 14th to Oct 14th.


Log in to reply