ipset restore则用于将导出的内容导入。
其它
| flush [ SETNAME ] Flush all entries from the specified set or flush all sets if none is given. e, rename SETNAME-FROM SETNAME-TO Rename a set. Set identified by SETNAME-TO must not exist. w, swap SETNAME-FROM SETNAME-TO Swap the content of two sets, or in another words, exchange the name of two sets. The referred sets must exist and identical type of sets can be swapped only. help [ TYPENAME ] Print help and set type specific help if TYPENAME is specified. version Print program version. - If a dash is specified as command, then ipset enters a simple interactive mode and the commands are read from the standard input. The interactive mode can be finished by entering the pseudo-command quit. |
在iptables中使用ipset
在iptables中可以使用-m set启用ipset模块,例如。
| -A POSTROUTING -m set --match-set felix-masq-ipam-pools src -m set ! --match-set felix-all-ipam-pools dst -j MASQUERADE |
iptables的set模块:
| set This module matches IP sets which can be defined by ipset(8). [!] --match-set setname flag[,flag]... where flags are the comma separated list of src and/or dst specifications and there can be no more than six of them. Hence the command iptables -A FORWARD -m set --match-set test src,dst ... |
在TARGET中也可以操作ipset:
| SET This module adds and/or deletes entries from IP sets which can be defined by ipset(8). --add-set setname flag[,flag...] add the address(es)/port(s) of the packet to the set --del-set setname flag[,flag...] delete the address(es)/port(s) of the packet from the set where flag(s) are src and/or dst specifications and there can be no more than six of them. ... |
在man iptables-extensions中可以找到set module和SET TARGET的所有选项。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对易采站长站的支持。








