Documentation ¶
Overview ¶
Package netconfig implements network configuration (interfaces, addresses, firewall rules, …).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCounterObj = &nftables.CounterObj{}
DefaultCounterObj is overridden while testing
Functions ¶
Types ¶
type BridgeDetails ¶
type InterfaceConfig ¶
type InterfaceConfig struct { Interfaces []InterfaceDetails `json:"interfaces"` Bridges []BridgeDetails `json:"bridges"` }
type InterfaceDetails ¶
type InterfaceDetails struct { HardwareAddr string `json:"hardware_addr"` // e.g. dc:9b:9c:ee:72:fd SpoofHardwareAddr string `json:"spoof_hardware_addr"` // e.g. dc:9b:9c:ee:72:fd Name string `json:"name"` // e.g. uplink0, or lan0 Addr string `json:"addr"` // e.g. 192.168.42.1/24 ExtraAddrs []string `json:"extra_addrs"` // e.g. ["192.168.23.1/24"] ExtraRoutes []Route `json:"extra_routes"` MTU int `json:"mtu"` // e.g. 1492 for PPPoE connections // FEC optionally allows configuring forward error correction, e.g. RS for // reed-solomon forward error correction, or Off to disable. // // Some network card and SFP module combinations (e.g. Mellanox ConnectX-4 // with a Flexoptix P.B1625G.10.AD) need to explicitly be configured to use // RS forward error correction, otherwise they won’t link. FEC string `json:"fec"` }
func Interface ¶
func Interface(dir, ifname string) (InterfaceDetails, error)
Interface returns the InterfaceDetails configured for interface ifname in interfaces.json.
Click to show internal directories.
Click to hide internal directories.