Article 5GRGR How to find upstream gateway?

How to find upstream gateway?

by
jmgibson1981
from LinuxQuestions.org on (#5GRGR)
https://gitlab.com/jmgibson1981/scri.../server/router

Been working on this script for dual wan. I had tried OPNSense but that failed out bad on me. I think I've got this working quite well but I have one issue.

Lines 107 - 111 require manual entry. Is there a way I can extract the upstream gateway ip for these or are they stuck being a manual affair? I can get it easy with tracert on Windows but that does me very little good on a linux machine lol.

*EDIT* Replaced link with gitlab instead of a paste.latest?d=yIl2AUoC8zA latest?i=efLp7gyzV9U:etlhvvIDUTc:F7zBnMy latest?i=efLp7gyzV9U:etlhvvIDUTc:V_sGLiP latest?d=qj6IDK7rITs latest?i=efLp7gyzV9U:etlhvvIDUTc:gIN9vFwefLp7gyzV9U
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments