Module for gathering and managing network information
Return a dict containing information on all of the running TCP connections
CLI Example:
salt '*' network.active_tcp
Return the arp table from the minion
CLI Example:
salt '*' network.arp
Test connectivity to a host using a particular port from the minion.
New in version 2014.7.
CLI Example:
salt '*' network.connect archlinux.org 80
salt '*' network.connect archlinux.org 80 timeout=3
salt '*' network.connect archlinux.org 80 timeout=3 family=ipv4
salt '*' network.connect google-public-dns-a.google.com port=53 proto=udp timeout=3
Return default route(s) from routing table
CLI Example:
salt '*' network.default_route
Performs a DNS lookup with dig
CLI Example:
salt '*' network.dig archlinux.org
Return network buffer sizes as a dict
CLI Example:
salt '*' network.getbufsize
Get hostname
CLI Example:
salt '*' network.get_hostname
Return the hardware address (a.k.a. MAC address) for a given interface
CLI Example:
salt '*' network.hw_addr eth0
Return the hardware address (a.k.a. MAC address) for a given interface
CLI Example:
salt '*' network.hw_addr eth0
Returns True if host is within specified subnet, otherwise False.
CLI Example:
salt '*' network.in_subnet 10.0.0.0/16
Return the inet address for a given interface
New in version 2014.7.
CLI Example:
salt '*' network.interface eth0
Return the inet address for a given interface
New in version 2014.7.
CLI Example:
salt '*' network.interface_ip eth0
Return a dictionary of information about all the interfaces on the minion
CLI Example:
salt '*' network.interfaces
Returns a list of IPv4 addresses assigned to the host. 127.0.0.1 is ignored, unless 'include_loopback=True' is indicated. If 'interface' is provided, then only IP addresses from that interface will be returned. Providing a CIDR via 'cidr="10.0.0.0/8"' will return only the addresses which are within that subnet.
CLI Example:
salt '*' network.ip_addrs
Returns a list of IPv6 addresses assigned to the host. ::1 is ignored, unless 'include_loopback=True' is indicated. If 'interface' is provided, then only IP addresses from that interface will be returned.
CLI Example:
salt '*' network.ip_addrs6
Returns True if given IP is within specified subnet, otherwise False.
CLI Example:
salt '*' network.ip_in_subnet 172.17.0.4 172.16.0.0/12
Returns a list of IPv4 addresses assigned to the host. 127.0.0.1 is ignored, unless 'include_loopback=True' is indicated. If 'interface' is provided, then only IP addresses from that interface will be returned. Providing a CIDR via 'cidr="10.0.0.0/8"' will return only the addresses which are within that subnet.
CLI Example:
salt '*' network.ip_addrs
Returns a list of IPv6 addresses assigned to the host. ::1 is ignored, unless 'include_loopback=True' is indicated. If 'interface' is provided, then only IP addresses from that interface will be returned.
CLI Example:
salt '*' network.ip_addrs6
Check if the given IP address is a loopback address
New in version 2014.7.0.
CLI Example:
salt '*' network.is_loopback 127.0.0.1
Check if the given IP address is a private address
New in version 2014.7.0.
CLI Example:
salt '*' network.is_private 10.0.0.3
Modify network interface buffers (currently linux only)
CLI Example:
salt '*' network.getBuffers
Modify hostname
CLI Example:
salt '*' network.mod_hostname master.saltstack.com
Return information on open ports and states
Note
On BSD minions, the output contains PID info (where available) for each netstat entry, fetched from sockstat/fstat output.
Changed in version 2014.1.4: Added support for OpenBSD, FreeBSD, and NetBSD
CLI Example:
salt '*' network.netstat
Performs a ping to a host
CLI Example:
salt '*' network.ping archlinux.org
New in version 2015.5.0.
Return a True or False instead of ping output.
salt '*' network.ping archlinux.org return_boolean=True
Set the time to wait for a response in seconds.
salt '*' network.ping archlinux.org timeout=3
Returns the reversed IP address
CLI Example:
salt '*' network.reverse_ip 172.17.0.4
Return currently configured routes from routing table
CLI Example:
salt '*' network.routes
Returns a list of subnets to which the host belongs
CLI Example:
salt '*' network.subnets
Performs a traceroute to a 3rd party host
CLI Example:
salt '*' network.traceroute archlinux.org
Send Wake On Lan packet to a host
CLI Example:
salt '*' network.wol 08-00-27-13-69-77
salt '*' network.wol 080027136977 255.255.255.255 7
salt '*' network.wol 08:00:27:13:69:77 255.255.255.255 7
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2015.5.1