Skip to content
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

Handle more than one default gateway in debug script #4934

Merged
merged 2 commits into from
Sep 25, 2022
Merged

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Sep 22, 2022

What does this PR aim to accomplish?:

Fixes #4933

If more than one default gateway is associated with an interface (usually IPv6) we saved all of them as a single string in gateway and then try to ping this during the debug run. Ping this "address" failed.

Before:

[i] Default IPv4 gateway: 10.0.1.1
   * Pinging 10.0.1.1...
[✓] Gateway responded.
[i] Default IPv6 gateway: fe80::464e:6dff:fecf:5cd8
fe80::464e:6dff:fecf:5cd8
   * Pinging fe80::464e:6dff:fecf:5cd8
fe80::464e:6dff:fecf:5cd8...
ping: fe80::464e:6dff:fecf:5cd8
fe80::464e:6dff:fecf:5cd8: Name or service not known
[✗] Gateway did not respond.

After:

[i] Default IPv4 gateway(s):
     10.0.1.1
   * Pinging first gateway 10.0.1.1...
[✓] Gateway responded.
[i] Default IPv6 gateway(s):
     fe80::464e:6dff:fecf:5cd8
     fe80::464e:6dff:fecf:5cd8
   * Pinging first gateway fe80::464e:6dff:fecf:5cd8...
ping6: Warning: source address might be selected on device other than eth0.
[✓] Gateway responded.
  • How does this PR accomplish the above?:

Create an array containing all the default gateways for one interface and only try to ping the first one.


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser added the PR: Approval Required Open Pull Request, needs approval label Sep 22, 2022
@yubiuser yubiuser requested a review from a team September 22, 2022 20:43
@dschaper
Copy link
Member

Do you think we really need to ping6 addresses? I like the changes for IPv4 but I'm wondering if there is any use to ping IPv6 addresses since they could be LL that don't tell us much and trying to decide what type of IPv6 addresses they are is way to deep in the weeds.

advanced/Scripts/piholeDebug.sh Outdated Show resolved Hide resolved
advanced/Scripts/piholeDebug.sh Outdated Show resolved Hide resolved
@yubiuser
Copy link
Member Author

Users might be on IPv6-only networks. We could check if the device has a GUA address and ping the respective gateway

Signed-off-by: Christian König <ckoenig@posteo.de>
@dschaper
Copy link
Member

We could check if the device has a GUA address and ping the respective gateway

That's the kind of complexity that I'd like to avoid. I can see the rare case that a network may be IPv6 only, I don't know how useful the ping test is in that case (and really in any case) since you need a gateway of some type in order to get the debug log on to tricorder in the first place.

@dschaper dschaper added PR: Approved Open Pull Request, Approved by required number of reviewers and removed PR: Approval Required Open Pull Request, needs approval labels Sep 25, 2022
@dschaper dschaper merged commit f8a1291 into development Sep 25, 2022
@dschaper dschaper deleted the one_gateway branch September 25, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Approved Open Pull Request, Approved by required number of reviewers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

piholeDebug.sh: Network check fails if multiple default gateways are present
3 participants