Module for gathering and managing network information
Test connectivity to a host using a particular port from the minion.
New in version 2016.3.0.
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
Performs a DNS lookup with dig
Note: dig must be installed on the Windows minion
CLI Example:
salt '*' network.dig archlinux.org
Return routing information for given destination ip
New in version 2016.11.5.
CLI Example:
salt '*' network.get_route 10.10.10.10
Return the hardware address (a.k.a. MAC address) for a given interface
CLI Example:
salt '*' network.hw_addr 'Wireless Connection #1'
This function is an alias of hw_addr
.
Return the hardware address (a.k.a. MAC address) for a given interface
CLI Example:
salt '*' network.hw_addr 'Wireless Connection #1'
Returns True if host is within specified subnet, otherwise False
CLI Example:
salt '*' network.in_subnet 10.0.0.0/16
Return a dictionary of information about all the interfaces on the minion
CLI Example:
salt '*' network.interfaces
Return a list of all the interfaces names
CLI Example:
salt '*' network.interfaces_names
Returns a list of IPv4 addresses assigned to the host.
Only IP addresses from that interface will be returned.
Include loopback 127.0.0.1 IPv4 address.
Describes subnet using CIDR notation and only IPv4 addresses that belong to this subnet will be returned.
Changed in version 2019.2.0.
If option set to 'public' then only public addresses will be returned. Ditto for 'private'.
Changed in version 2019.2.0.
CLI Example:
salt '*' network.ip_addrs
salt '*' network.ip_addrs cidr=10.0.0.0/8
salt '*' network.ip_addrs cidr=192.168.0.0/16 type=private
Returns a list of IPv6 addresses assigned to the host.
Only IP addresses from that interface will be returned.
Include loopback ::1 IPv6 address.
Describes subnet using CIDR notation and only IPv6 addresses that belong to this subnet will be returned.
Changed in version 2019.2.0.
CLI Example:
salt '*' network.ip_addrs6
salt '*' network.ip_addrs6 cidr=2000::/3
This function is an alias of ip_addrs
.
Returns a list of IPv4 addresses assigned to the host.
- interface
Only IP addresses from that interface will be returned.
- include_loopbackFalse
Include loopback 127.0.0.1 IPv4 address.
- cidr
Describes subnet using CIDR notation and only IPv4 addresses that belong to this subnet will be returned.
Changed in version 2019.2.0.
- type
If option set to 'public' then only public addresses will be returned. Ditto for 'private'.
Changed in version 2019.2.0.
CLI Example:
salt '*' network.ip_addrs salt '*' network.ip_addrs cidr=10.0.0.0/8 salt '*' network.ip_addrs cidr=192.168.0.0/16 type=private
This function is an alias of ip_addrs6
.
Returns a list of IPv6 addresses assigned to the host.
- interface
Only IP addresses from that interface will be returned.
- include_loopbackFalse
Include loopback ::1 IPv6 address.
- cidr
Describes subnet using CIDR notation and only IPv6 addresses that belong to this subnet will be returned.
Changed in version 2019.2.0.
CLI Example:
salt '*' network.ip_addrs6 salt '*' network.ip_addrs6 cidr=2000::/3
Check if the given IP address is a private address
New in version 2019.2.0.
CLI Example:
salt '*' network.is_private 10.0.0.3
Return information on open ports and states
CLI Example:
salt '*' network.netstat
Query DNS for information about a domain or ip address
CLI Example:
salt '*' network.nslookup archlinux.org
Performs a ping to a host
CLI Example:
salt '*' network.ping archlinux.org
New in version 2016.11.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 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