-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defaultroute-metric doesn't add a new route even if metrics are different #357
Comments
Do you miss any information that I can provide you? |
I suppose it depends on what you are trying to achieve. The message Is logged when a default route already exist, and you are trying to configure the default gateway, and the new gateway isn't the same as the old gateway. Have you tried adding the option "replacedefaultroute"? This would force replacing the default route regardless. |
Again, it would be helpful here if you provided some more context by providing more info on your environment and what you are trying to do. Think of it as I need to be able to setup a similar environment and reproduce the issue you are having. |
Hello! I don't want to replace the default route. I want to have a second one with a different metric which is what the option "defaultroute-metric" is for I believe. From the man page :
The PPP interface is a satellite link (high delay, low bandwidth, high cost). I am trying to setup a "least-cost routing" system where going through Ethernet is the preferred option (metric 50) but if it goes down, I still want the PPP default route to exist as a fallback (with metric 300). I am using pppd version 2.4.9 installed using apt in a docker container (base image python:3.10). The docker container is launched using "--network host" and "--privileged" options. Adding or removing routes is possible using ip-up/ip-down scripts but I was wondering why it didn't work using "defaultroute-metric" option. |
I include
The routes do install:
|
I can confirm the problem, we've run into this as well. Many of our setups have a primary fibre link using pppoe and then a backup LTE (separate router and we get DHCP from that), and if the fibre goes down whilst the LTE is up, when pppd restores it won't add default route even though the metrics are very explicitly set to different values. |
@paulusmack, @enaess: Have you seen all comments? |
Should probably also be fixed for #460 (2.5.1 release). |
There are currently four options related to default routes: defaultroute The description of defaulroute-metric clearly states: "if there is no other default route with the same metric." Looking at the "defaultroute_exists()" function it does indeed compare the metric, however, the invocation in sifdefaultroute() doesn't ask it to look at a specific metric. Instead of passing -1 as the second argument unconditionally, should we not pass dfl_route_metric (+1 if dfl_route_metric >= 0) here? Ie,
As the second argument, or possibly just handle the +1 situation in defaultroute_exists function? |
Oh, the reason for mentioning the whole lot of options is that v4 and v6 is again handled differently here ... should they be brought into alignment? |
@ncopa, @rogers0, @sthibaul, @bootc, @rfc1036, @Firefishy, @madhatter0, @pali, @uschindler: What do you think? |
IPv4 and IPv6 should work the same way. |
For instance, when using a ppp link as backup link, one would want to add a default route on the ppp link, in *addition* to the existing default route. d0ccb87 ("pppd: Add replacedefaultroute option (ppp-project#200)") however broke this case: sifdefaultroute was not passing the metric to defaultroute_exists any more. This commit restores this case. Fixes ppp-project#357
For instance, when using a ppp link as backup link, one would want to add a default route on the ppp link, in *addition* to the existing default route. d0ccb87 ("pppd: Add replacedefaultroute option (ppp-project#200)") however broke this case: sifdefaultroute was not passing the metric to defaultroute_exists any more. This commit restores this case. Fixes ppp-project#357 Signed-off-by: Samuel Thibault <[email protected]>
Thanks @rfc1036 and @sthibaul for your quick answer and the quick PR! @apompee, @jimdigriz: Can you test the @sthibaul PR? |
@Neustradamus sorry, I no longer have multi-homing |
@jimdigriz: Thanks for your answer, we wait a comeback from @apompee... |
Why did you mention me in this specific issue? I was active in early times regarding |
I made some comments on the PR itself. The more I think about this both the existing as well as documented behaviour (which is in my opinion not well defined) is wrong. Do we discuss that on the PR or here? |
@sthibaul @Neustradamus I just tried the PR and the second default route is now created properly with the specified metric. |
Sorry, used a different account on previous message. |
@uschindler: I have added you because you have done a comment 2023-07-23 here: @jkroonza: Thanks for your comment, @sthibaul: What do you think? @apompee: No problem, thanks for your test and your confirmation of success :) |
For instance, when using a ppp link as backup link, one would want to add a default route on the ppp link, in *addition* to the existing default route. d0ccb87 ("pppd: Add replacedefaultroute option (#200)") however broke this case: sifdefaultroute was not passing the metric to defaultroute_exists any more. This commit restores this case. Fixes #357 Signed-off-by: Samuel Thibault <[email protected]>
I have the following default route :
I am trying to set up a second default route through ppp (version 2.4.9) with higher metric (300) using defaultroute and defaultroute-metric options.
Here are the options of pppd :
But I get an error telling me it is trying to replace the default route :
Have I misunderstood the defaultroute-metric option?
The text was updated successfully, but these errors were encountered: