snippetbashTip
ipset — Create IP sets for firewall rules. More information: <https://manned.org/ipset>.
Viewed 0 times
createcommandsetsipsetclifirewallforrules
linux
Problem
How to use the
ipset command: Create IP sets for firewall rules. More information: <https://manned.org/ipset>.Solution
ipset — Create IP sets for firewall rules. More information: <https://manned.org/ipset>.Create an empty IP set which will contain IP addresses:
ipset create {{set_name}} hash:ipDestroy a specific IP set:
ipset destroy {{set_name}}Add an IP address to a specific set:
ipset add {{set_name}} {{192.168.1.25}}Delete a specific IP address from a set:
ipset del {{set_name}} {{192.168.1.25}}Save an IP set:
ipset save {{set_name}} > {{path/to/ip_set}}Code Snippets
Create an empty IP set which will contain IP addresses
ipset create {{set_name}} hash:ipDestroy a specific IP set
ipset destroy {{set_name}}Add an IP address to a specific set
ipset add {{set_name}} {{192.168.1.25}}Delete a specific IP address from a set
ipset del {{set_name}} {{192.168.1.25}}Save an IP set
ipset save {{set_name}} > {{path/to/ip_set}}Context
tldr-pages: linux/ipset
Revisions (0)
No revisions yet.