Loss of internet access and OPNSense reachability

Started by Mr.Goodcat, February 13, 2017, 07:45:12 PM

Previous topic - Next topic
OK, fixed it.

As written a few posts ago I made some changes in the dhclient.c file:
https://github.com/opnsense/src/blob/master/sbin/dhclient/dhclient.c

Here is the function which contains my change to actually make the "supersede dhcp-server-identifier 255.255.255.255" line work:


void
state_bound(void *ipp)
{
struct interface_info *ip = ipp;

ASSERT_STATE(state, S_BOUND);

/* T1 has expired. */
make_request(ip, ip->client->active);
ip->client->xid = ip->client->packet.xid;

/* Start of the updated section. */


if (ip->client->config->default_actions[DHO_DHCP_SERVER_IDENTIFIER] == ACTION_SUPERSEDE) {
memcpy(ip->client->destination.iabuf, ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].data, 4);
ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].len = 4;
} else if (ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].len == 4) {
memcpy(ip->client->destination.iabuf, ip->client->active->
    options[DHO_DHCP_SERVER_IDENTIFIER].data, 4);
ip->client->destination.len = 4;
} else
ip->client->destination = iaddr_broadcast;


/* End of the updated section */


ip->client->first_sending = cur_time;
ip->client->interval = ip->client->config->initial_interval;
ip->client->state = S_RENEWING;

/* Send the first packet immediately. */
send_request(ip);
}


After compiling dhclient from your git under FreeBSD the option works and dhclient sends renew requests via broadcast as it should. This finally gets the DHCP behind the relay to update the lease ahead of expiry.

@Franco or any other OPN dev: can you please verify this and include it in the next point release? Or even better, submit it to upstream? Thanks!


Now the remaining question is why the connection between WAN and the LAN bridge is lost if the WAN lease expires. If that could also get fixed I'd at last be able to deploy OPN more widely.

Hi Fabian,

Working on this now... Is this your patch or was this derived from e.g. OpenBSD's version?

Is there anything else we need to do here or will patching dhclient suffice to fix the use case?


Thanks,
Franco


Ok, the MTU parts didn't build and I have aligned the code to this in order to allow the sanity check to be executed in both cases, which matches a similar block found in priv_script_write_params():

https://github.com/opnsense/src/commit/702ff9b912

If you could test this and let me know it works we can merge this. :)


Cheers,
Franco


January 27, 2018, 11:21:20 AM #20 Last Edit: January 27, 2018, 10:00:15 PM by opnsense_user12123
Im using a cable Modem too. In the current version 17.7.12 this problem still exisits.
I have no problems connecting to opnsense or getting internet connection, but after every wan dhcp renew i get broken pipe rdrtool waiting messages in gateway log. These messages disappear only if i hit the save button on reporting settings rdrtool and appear again after dhcp renew on wan interface. Reinstall rdrtool or disable rdrtool doesnt fix the problem.
Will this be fixed in the new Version (18.1) ?

Thx

Quote from: franco on March 25, 2017, 08:51:17 AM
Me again, so this atomic patch would be it: https://github.com/opnsense/src/commit/d5cb0e5.patch

Didn't track the development of OPN for a while, sorry. Version 18.1 is running fine and renews the WAN IP as it should, thanks to the patch (supersede dhcp-server-identifier 255.255.255.255). Thank you!

Hey Mr.Goodcat,

We've been carrying your proposal for a while now without issues. FreeBSD has not yet reacted to our upstream offer.

In any case: thanks for the feedback!  :)


Cheers,
Franco