New in version 2014.1.0: (Hydrogen)
This module provides the network state(s) on Windows hosts. DNS servers, IP addresses and default gateways can currently be managed.
Below is an example of the configuration for an interface that uses DHCP for both DNS servers and IP addresses:
Local Area Connection #2:
network.managed:
- dns_proto: dhcp
- ip_proto: dhcp
Note
Both the dns_proto and ip_proto arguments are required.
Static DNS and IP addresses can be configured like so:
Local Area Connection #2:
network.managed:
- dns_proto: static
- dns_servers:
- 8.8.8.8
- 8.8.4.4
- ip_proto: static
- ip_addrs:
- 10.2.3.4/24
Note
IP addresses are specified using the format <ip-address>/<subnet-length>. Salt provides a convenience function called ip.get_subnet_length to calculate the subnet length from a netmask.
Optionally, if you are setting a static IP address, you can also specify the default gateway using the gateway parameter:
Local Area Connection #2:
network.managed:
- dns_proto: static
- dns_servers:
- 8.8.8.8
- 8.8.4.4
- ip_proto: static
- ip_addrs:
- 10.2.3.4/24
- gateway: 10.2.3.1
Ensure that the named interface is configured properly.
Current Salt release: 2014.1.6
Docs for previous releases on salt.rtfd.org.