Skip to content

Instantly share code, notes, and snippets.

@cathay4t
Last active March 5, 2019 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cathay4t/70b69bda1de0f60ec533bf98fdc04f95 to your computer and use it in GitHub Desktop.
Save cathay4t/70b69bda1de0f60ec533bf98fdc04f95 to your computer and use it in GitHub Desktop.
{
"routes": [ # Sorted with 'family', 'table-id' then 'destination'
{
"status": "up", # Set 'absent' to remove routes
"family": "ipv4",
# When applying state, this could be ignored, will guss it out
# base on 'destination' format.
"table-name": "main", # Empty if no name attached
"table-id": 254,
"origin": "dhcp", # "static" or "dhcp"
"metric": 100,
"destination": "0.0.0.0/0", # Mandatory
"next-hop-iface": "eth0", # Mandatory
"next-hop-address": "192.0.2.1"
# ^ Empty on point-to-point link
},
{
"status": "up", # Set 'absent' to remove routes
"family": "ipv6",
# When applying state, this could be ignored, will guss it out
# base on 'destination' format.
"table-name": "main", # Empty if no name attached
"table-id": 254,
"origin": "ipv6-ra", # "static" or "ipv6-ra"
"metric": 100,
"destination": "::/0", # Mandatory
"next-hop-iface": "eth0", # Mandatory
"next-hop-address": "fe80::1"
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment