mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
add backend call for ipv6 route display
This commit is contained in:
+4
@@ -121,4 +121,8 @@ class DiagnosticsController extends ApiControllerBase
|
||||
{
|
||||
return $this->get_general_information('routes');
|
||||
}
|
||||
public function generalroutes6Action()
|
||||
{
|
||||
return $this->get_general_information('routes6');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +99,8 @@ class General
|
||||
def initialize(vtysh)
|
||||
@vtysh = vtysh
|
||||
end
|
||||
def routes
|
||||
lines = @vtysh.execute("show ip route").lines
|
||||
def routes(ipv6 = false)
|
||||
lines = @vtysh.execute("show ip#{ipv6 ? 'v6' : ''} route").lines
|
||||
|
||||
# headers
|
||||
meanings = {}
|
||||
@@ -124,6 +124,10 @@ class General
|
||||
end
|
||||
entries
|
||||
end
|
||||
|
||||
def routes6
|
||||
routes(true)
|
||||
end
|
||||
end
|
||||
|
||||
class OSPF
|
||||
@@ -679,9 +683,12 @@ OptionParser.new do |opts|
|
||||
options[:ospfv3_overview] = od
|
||||
end
|
||||
#### general things about routing
|
||||
opts.on("-R", "--general-routes", "Print Routing Table") do |od|
|
||||
opts.on("-R", "--general-routes", "Print Routing Table (IPv4)") do |od|
|
||||
options[:general_routes] = od
|
||||
end
|
||||
opts.on("-6", "--general-routes6", "Print Routing Table (IPv6)") do |od|
|
||||
options[:general_routes6] = od
|
||||
end
|
||||
### BGP
|
||||
opts.on("-B", "--bgp-overview", "Print an overview of BGP") do |od|
|
||||
options[:bgp_overview] = od
|
||||
|
||||
@@ -104,4 +104,10 @@ message: Print OSPF summary
|
||||
command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-routes
|
||||
parameters:
|
||||
type:script_output
|
||||
message: Print Routing Table
|
||||
message: Print IPv4 Routing Table
|
||||
|
||||
[general-routes6]
|
||||
command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-routes6
|
||||
parameters:
|
||||
type:script_output
|
||||
message: Print IPv6 Routing Table
|
||||
|
||||
Reference in New Issue
Block a user