Documentation
¶
Overview ¶
Package defaultroute contains helpers for looking up system network interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRouteInterface ¶
DefaultRouteInterface is like DefaultRoute but only returns the interface name.
Types ¶
type DefaultRouteDetails ¶
type DefaultRouteDetails struct { // InterfaceName is the interface name. It must always be populated. // It's like "eth0" (Linux), "Ethernet 2" (Windows), "en0" (macOS). InterfaceName string // InterfaceDesc is populated on Windows at least. It's a // longer description, like "Red Hat VirtIO Ethernet Adapter". InterfaceDesc string // InterfaceIndex is like net.Interface.Index. // Zero means not populated. InterfaceIndex int }
DefaultRouteDetails are the details about a default route returned by DefaultRoute.
func DefaultRoute ¶
func DefaultRoute() (DefaultRouteDetails, error)
DefaultRoute returns details of the network interface that owns the default route, not including any tailscale interfaces.
Click to show internal directories.
Click to hide internal directories.