Skip to content

Add fact for default gateway #260

Description

@sfinke0

Hello everyone,

In preparation for updating a Puppet module to support a custom routing mechanism, I looked for a fact showing the default gateway of a system. However, I could not find one.

On modern Linux systems, the installed routes can be obtained with the following command:

ip --json route | jq
[
 {
   "dst": "default",
   "gateway": "31.47.232.89",
   "dev": "eno1",
   "protocol": "static",
   "flags": []
 },
 {
   "dst": "31.47.232.88/29",
   "dev": "eno1",
   "protocol": "kernel",
   "scope": "link",
   "prefsrc": "31.47.232.90",
   "flags": []
 }
]

Luckily, the JSON format makes working with these routes in Ruby code easy.

Is there any chance of getting this implemented?

Thanks in advance!

Sebastian

cc @rwaffen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions