Class: Specinfra::Command::Freebsd::V11::Interface

Inherits:
Base::Interface show all
Defined in:
lib/specinfra/command/freebsd/v11/interface.rb

Class Method Summary collapse

Methods inherited from Base::Interface

check_exists, check_has_ipv4_address, check_has_ipv6_address, get_link_state, get_mtu_of, get_speed_of

Methods inherited from Base

create, escape

Class Method Details

.get_ipv4_address(interface) ⇒ Object



3
4
5
# File 'lib/specinfra/command/freebsd/v11/interface.rb', line 3

def get_ipv4_address(interface)
  "ifconfig -f inet:cidr #{interface} inet | awk '/inet /{print $2}'"
end

.get_ipv6_address(interface) ⇒ Object



7
8
9
# File 'lib/specinfra/command/freebsd/v11/interface.rb', line 7

def get_ipv6_address(interface)
  "ifconfig -f inet6:cidr #{interface} inet6 | awk '/inet6 /{print $2}' | tail -1"
end