Documentation ¶
Index ¶
- func AddDefaultRoute(gw net.IP, dev netlink.Link) error
- func AddHostRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error
- func AddRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error
- func DelLinkByName(ifName string) error
- func DelLinkByNameAddr(ifName string, family int) (*net.IPNet, error)
- func EnableIP4Forward() error
- func EnableIP6Forward() error
- func Network(ipn *net.IPNet) *net.IPNet
- func NextIP(ip net.IP) net.IP
- func ParseCIDR(s string) (*net.IPNet, error)
- func PrevIP(ip net.IP) net.IP
- func RandomVethName() (string, error)
- func SetupIPMasq(ipn *net.IPNet, chain string) error
- func SetupVeth(contVethName string, mtu int, hostNS *os.File) (hostVeth, contVeth netlink.Link, err error)
- func TeardownIPMasq(ipn *net.IPNet, chain string) error
- type IPNet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultRoute ¶
AddDefaultRoute sets the default route on the given gateway.
func AddHostRoute ¶
AddHostRoute adds a host-scoped route to a device.
func DelLinkByName ¶
DelLinkByName removes an interface link.
func DelLinkByNameAddr ¶
DelLinkByNameAddr remove an interface returns its IP address of the specified family
func EnableIP4Forward ¶
func EnableIP4Forward() error
func EnableIP6Forward ¶
func EnableIP6Forward() error
func ParseCIDR ¶
ParseCIDR takes a string like "10.2.3.1/24" and return IPNet with "10.2.3.1" and /24 mask
func RandomVethName ¶
RandomVethName returns string "veth" with random prefix (hashed from entropy)
func SetupIPMasq ¶
SetupIPMasq installs iptables rules to masquerade traffic coming from ipn and going outside of it
Types ¶
Click to show internal directories.
Click to hide internal directories.