Documentation
¶
Overview ¶
Package device provides utilities for querying device information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGateway ¶
DefaultGateway returns network interface used as default gateway.
Linux generally has only a single default gateway. Although it can have more than one default gateway by using routing tables, only one is allowed per routing table.
func ListPhysical ¶
ListPhysical network interfaces found on the system.
All Linux systems have physical interfaces with one exception - containers. When system is properly virtualized, guest does not know that it is virtual so even though those interfaces are mapped to virtual interfaces on the host, guest does not know this, but containers know. This is because the kernel is shared between the host and the guest.
If the system has only virtual interfaces, return a virtual interface which is used as default gateway.