Module: MKIt::InterfaceHelper

Defined in:
lib/mkit/app/helpers/interface_helper.rb

Class Method Summary collapse

Class Method Details

.create(name:, ctype:) ⇒ Object



4
5
6
# File 'lib/mkit/app/helpers/interface_helper.rb', line 4

def create(name:, ctype:)
  %x{ip tuntap add mode #{ctype} #{name}}
end

.down(name:) ⇒ Object



13
14
15
# File 'lib/mkit/app/helpers/interface_helper.rb', line 13

def down(name:)
  %x{ifconfig #{name} 0.0.0.0 down}
end

.remove(name:, ctype:) ⇒ Object



7
8
9
# File 'lib/mkit/app/helpers/interface_helper.rb', line 7

def remove(name:, ctype:)
  %x{ip tuntap del mode #{ctype} #{name}}
end

.up(name:, ip:, mask:) ⇒ Object



10
11
12
# File 'lib/mkit/app/helpers/interface_helper.rb', line 10

def up(name:, ip:, mask:)
  %x{ifconfig #{name} #{ip}/#{mask} up}
end