Class: Facter::Util::Linux::RoutingTable

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/util/linux/routing_table.rb

Constant Summary collapse

ROUTE_TYPES =
%w[anycast
unicast
broadcast
local
nat
unreachable
prohibit
blackhole
throw].freeze

Class Method Summary collapse

Class Method Details

.read_routing_table(logger) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/facter/util/linux/routing_table.rb', line 18

def read_routing_table(logger)
  ipv4_output = Facter::Core::Execution.execute('ip route show', logger: logger)
  ipv6_output = Facter::Core::Execution.execute('ip -6 route show', logger: logger)
  routes4 = parse_routes(ipv4_output, true)
  routes6 = parse_routes(ipv6_output, false)
  [routes4, routes6]
end