Skip to main content

List

List all routes in the kernel routing table on a target host:

$ osapi client node network route list --target web-01

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME STATUS DESTINATION GATEWAY INTERFACE METRIC
web-01 ok 0.0.0.0/0 192.168.1.1 eth0 100
web-01 ok 10.0.0.0/8 192.168.1.1 eth0 0
web-01 ok 192.168.1.0/24 0.0.0.0 eth0 0

1 host: 1 ok

Target all hosts to list routes across the fleet:

$ osapi client node network route list --target _all

Job ID: 550e8400-e29b-41d4-a716-446655440000

HOSTNAME STATUS DESTINATION GATEWAY INTERFACE METRIC
web-01 ok 0.0.0.0/0 192.168.1.1 eth0 100
web-01 ok 192.168.1.0/24 0.0.0.0 eth0 0
web-02 ok 0.0.0.0/0 10.0.0.1 eth0 100
web-02 ok 10.0.0.0/24 0.0.0.0 eth0 0

2 hosts: 2 ok

JSON Output

Use --json to get the full API response:

$ osapi client node network route list --target web-01 --json
{"results":[{"hostname":"web-01","status":"ok","routes":[
{"destination":"0.0.0.0/0","gateway":"192.168.1.1",
"interface":"eth0","metric":100}
]}],"job_id":"..."}

Flags

FlagDescriptionDefault
-T, --targetTarget: _any, _all, hostname, or label (group:web)_any
-j, --jsonOutput raw JSON response