salt.modules.win_network

Module for gathering and managing network information

salt.modules.win_network.connect(host, port=None, **kwargs)

Test connectivity to a host using a particular port from the minion.

2016.3.0 新版功能.

CLI 范例:

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
salt.modules.win_network.dig(host)

Performs a DNS lookup with dig

Note: dig must be installed on the Windows minion

CLI 范例:

salt '*' network.dig archlinux.org
salt.modules.win_network.hw_addr(iface)

Return the hardware address (a.k.a. MAC address) for a given interface

CLI 范例:

salt '*' network.hw_addr 'Wireless Connection #1'
salt.modules.win_network.hwaddr(iface)

This function is an alias of hw_addr.

Return the hardware address (a.k.a. MAC address) for a given interface

CLI 范例:

salt '*' network.hw_addr 'Wireless Connection #1'
salt.modules.win_network.in_subnet(cidr)

Returns True if host is within specified subnet, otherwise False

CLI 范例:

salt '*' network.in_subnet 10.0.0.0/16
salt.modules.win_network.interfaces()

Return a dictionary of information about all the interfaces on the minion

CLI 范例:

salt '*' network.interfaces
salt.modules.win_network.interfaces_names()

Return a list of all the interfaces names

CLI 范例:

salt '*' network.interfaces_names
salt.modules.win_network.ip_addrs(interface=None, include_loopback=False)

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.

CLI 范例:

salt '*' network.ip_addrs
salt.modules.win_network.ip_addrs6(interface=None, include_loopback=False)

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 范例:

salt '*' network.ip_addrs6
salt.modules.win_network.ipaddrs(interface=None, include_loopback=False)

This function is an alias of ip_addrs.

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.

CLI 范例:

salt '*' network.ip_addrs
salt.modules.win_network.ipaddrs6(interface=None, include_loopback=False)

This function is an alias of ip_addrs6.

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 范例:

salt '*' network.ip_addrs6
salt.modules.win_network.netstat()

Return information on open ports and states

CLI 范例:

salt '*' network.netstat
salt.modules.win_network.nslookup(host)

Query DNS for information about a domain or ip address

CLI 范例:

salt '*' network.nslookup archlinux.org
salt.modules.win_network.ping(host)

Performs a ping to a host

CLI 范例:

salt '*' network.ping archlinux.org
salt.modules.win_network.subnets()

Returns a list of subnets to which the host belongs

CLI 范例:

salt '*' network.subnets
salt.modules.win_network.traceroute(host)

Performs a traceroute to a 3rd party host

CLI 范例:

salt '*' network.traceroute archlinux.org