salt.modules.network

Module for gathering and managing network information

Members

dig

salt.modules.network.dig(host)

Performs a DNS lookup with dig

CLI Example:

salt '*' network.dig archlinux.org

host_to_ip

salt.modules.network.host_to_ip(host)

Returns the IP address of a given hostname

CLI Example:

salt '*' network.host_to_ip example.com

hwaddr

salt.modules.network.hwaddr(interface)

Returns the hwaddr for a given interface

CLI Example:

salt '*' network.hwaddr eth0

interfaces

salt.modules.network.interfaces()

Returns a dictionary of interfaces with various information about each (up/down state, ip address, netmask, and hwaddr)

CLI Example:

salt '*' network.interfaces

ip_to_host

salt.modules.network.ip_to_host(ip)

Returns the hostname of a given IP

CLI Example:

salt '*' network.ip_to_host 8.8.8.8

ipaddr

salt.modules.network.ipaddr(interface=None)

Returns the IP address for a given interface

CLI Example:

salt '*' network.ipaddr eth0

isportopen

salt.modules.network.isportopen(host, port)

Return status of a port

CLI Example:

salt '*' network.isportopen 127.0.0.1 22

netmask

salt.modules.network.netmask(interface)

Returns the netmask for a given interface

CLI Example:

salt '*' network.netmask eth0

netstat

salt.modules.network.netstat()

Return information on open ports and states

CLI Example:

salt '*' network.netstat

ping

salt.modules.network.ping(host)

Performs a ping to a host

CLI Example:

salt '*' network.ping archlinux.org

traceroute

salt.modules.network.traceroute(host)

Performs a traceroute to a 3rd party host

CLI Example:

salt '*' network.traceroute archlinux.org

up

salt.modules.network.up(interface)

Returns True if interface is up, otherwise returns False

CLI Example:

salt '*' network.up eth0

Parent topic

Table Of Contents

Previous topic

salt.modules.mysql

Next topic

salt.modules.nginx