Tuntap::Interface
Inherits Reference / Object
Control class for network interfaces
Constants
DEFAULT_METRIC = 100
DEFAULT_MTU = 1500
Default value for the MTU
UNSET_ADDR = "0.0.0.0"
Constructors
new(fd : IO::FileDescriptor, name : String)
SourceClass methods
Instance methods
add_address(address : String) : Nil
Adds an IP address to the interface. For this to work, the interface has to be up.
add_route(destination : String, gateway : String = UNSET_ADDR, mask : String = UNSET_ADDR, metric = DEFAULT_METRIC, mtu = DEFAULT_MTU, window = 0, flags : LibC::RtEntryFlags = LibC::RtEntryFlags::Up)
Adds a network route to this interface. Most arguments are optional.