salt.modules.ipset
Support for ipset
-
Append an entry to the specified set.
CLI Example:
salt '*' ipset.add setname 192.168.1.26 salt '*' ipset.add setname 192.168.0.3,AA:BB:CC:DD:EE:FF
salt.modules.ipset.add(setname=None, entry=None, family='ipv4', **kwargs)
-
Check that an entry exists in the specified set.
- set
-
The ipset name
- entry
-
An entry in the ipset. This parameter can be a single IP address, a range of IP addresses, or a subnet block. Example:
192.168.0.1 192.168.0.2-192.168.0.19 192.168.0.0/25
- family
-
IP protocol version: ipv4 or ipv6
CLI Example:
salt '*' ipset.check setname '192.168.0.1 comment "Hello"'
salt.modules.ipset.check(set=None, entry=None, family='ipv4')
-
Check that given ipset set exists.
New in version 2014.7.0.
CLI Example:
salt '*' ipset.check_set setname
salt.modules.ipset.check_set(set=None, family='ipv4')
-
Delete an entry from the specified set.
CLI Example:
salt '*' ipset.delete setname 192.168.0.3,AA:BB:CC:DD:EE:FF
salt.modules.ipset.delete(set=None, entry=None, family='ipv4', **kwargs)
-
New in version 2014.7.0.
Delete ipset set.
CLI Example:
salt '*' ipset.delete_set custom_set IPv6: salt '*' ipset.delete_set custom_set family=ipv6
salt.modules.ipset.delete_set(set=None, family='ipv4')
-
Flush entries in the specified set, Flush all sets if set is not specified.
CLI Example:
salt '*' ipset.flush salt '*' ipset.flush set IPv6: salt '*' ipset.flush salt '*' ipset.flush set
salt.modules.ipset.flush(set=None, family='ipv4')
-
New in version 2014.7.0.
List all ipset sets.
CLI Example:
salt '*' ipset.list_sets
salt.modules.ipset.list_sets(family='ipv4')
-
New in version 2014.7.0.
Create new custom set
CLI Example:
salt '*' ipset.new_set custom_set list:set salt '*' ipset.new_set custom_set list:set comment=True IPv6: salt '*' ipset.new_set custom_set list:set family=ipv6
salt.modules.ipset.new_set(set=None, set_type=None, family='ipv4', comment=False, **kwargs)
-
New in version 2014.7.0.
Delete ipset set.
CLI Example:
salt '*' ipset.rename_set custom_set new_set=new_set_name IPv6: salt '*' ipset.rename_set custom_set new_set=new_set_name family=ipv6
salt.modules.ipset.rename_set(set=None, new_set=None, family='ipv4')
-
Test if an entry is in the specified set.
CLI Example:
salt '*' ipset.test setname 192.168.0.2 IPv6: salt '*' ipset.test setname fd81:fc56:9ac7::/48
salt.modules.ipset.test(set=None, entry=None, family='ipv4', **kwargs)
-
Return version from ipset --version
CLI Example:
salt '*' ipset.version
salt.modules.ipset.version()
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.ipset.html