Command Customization

hyperglass comes with built in support for the following platforms:

  • Cisco IOS & IOS-XE
  • Cisco IOS-XR
  • Juniper JunOS
  • Arista EOS
  • Huawei VRP
  • VyOS

::: warning VyOS & VRFs As of vyos-1.3-rolling-202007050117 which is the latest release VyOS has been tested with hyperglass, VyOS does not support BGP or other dynamic routing protocols in a VRF. As such, the default BGP commands for VyOS omit the VRF from the command. :::

Default commands for each of these network operating systems are built into hyperglass. However, you may override any of them or even add commands for another Network Operating System (NOS), as long as it's supported. To define custom commands, add a commands.yaml file to your installation directory (/etc/hyperglass, ~/hyperglass). As an example, you could override the default Juniper bgp_route command for the default routing table like this:

juniper:
ipv4_default:
bgp_route: "show route protocol bgp {target} terse"

Only the command you specify will be overridden.

Command Types

Each command definition carries the following structure:

commands.yaml
command_name:
ipv4_default: ...
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...
ipv6_default:
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...
ipv4_vpn:
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...
ipv6_vpn:
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...

ipv4_default and ipv6_default reference the commands used in the default routing table/VRF, while ipv4_vpn and ipv6_vpn reference the commands used in any configured VRF. Every command will have the following keywords replaced:

KeywordDescription
{target}Query Target (IP address, community, AS Path).
{vrf}If it's a VRF query, the name of the VRF.

Defining Custom Commands

You can also define your own arbitrary command groups, and reference them in your devices.yaml file. For example, if you wanted define a set of commands for a specific device to use, you could do it like this:

---
special_commands:
ipv4_default:
bgp_route: "show ip route {target}"
ipv4_vpn:
bgp_route: "show ip route {target} vrf {vrf}"

The above example defines the command set.

important

You must define all commands, even if they're disabled in your configuration.

Then, in the device's definition in devices.yaml, reference the command set:

---
routers:
- name: specialrouter01
commands: special_commands