Re: dhcpcd preventing default route being added
Roy Marples
Wed Jun 19 07:26:35 2019
On 19/06/2019 05:05, jobhunts02@xxxxxxx wrote:
I run dhcpcd-7.0.0 with the -G option. The reason I have the -G option is because an older version of dhcpcd was not setting the default gateway correctly. Our device has 2 WAN interfaces and there may be a switch from one interface to another in case of failure. In the past, the default gateway was not being set correctly. If dhcpcd-7.0.0 has corrected this, my problem may be fixed by removing the -G option.
Assuming removing the -G option would not guarantee that dhcpcd would set the default gateway correctly, we have a script that configures the default gateway. Using the route command, the script deletes and then adds the default gateway. This works fine except when I have to restart dhcpcd due to the link state monitor option (-K) being changed. The route command deletes the default gateway but it does not add the default gateway when dhcpcd is restarting.
Is there anything in dhcpcd that would prevent the route command from adding the default gateway while dhcpcd is restarting?
dhcpcd should always Do The Right Thing when it comes to routing.
While there are always bugs, have you tested a later version, such as
dhcpcd-7.2.2? dhcpcd-7.0.0 was the first stable release of the -7 branch
so I would expect some bugs to be found.
With dhcpcd-7 you can strip some options from the DHCP message before
processing. This includes the route option - the downside is that you
cannot exclude a single route from the option.
Try using
--nooption routers
But I would highly recommend trying dhcpcd-7.2.2
If it's still not setting the default route correctly for you, I would
need more information to debug the issue.
Roy
Roy
Archive administrator: postmaster@marples.name