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 PrevIP(ip net.IP) net.IP
- func RandomVethName() (string, error)
- func SetupIPMasq(ipn *net.IPNet, chain string, comment string) error
- func SetupVeth(contVethName string, mtu int, hostNS *os.File) (hostVeth, contVeth netlink.Link, err error)
- func TeardownIPMasq(ipn *net.IPNet, chain string, comment string) error
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 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 ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.