thatmattlove / hyperglass

hyperglass is the network looking glass that tries to make the internet better.
https://hyperglass.dev
BSD 3-Clause Clear License
626 stars 94 forks source link

v2.0.0 Vyos version platforms #245

Open ethamitc opened 5 months ago

ethamitc commented 5 months ago

Feature Description

Currently in Hyperglass, theirs 1 directive for VyOS, However between the versions of VyOS (1.3, 1.4, 1.5) the command formats change. It would be nice to specify the version of VyOS and allow hyperglass to use the commands applicable to that version.

Eg. devices.yaml

platform: vyos_1.3

Is your feature request related to a problem? Please describe.

By default, if you are not running the version of VyOS the commands we're build for, commands will fail. This wasn't a huge issue for me as I was able to just modify the vyos directive files and rebuild, but I feel like the user should be able to specify and just have it work.

thatmattlove commented 4 months ago

Hello,

Glad you were able to work around this by using the custom directives method. I would be happy to add support for other versions of VyOS, I just need the commands for each of the command types defined in built-in directives:

  1. BGP Route (v4 & v6)
  2. BGP AS Path
  3. BGP Community
  4. Ping (v4 & v6)
  5. Traceroute (v4 & v6)

If you can provide these for each of the versions where they differ, I should be able to add native support.

Thanks!

ServerForge commented 4 months ago

I have not messed with 1.3 in quite awhile, i can dig up the syntax for it later, But this is the syntax i for VyOS 1.4 in the commands.yml, vrf should be "default" for the default vrf. 1.5 should be the same as 1.4 right now, but 1.5 could change later on but i wouldn't expect it to.

  ipv4_default:
    bgp_route: "show bgp vrf {vrf} ipv4 {target}"
    bgp_aspath: "show bgp vrf {vrf} ipv4 regexp {target}"
    bgp_community: "show bgp vrf {vrf} ipv4 community {target}"
    ping: "ping {target} vrf {vrf} source-address {source} count 5"
    traceroute: "traceroute {target} vrf {vrf} source-address {source}"

  ipv6_default:
    bgp_route: "show bgp vrf {vrf} ipv6 {target}"
    bgp_aspath: "show bgp vrf {vrf} ipv6 regexp {target}"
    bgp_community: "show bgp vrf {vrf} ipv6 community {target}"
    ping: "ping {target} vrf {vrf} source-address {source} count 5"
    traceroute: "traceroute {target} vrf {vrf} source-address {source}"
ServerForge commented 4 months ago

On 1.3

Similar to 1.4 as the default vrf is just "default", but the VRF support on 1.3 is very limited and does not work with dynamic protocols (BGP, OSPF, ect), only static/connected routes. I do think someone may have a niche use for having VRF support for ping and traceroute on 1.3, if you don't want to do that just remove "vrf " from the commands. 1.4 is already in early production access and will become the go to LTS image soon, but 1.3 will have supported LTS images for a long time in conjunction with 1.4.

show ip bgp x.x.x.x/x
show ipv6 bgp x::x/x

show ip bgp regexp <expression>
show ipv6 bgp regexp <expression>

show ip bgp community <community>
show ipv6 bgp community <community>

ping x.x.x.x vrf <insert vrf here>
ping x::x vrf <insert vrf here>

traceroute vrf <insert vrf here> x.x.x.x
traceroute vrf <insert vrf here> x::x