fabtools.network

Network

fabtools.network.interfaces()[source]

Get the list of network interfaces. Will return all datalinks on SmartOS.

fabtools.network.address(interface)[source]

Get the IPv4 address assigned to an interface.

Example:

import fabtools

# Print all configured IP addresses
for interface in fabtools.network.interfaces():
    print(fabtools.network.address(interface))
fabtools.network.nameservers()[source]

Get the list of nameserver addresses.

Example:

import fabtools

# Check that all name servers are reachable
for ip in fabtools.network.nameservers():
    run('ping -c1 %s' % ip)