The networking module for Windows based systems
Disable an interface
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.disable 'Local Area Connection #2'
Enable an interface
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.enable 'Local Area Connection #2'
Return configs for all interfaces
CLI Example:
salt -G 'os_family:Windows' ip.get_all_interfaces
Set DNS source to DHCP on Windows
CLI Example:
salt -G 'os_family:Windows' ip.get_default_gateway
Return the configuration of a network interface
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.get_interface 'Local Area Connection'
Convenience function to convert the netmask to the CIDR subnet length
mask (str) -- A netmask
CLI Example:
salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0
Returns True if interface is disabled, otherwise False
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.is_disabled 'Local Area Connection #2'
Returns True if interface is enabled, otherwise False
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.is_enabled 'Local Area Connection #2'
Return raw configs for all interfaces
CLI Example:
salt -G 'os_family:Windows' ip.raw_interface_configs
Set both IP Address and DNS to DHCP
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.set_dhcp_all 'Local Area Connection'
Set DNS source to DHCP on Windows
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.set_dhcp_dns 'Local Area Connection'
Set Windows NIC to get IP from DHCP
iface (str) -- The name of the interface to manage
CLI Example:
salt -G 'os_family:Windows' ip.set_dhcp_ip 'Local Area Connection'
Set static DNS configuration on a Windows NIC
A dictionary containing the new DNS settings
CLI Example:
salt -G 'os_family:Windows' ip.set_static_dns 'Local Area Connection' '192.168.1.1'
salt -G 'os_family:Windows' ip.set_static_dns 'Local Area Connection' '192.168.1.252' '192.168.1.253'
Set static IP configuration on a Windows NIC
iface (str) -- The name of the interface to manage
addr (str) -- IP address with subnet length (ex. 10.1.2.3/24). The
ip.get_subnet_length
function can be used to calculate the subnet length from a netmask.
gateway (str, optional) -- If specified, the default gateway will be set to this value.
Default is None.
append (bool, optional) -- If True, this IP address will be added to the interface. Default is
False, which overrides any existing configuration for the interface
and sets addr as the only address on the interface.
Default is False.
CLI Example:
salt -G 'os_family:Windows' ip.set_static_ip 'Local Area Connection' 10.1.2.3/24 gateway=10.1.2.1
salt -G 'os_family:Windows' ip.set_static_ip 'Local Area Connection' 10.1.2.4/24 append=True